Repository navigation
fix(github): keep the clone token out of git's command line - #7
Merged
Merged
Conversation
The token was embedded in the clone URL, so a failed clone printed it in the CalledProcessError traceback. shallow_clone() now passes it as an http.extraheader through GIT_CONFIG_* environment variables, which never appear in argv, git output or Python errors. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
https://x-access-token:<token>@github.com/...). When a clone failed, Python'sCalledProcessErrorprinted the full command, so the token appeared in plain text in the traceback and in any log or terminal that captured it.shallow_clone()inrag/github.pypasses the token as a githttp.extraheaderthroughGIT_CONFIG_COUNT/GIT_CONFIG_KEY_n/GIT_CONFIG_VALUE_nenvironment variables. The token no longer appears in the command line, git's output, a Python error, or the temporary clone's.git/config.authed_clone_url()is removed. All three clone sites useshallow_clone():ingest.py --repoand the two clones insync.py.Linear / spec
Test plan
git config --get http.https://github.com/.extraheaderreturns the expected value)CalledProcessErrormessage or traceback, and GitHub rejecting the dummy token shows the header was senthttps://github.com//code-review --fix: no findingsGITHUB_TOKENRisk / rollback
GIT_CONFIG_COUNT. The Docker image's Debian git meets this.github.com, git sends two Authorization headers and GitHub may reject the clone. That's unlikely, and Railway has no such config.Checklist
DV-XXX/OQ-XXXrows deleted (not annotated) (n/a)🤖 Generated with Claude Code