fix: Redact Authorization bearer token in debug logs#1284
Merged
Conversation
Contributor
Author
|
@Konboi there is one failure for Python package build. Is this OK? |
Konboi
reviewed
Apr 20, 2026
| from launchable.utils.http_client import _HttpClient | ||
| from launchable.version import __version__ | ||
|
|
||
| from smart_tests.app import Application |
Contributor
There was a problem hiding this comment.
I think we need to fix the package names
Contributor
There was a problem hiding this comment.
v1 is launchable, v2 is smart_tets
Added _sanitize_headers() function to redact sensitive Authorization bearer tokens when logging HTTP requests in debug mode. The token value is replaced with [REDACTED] while preserving the "Bearer " prefix. We can use HTTP library for this but this needs library version upgrade. This is the most simplest way to work with small number of code.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dded _sanitize_headers() function to redact sensitive Authorization bearer tokens when logging HTTP requests in debug mode. The token value is replaced with [REDACTED] while preserving the "Bearer " prefix.
We can use HTTP library for this but this needs library version upgrade. This is the most simplest way to work with small number of code.
I will merge v1 change to v2 after merging this PR>