Skip to content

feat: switch to git credential auth, remove token management#136

Closed
rhuanbarreto wants to merge 1 commit into
mainfrom
feat/git-credential-auth
Closed

feat: switch to git credential auth, remove token management#136
rhuanbarreto wants to merge 1 commit into
mainfrom
feat/git-credential-auth

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Remove archgate-specific token management — the CLI no longer claims, stores, or embeds ag_beta_ tokens in plugin URLs
  • Rely on git credential helpers for authentication — Claude Code, Copilot CLI, and VS Code use the user's existing git credentials (e.g., gh auth login, macOS Keychain)
  • Simplify login flow to registration-only — archgate login still uses GitHub Device Flow but only for signup verification, not token claiming

Details

What Changed

Component Before After
StoredCredentials { token, github_user, created_at } { github_user, created_at }
Plugin URLs https://user:ag_beta_token@plugins.archgate.dev/archgate.git https://plugins.archgate.dev/archgate.git
Login flow Device Flow → claim token → store token Device Flow → register → store username
Cursor install Bearer token auth Prompts for GitHub username + PAT
archgate plugin url Requires login (for token) No login required

Files Changed

  • src/helpers/auth.ts — Remove claimArchgateToken, checkRegistration; simplify StoredCredentials
  • src/helpers/plugin-install.ts — Remove credentials from URLs; buildMarketplaceUrl() takes no args
  • src/helpers/login-flow.ts — Remove token claiming; simplified to registration only
  • src/helpers/signup.ts — Remove token from SignupResult
  • src/commands/login.ts — Updated messaging (registered vs logged in)
  • src/commands/plugin/install.ts — No stored credentials needed; Cursor prompts for GitHub credentials
  • src/commands/plugin/url.ts — No longer requires login
  • src/helpers/init-project.ts — Updated to use parameterless URL builders

Companion PR

  • archgate/plugins#31 — Backend changes (GitHub credential verification)

Test plan

  • All unit tests pass (52 affected tests, 0 failures)
  • Lint passes (0 warnings, 0 errors)
  • Typecheck clean (only pre-existing sentry/telemetry issues)
  • End-to-end: archgate login registers user successfully
  • End-to-end: archgate plugin install works with git credential helpers
  • End-to-end: archgate plugin install --editor cursor prompts and downloads

🤖 Generated with Claude Code

Replace archgate-specific token authentication with git credential helpers.
Users now authenticate to the plugin service using their existing GitHub
credentials (PAT/OAuth token via git credential helpers like gh auth login).

Changes:
- Remove token claiming (claimArchgateToken) and credential storage
- StoredCredentials now stores only github_user (no token)
- Plugin URLs are bare (no embedded credentials)
- Claude Code/Copilot CLI rely on git credential helpers
- Cursor plugin install prompts for GitHub credentials
- Login flow simplified to registration only

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: c1ea12a
Status: ✅  Deploy successful!
Preview URL: https://ef73eae6.archgate-cli.pages.dev
Branch Preview URL: https://feat-git-credential-auth.archgate-cli.pages.dev

View logs

@rhuanbarreto

Copy link
Copy Markdown
Contributor Author

Superseded — pivoting to Bun.secrets-based credential storage instead of removing tokens

@rhuanbarreto rhuanbarreto deleted the feat/git-credential-auth branch March 22, 2026 18:21
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