Repository navigation
Conversation
AuthTokenAuthenticator logged the token at debug level, and the whole Authorization header when it did not match "Bearer <token>". That looks harmless with APP_LOG_LEVEL=info, but config/packages/monolog.yaml also defines filter_for_errors, a fingers_crossed handler whose nested file_log handler has no level: as soon as a request logs one error, every record buffered for that request, debug included, is written to mcp.log. A failed tool call or a token refused by iTop is enough to put the token in the log in clear. The messages stay, only the secret goes. The logging setup is left as it is: escalating to debug on error is useful, a secret in a debug message is not.
There was a problem hiding this comment.
🟢 Approval recommended
Both changes remove credential exposure without altering authentication logic or logging configuration.
No open issues 🎉
What changed in this PR
Removes credentials from authentication debug logs while preserving diagnostic messages and authentication behavior.
Changes:
- Stops logging malformed Authorization header contents.
- Replaces bearer token output with a generic receipt message.
| File | Description |
|---|---|
| src/Security/AuthTokenAuthenticator.php | Removes sensitive values from two debug messages. |
Review effort: Balanced
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.
Fixes #23.
AuthTokenAuthenticatorno longer puts the token, or the rawAuthorizationheader, in its debug messages. The messages themselves stay. One file, two lines, no change in behaviour.