resilient_client: Prevent authentication token leakage in logs#1171
resilient_client: Prevent authentication token leakage in logs#1171ansasaki merged 3 commits intokeylime:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add SecretToken wrapper type that automatically displays SHA-256 hash prefix (first 8 chars) instead of plaintext when logged or formatted. Actual token value accessible only via explicit reveal() call. - Created SecretToken with cached hash for Display/Debug traits - Updated SessionToken to use SecretToken field - Enhanced LoggingMiddleware to redact Authorization headers This prevents accidental token exposure through logs while maintaining debuggability by showing hash prefix for correlation. Assisted-by: Claude Sonnet 4.5 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Add the push-attestation tests to the packit test plan. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
The SecretToken wraps a token to make it difficult to accidentaly reveal its value when logging. This adds unit tests for the SecretToken functionality. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
A simple re-run made the test to run as expected, but the coverage values are weird. It seems some coverage data is not being considered. I suspect the upstream test suite is not being included in the coverage calculation or the upstream test suite is not running completely (maybe not all features, like |
Yeah, these coverage numbers are weird, at a first glance. It would be great if we investigated them to find out whether they are correct. In any case, the change looks good to me, thanks! |
Checking the logs of the |
Add SecretToken wrapper type that automatically displays SHA-256 hash prefix (first 8 chars) instead of plaintext when logged or formatted. Actual token value accessible only via explicit reveal() call.
This prevents accidental token exposure through logs while maintaining debuggability by showing hash prefix for correlation.
Assisted-by: Claude Sonnet 4.5