feat: store tokens securely via OS credential manager#137
Closed
rhuanbarreto wants to merge 1 commit into
Closed
Conversation
Replace plaintext token storage in ~/.archgate/credentials with Bun.secrets, which uses the OS credential manager (macOS Keychain, Windows Credential Manager, Linux libsecret) to encrypt tokens at rest. Changes: - New credential-store.ts: token → Bun.secrets, metadata → JSON file - New credential-helper command: git calls `archgate credential-helper` to retrieve credentials for plugins.archgate.dev transparently - Login flow configures git credential helper automatically - Falls back to plaintext file when OS credential manager unavailable - Backwards compatible with existing ~/.archgate/credentials files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploying archgate-cli with
|
| Latest commit: |
86b1ea3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5053d32e.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-secure-credential-stora.archgate-cli.pages.dev |
Contributor
Author
|
Superseded — using native git credential helpers instead of custom Bun.secrets + credential-helper command |
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
Bun.secretsinstead of plaintext~/.archgate/credentialsarchgate credential-helpercommand — a git credential helper that retrieves tokens from the OS credential manager, enabling transparent authentication forgit cloneoperations fromplugins.archgate.devarchgate loginconfiguresgit config --global credential.https://plugins.archgate.dev.helper "archgate credential-helper"so Claude Code can authenticate via its native git credential helper supportHow it works
Token storage
Git credential flow
Backwards compatibility
~/.archgate/credentialsfiles still work (fallback)Files changed
src/helpers/credential-store.ts— Bun.secrets storage with file fallbacksrc/commands/credential-helper.ts— Git credential helper commandsrc/helpers/auth.ts— Re-exports from credential-store.tssrc/helpers/login-flow.ts— Configures git credential helper on loginsrc/cli.ts— Registers credential-helper commandTest plan
archgate loginstores token in Keychain/Credential Managergit clone https://plugins.archgate.dev/archgate.gituses credential helper🤖 Generated with Claude Code