Repository navigation
feat: add multi-key scoped API access - #16
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🔵 Needs a closer look
The broad authentication, migration, concurrency, and secret-management changes warrant final human security review.
0 open findings
What changed in this PR
Adds multi-key, scoped API access with read-only/read-write permissions while preserving legacy key compatibility.
Changes:
- Adds labeled v2 credentials, migration, authorization, and race protections.
- Publishes OpenAPI documentation and read-only client setup guidance.
- Expands dashboard key management and automated coverage.
| File | Description |
|---|---|
SPEC.md |
Defines the multi-key security and UX model. |
vitest.config.ts |
Adds the source alias for unit tests. |
drizzle/0003_old_molly_hayes.sql |
Migrates credentials to labels and access levels. |
drizzle/meta/0003_snapshot.json |
Records the migrated database schema. |
drizzle/meta/_journal.json |
Registers migration 0003. |
src/db/schema.ts |
Models multiple labeled, permissioned keys. |
src/lib/agent/contracts.ts |
Adds access-level and multi-key contracts. |
src/lib/agent/openapi.ts |
Defines the Agent API OpenAPI document. |
src/lib/agent/setup.ts |
Generates secret-free read-only setup prompts. |
src/lib/server/agent-api-token.ts |
Implements v2 domain-separated credentials. |
src/lib/server/agent-api-key-service.ts |
Implements multi-key lifecycle operations. |
src/lib/server/agent-api-keys.ts |
Exposes owner-authorized metadata listing. |
src/lib/server/agent-api-authorization.ts |
Enforces key versions and write permissions. |
src/lib/server/agent-api-http.ts |
Adds the insufficient-scope response. |
src/app/actions/agent-api-keys.ts |
Validates and executes key management actions. |
src/app/api/agent/v1/openapi.json/route.ts |
Serves the public OpenAPI document. |
src/app/api/agent/v1/nodes/route.ts |
Requires write access for node creation. |
src/app/api/agent/v1/nodes/[nodeId]/timer/route.ts |
Requires write access for timer mutations. |
src/app/page.tsx |
Loads all keys for the selected node. |
src/components/dashboard-shell.tsx |
Displays multi-key status and opens management. |
src/components/agent-access-dialog.tsx |
Adds accessible multi-key management controls. |
src/app/globals.css |
Styles the expanded key-management interface. |
tests/unit/agent-setup.test.ts |
Tests secret-free setup prompts. |
tests/unit/agent-openapi.test.ts |
Tests OpenAPI coverage and serving. |
tests/integration/schema.test.ts |
Tests new credential constraints and indexing. |
tests/integration/agent-api.test.ts |
Tests read-only and legacy authorization. |
tests/integration/agent-api-races.test.ts |
Tests authorization mutation races. |
tests/integration/agent-api-keys.test.ts |
Tests multi-key lifecycle and token behavior. |
tests/integration/agent-api-key-migration.test.ts |
Tests deterministic legacy migration. |
tests/integration/agent-api-key-actions.test.ts |
Tests owner-facing multi-key actions. |
tests/e2e/agent-access.spec.ts |
Tests accessible multi-key dashboard workflows. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully deployed
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
Verification
pnpm db:checkpnpm lintpnpm typecheckpnpm test— 116 testspnpm test:integration— 107 testspnpm build