Skip to content

Add internal admin claims APIs and review UI#297

Merged
GsCommand merged 1 commit into
mainfrom
codex/add-internal-admin-claims-view
May 23, 2026
Merged

Add internal admin claims APIs and review UI#297
GsCommand merged 1 commit into
mainfrom
codex/add-internal-admin-claims-view

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Provide an operator-facing view to review persisted CommandLayer namespace claim requests stored in Neon/Postgres.
  • Allow listing and inspecting individual claim requests, associated agents, and event timelines for manual review.
  • Keep admin access gated by a simple environment-protected API key until a proper auth system is added.

Description

  • Added an admin auth helper api/admin/_auth.js that enforces ADMIN_API_KEY with Authorization: Bearer <key> and returns 503 ADMIN_NOT_CONFIGURED when unset or 401 UNAUTHORIZED when invalid.
  • Added GET /api/admin/claims in api/admin/claims.js to return newest-first claims from claim_requests (default limit=50, capped to 200) and compute agentCount from claim_agents.
  • Added GET /api/admin/claim?claimId=... in api/admin/claim.js to return the claim row, its agents, and claim events for detailed inspection.
  • Added a lightweight internal review page public/admin/claims.html with API key storage (session/localStorage), claims table, clickable rows, detail panel, and copy buttons for claim JSON and ENS records; all server APIs use lib/db.js for DB access.
  • Added tests in tests/api-admin-claims.test.js to validate admin config/auth behavior and mocked DB responses for list/detail endpoints.

Testing

  • Ran npm test at repo root and all tests passed (66 tests passed, 0 failed), including the new admin tests.
  • Verified the example checks with cd examples/webhook-auto-verify && npm run check which completed successfully.
  • npm install at the repo root failed in this environment due to a registry 403 when attempting to fetch @neondatabase/serverless.
  • npm run build is not present in the repo (missing build script), so no build step was executed.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 23, 2026 12:46am
commandlayer-org Ready Ready Preview, Comment May 23, 2026 12:46am
commandlayer-org111 Ready Ready Preview, Comment May 23, 2026 12:46am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant