Skip to content

feat(agents-login): store captured credentials in agents-api Postgres, not Vault#730

Merged
ExtraToast merged 2 commits into
mainfrom
feat/credential-postgres-portal
Jun 25, 2026
Merged

feat(agents-login): store captured credentials in agents-api Postgres, not Vault#730
ExtraToast merged 2 commits into
mainfrom
feat/credential-postgres-portal

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

Companion to the agents-repo user-scoped credential store. The agents-login worker stops writing Vault and hands captured Claude/Codex tokens to agents-api, which persists them per user in Postgres.

  • Worker POSTs to POST /api/v1/internal/credentials (bearer-authenticated, in-cluster) with {userId, provider, payload}; agentsApiClient replaces vaultClient. Capture fails loudly and persists nothing when no token is produced.
  • config.ts: adds AGENTS_API_INTERNAL_URL + AGENTS_API_INTERNAL_BEARER, removes the Vault settings.
  • Worker manifest wires the agents-api URL + internal bearer, drops the Vault role/env (egress to agents-system retained).
  • Removes the Vault claude-oauth / codex-oauth VaultStaticSecrets + kustomization entries, and the agents/{claude,codex}-oauth Vault policy paths + agents-oauth-writer role in bootstrap-auth.sh.
  • Docs (agents README/SETUP/AGENT-PARITY + agents-login README) describe Postgres-via-agents-api storage.

Validation

agents-login: 78 tests + typecheck + lint pass. platform: node --test 56/56 pass. Render unaffected.

…, not Vault

The login worker no longer writes Claude/Codex tokens to Vault. On a
successful capture it POSTs them to agents-api's in-cluster ingest
endpoint (POST /api/v1/internal/credentials, bearer-authenticated),
which persists them per user in Postgres; capture fails loudly and
stores nothing when no token is produced.

- New agentsApiClient replaces vaultClient; config gains
  AGENTS_API_INTERNAL_URL + AGENTS_API_INTERNAL_BEARER and drops the
  Vault settings.
- Worker manifest wires the agents-api URL + internal bearer and drops
  the Vault role/env; egress to agents-system retained.
- The Vault claude-oauth / codex-oauth VaultStaticSecrets, their
  kustomization entries, and the agents/{claude,codex}-oauth Vault
  policy paths + agents-oauth-writer role are removed.
- Docs updated to describe Postgres-via-agents-api storage.
@ExtraToast ExtraToast added the enhancement New feature or request label Jun 25, 2026
@ExtraToast ExtraToast self-assigned this Jun 25, 2026
The agents/claude-oauth + agents/codex-oauth Vault paths and the
agents-oauth-writer role were removed (OAuth tokens now persist in
agents-api Postgres), so the bootstrap-validate workflow no longer
asserts them.
@ExtraToast ExtraToast merged commit 276bb30 into main Jun 25, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant