ποΈ fix: redact Authorization header in debug transport output#46
Merged
Conversation
Debug mode (`--debug` / `ROOTLY_DEBUG`) was dumping full HTTP requests including the raw Authorization header (API key or OAuth token) to stderr. In CI pipelines and log aggregation systems this exposes credentials in plaintext. Clones the request before dumping and replaces the Authorization value with `Bearer [REDACTED]`. The original request with the real token is still sent to the server unchanged. Adds 3 regression tests: - Redaction appears in debug output - Real token still reaches the server - No spurious redaction when no auth header present π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Greptile SummaryThis PR redacts Authorization values from debug HTTP request output. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "π fix: prevent body consumption and fix..." | Re-trigger Greptile |
Address Greptile review feedback: DumpRequestOut with body=true was consuming the shared request body via Clone's shallow copy, causing POST/PUT/PATCH requests to arrive empty at the server. Now dumps headers only (body=false) with http.NoBody on the clone. Also fix lint: close response bodies, use http.NoBody, use NewRequestWithContext in tests. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
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.
Summary
--debugmode dumps rawAuthorization: Bearer <token>to stderr viahttputil.DumpRequestOut, leaking API keys and OAuth tokens in CI logs and log aggregation systems.Bearer [REDACTED]. The real token is still sent to the server unchanged.Test plan
TestDebugTransportRedactsAuthorizationβ raw token absent,[REDACTED]present in stderrTestDebugTransportPreservesActualAuthHeaderβ server receives real tokenTestDebugTransportNoAuthHeaderβ no spurious redaction without auth header