Skip to content

Commit b594088

Browse files
committed
fix(server): centralize environment secret redaction
1 parent a0dcb6a commit b594088

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/server/src/cli/envValidation.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ export class ServerEnvValidationError extends Schema.TaggedError<ServerEnvValida
3838
}
3939
}
4040

41+
const secretVariableNamePattern = /TOKEN|SECRET|KEY|PASSWORD/i;
42+
4143
const redact = (spec: ServerEnvVarSpec, value: string) =>
42-
spec.secret || /TOKEN|SECRET|KEY|PASSWORD/i.test(spec.variable) ? "<redacted>" : value;
44+
spec.secret || secretVariableNamePattern.test(spec.variable) ? "<redacted>" : value;
4345

4446
const renderReceived = (row: ServerEnvVariableRow) => {
4547
if (row.received === undefined) return "—";

0 commit comments

Comments
 (0)