Repository navigation
fix(ghauth): persist device-flow token with --insecure-storage - #111
Merged
Merged
Conversation
gh auth login --web defaults to the system keyring. The sandbox has no keyring/D-Bus, so a freshly built container (gh 2.93) fails right after the browser grant: the token is never written, ~/.config/gh stays empty, and launch dies with "GitHub sign-in — exit status 1". Older gh stored to a file by default, which is why it used to work. --insecure-storage writes the token to a file in the persistent gh-config volume — the storage this design already relies on (a keyring token would not survive a container rebuild anyway). Verified live: the file-storage path logs in cleanly while the keyring default is what breaks. Refs cli/cli#10108. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <[email protected]>
|
Coverage: 97.9% |
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.
What
Add
--insecure-storageto the in-containergh auth login --webinvocation.Why
gh auth login --webdefaults to the system keyring. The sandbox has no keyring/D-Bus, so a freshly built container (gh 2.93) fails right after the browser grant — the token is never written,~/.config/ghstays empty, andmirabilis launchdies withGitHub sign-in — exit status 1. An older gh stored to a file by default, which is why sign-in used to work before a rebuild.--insecure-storagewrites the token to a file in the persistentgh-configvolume — the storage this design already depends on (a keyring token wouldn't survive a container rebuild anyway, and the container is the security boundary perSECURITY.md).Verification
In the live locked-down container, piping a token through the file-storage path logs in cleanly (
exit 0, token inhosts.yml); the keyring default is the only thing that breaks.go build ./...,gofmt,go vet, andgo test ./internal/ghauth/...are green.Refs cli/cli#10108.