Skip to content

feat: add named client API keys with provider allowlists - #35

Merged
caigee-cmd merged 1 commit into
mainfrom
feature/named-api-keys
Aug 29, 2026
Merged

caigee-cmd merged 1 commit into
mainfrom
feature/named-api-keys

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Add SQLite api_keys (migration 008) for named client keys. Empty providers means every family; a list is applied in auth and passed to PickRoute as AllowedProviders.
  • Keep the console administrator key in app_secrets.proxy_api_key. /api/* still requires it. /v1 accepts the console key or a named client key.
  • Add /keys for client-key CRUD and show the console key prefix on System, with one-time reveal after create/rotate.

The scheduler does not look up keys. Auth resolves the identity; routing only receives the allowlist.

Test plan

  • go test ./internal/accounts ./internal/auth ./internal/executor ./internal/api
  • cd frontend && npm run lint && npm run sync
  • Create a key limited to Qoder: /v1 should not land on WorkBuddy/Trae
  • Create a key with no providers: /v1 can use every family
  • Named keys get 403 on /api/keys and /api/overview
  • Rotate the console key on System; this session is updated and the secret is shown once

Keep the console administrator secret in app_secrets. Client keys live
in a new api_keys table, unlock only /v1, and pass their provider
allowlist into PickRoute. The console shows key CRUD on /keys and the
administrator prefix on System.
@caigee-cmd
caigee-cmd merged commit 7f23a56 into main Aug 29, 2026
6 checks passed
@caigee-cmd
caigee-cmd deleted the feature/named-api-keys branch September 19, 2026 15:02
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