-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: redact sensitive headers and body content in debug logs (#217)
**Commit Message**: This commit introduces functions to redact sensitive headers and body content before logging, ensuring that sensitive information such as authorization tokens is not exposed in debug logs. The new filterSensitiveHeaders function redacts specified headers, replacing their values with [REDACTED], while filterSensitiveBody ensures that sensitive content in request bodies is also redacted before being logged. Additionally, the logging behavior has been updated so that request headers and body content are only logged when the DEBUG level is enabled, further improving security and performance. Unit tests have been added to verify the functionality of both filterSensitiveHeaders and filterSensitiveBody, ensuring that sensitive data is properly redacted and that the logging behavior works as expected. Signed-off-by: Sébastien Han <seb@redhat.com> --------- Signed-off-by: Sébastien Han <seb@redhat.com>
- Loading branch information
Showing
2 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters