Skip to content

fix(ghauth): persist device-flow token with --insecure-storage - #111

Merged
AlexShchuka merged 1 commit into
mainfrom
fix/ghauth-insecure-storage
Jun 10, 2026
Merged

AlexShchuka merged 1 commit into
mainfrom
fix/ghauth-insecure-storage

Conversation

@AlexShchuka

Copy link
Copy Markdown
Owner

What

Add --insecure-storage to the in-container gh auth login --web invocation.

Why

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 mirabilis launch dies with GitHub 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-storage writes the token to a file in the persistent gh-config volume — the storage this design already depends on (a keyring token wouldn't survive a container rebuild anyway, and the container is the security boundary per SECURITY.md).

Verification

In the live locked-down container, piping a token through the file-storage path logs in cleanly (exit 0, token in hosts.yml); the keyring default is the only thing that breaks. go build ./..., gofmt, go vet, and go test ./internal/ghauth/... are green.

Refs cli/cli#10108.

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]>
@github-actions

Copy link
Copy Markdown

Coverage: 97.9%

@AlexShchuka
AlexShchuka merged commit 68aef83 into main Jun 10, 2026
12 checks passed
@AlexShchuka
AlexShchuka deleted the fix/ghauth-insecure-storage branch June 10, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant