Repository navigation
feat(aqua): replace ghtkn auth with keyring token and go all-profile - #223
Merged
Merged
Conversation
- aqua global config, PATH precedence, and the relink script now apply to all profiles; business packages stay guarded in the template - drop ghtkn (package, AQUA_GHTKN_ENABLED, gh wrapper + test): the 8h Device Flow re-auth cycle cost more convenience than short-lived tokens were worth - AQUA_KEYRING_ENABLED=true with a new aqua-token-sync helper pipes gh's SSO-authorized token into the OS keychain; it refuses empty tokens and suppresses xtrace. Required for the private C-FO aqua-registry. Co-Authored-By: Claude Fable 5 <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.
Overview
Reworks how aqua obtains GitHub tokens and where aqua applies. The ghtkn Device Flow integration shipped in #222 required a browser re-auth every 8 hours, which cost more convenience than the short-lived tokens were worth. This PR removes ghtkn entirely and replaces it with aqua's keyring integration (
AQUA_KEYRING_ENABLED, aqua ≥ v2.51), fed once by the SSO-authorizedghOAuth token. It also completes the promotion of the aqua base config (global config, PATH precedence, relink script) from business-only to all profiles; the binary still ships viaBrewfile.work, so personal machines skip everything gracefully behind acommand -v aquaguard.Token flow
flowchart LR subgraph before["Before (#222)"] ghw[gh wrapper] -->|"ghtkn get (8h Device Flow)"| kc1[(Keychain)] aqua1[aqua] -->|AQUA_GHTKN_ENABLED + embedded SDK| kc1 endflowchart LR subgraph after["After (this PR)"] sync[aqua-token-sync] -->|"gh auth token → aqua token set --stdin (one-time)"| kc2[(Keychain)] aqua2[aqua] -->|AQUA_KEYRING_ENABLED| kc2 gh2[gh] -->|own keyring OAuth, no wrapper| gh2 endChanges
suzuki-shunsuke/ghtknpackage,AQUA_GHTKN_ENABLED, the interactiveghwrapper (ghtkn-gh.zsh) and its testAQUA_KEYRING_ENABLED=trueto the business block of.zshenv— required because some C-FO repos resolve a privategithub_contentaqua-registryaqua-token-sync(business-only zsh feature) wrappinggh auth token | aqua token set --stdin. Unlike the raw pipe it refuses to store an empty token whengh auth tokenfails (pipe sides run concurrently) and runs underno_xtraceso the token cannot leak into trace outputaqua.yamlbecomes a template (business packages guarded, personal getspackages: []), the relink script drops its business guard,.zshenv/.zshrckeep aqua ahead of Homebrew and devbox via the_aqua_force_pathprecmd hookVerification
just lint-zsh test-zsh-features fmt-checkgreen; new 6-case test covers stdin delivery, stdout/xtrace non-leakage, empty/failed-token refusal, missing-command exit code, and business-only renderingaqua i -linC-FO/clusteropsresolved the private registry andaqua exec -- helmfile-trace --helpdownloaded and ran a private release binary (exit 0)ghkeyring OAuth verified against a private C-FO repo (no wrapper needed)Notes
~/.config/ghtkn/ghtkn.yamlstays machine-local and untracked; harmless if ghtkn ever returnsjust lint-luafailure (luacmissing from the devbox profile) is pre-existing and untouched here