Skip to content

fix: wire log-redact dead code — add Pino redact + use safeFlowProjection (closes #69)#76

Open
LucasMaupin wants to merge 1 commit into
mainfrom
fix/issue-69-wire-log-redact-dead-code
Open

fix: wire log-redact dead code — add Pino redact + use safeFlowProjection (closes #69)#76
LucasMaupin wants to merge 1 commit into
mainfrom
fix/issue-69-wire-log-redact-dead-code

Conversation

@LucasMaupin

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Pino's built-in redact option to the Fastify logger in src/server.ts, censoring structured log fields whose keys match the SENSITIVE_KEYS pattern (passphrase, srt_uri, streamid, authorization, token, pat, secret) with [REDACTED] at the logger level as a defence-in-depth measure.
  • Imports and calls safeFlowProjection from src/lib/log-redact.ts in src/lib/flow-generator.ts, replacing the inline manual flow projection that duplicated the same logic.
  • Adds unit tests for both redactSensitive and safeFlowProjection in src/__tests__/log-redact.test.ts, verifying key redaction, nested objects, arrays, and that no plaintext passphrase leaks in serialised output.

Both redactSensitive and safeFlowProjection from log-redact.ts are now imported and called in production code paths, removing the dead code status identified in the issue.

Closes #69

…tion (closes #69)

Add Pino's built-in `redact` option to the Fastify logger in server.ts so
structured log fields matching the SENSITIVE_KEYS pattern (passphrase, srt_uri,
streamid, authorization, token, pat, secret) are censored at the logger level
as defence-in-depth.

Import and call `safeFlowProjection` from log-redact.ts in flow-generator.ts,
replacing the inline manual projection that duplicated the same logic.

Add unit tests for both `redactSensitive` and `safeFlowProjection` covering
key redaction, nested objects, arrays, and verifying no plaintext passphrase
leaks in serialised output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY][MEDIUM] log-redact.ts defines redactSensitive() and safeFlowProjection() but they are never imported — sensitive data logged in plaintext

1 participant