Skip to content

Add config-driven body field redaction#65

Closed
firecow wants to merge 1 commit intomasterfrom
mjn/config-driven-body-redaction
Closed

Add config-driven body field redaction#65
firecow wants to merge 1 commit intomasterfrom
mjn/config-driven-body-redaction

Conversation

@firecow
Copy link
Member

@firecow firecow commented Mar 3, 2026

Summary

  • Add redact.request_body and redact.response_body config keys with env variables REQUEST_LOG_REDACT_REQUEST_BODY and REQUEST_LOG_REDACT_RESPONSE_BODY (comma-separated field lists, dot-notation supported)
  • Request body masking now merges config fields with X-SENSITIVE-REQUEST-BODY-JSON header fields
  • Response body masking is new — previously response bodies were logged unmasked

Test plan

  • Existing tests pass (backward-compatible, defaults are empty lists)
  • New test: config-only request body masking
  • New test: config + header merge for request body
  • New test: config-driven response body masking

Add redact.request_body and redact.response_body config keys
(REQUEST_LOG_REDACT_REQUEST_BODY / REQUEST_LOG_REDACT_RESPONSE_BODY env
variables) so body fields can be masked without relying on the
X-SENSITIVE-REQUEST-BODY-JSON header.
@firecow firecow self-assigned this Mar 3, 2026
@firecow firecow closed this Mar 3, 2026
@firecow firecow deleted the mjn/config-driven-body-redaction branch March 3, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant