Repository navigation
fix(api): mask access token in Payload.toString() - #386
buongarzoni wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
AI Agent Review (anthropic, CLI default model; requested openai/openai-astra)Scrutiny: standard (public API) With DEBUG logging turned on, the SDK writes each error report to the application log just before sending it to Rollbar. That log line included the project access token in plain text. Anyone who could read the logs could copy the token, and so could any log shipper or archive the logs went to. After this change the log line shows only The token sent to Rollbar does not change. Reports still reach the API with the full token. Only the log text is masked.
The only visible difference besides the masking is that a missing token now prints as Conclusion: I found no blocking problem. Things I checked:
Limits. I read the tests but did not run them. I also could not confirm the author's statement that the lint check (checkstyle) passes. The new lines look like they fit within the 100-character limit. |
Description of the change
Payload.toString()printed the access token in plain text, andRollbarBaselogs the payload atDEBUG on every event (
LOGGER.debug("Payload built: {}", payload)). Turning on DEBUG logging, whichpeople often do while debugging an incident, wrote the token to log files and any log shipper.
toString()now masks the token and keeps only its last 4 characters, so you can still tell whichtoken is configured:
Tokens of 8 characters or fewer are fully masked (
'****'). Anulltoken still printsnull.Serialization (
asJson()) is unchanged, so the token is still sent to the API.After changes

Type of change
Checklists
Development
checkstyleMain)PayloadTest)