Add internal admin claims APIs and review UI#297
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Motivation
Description
api/admin/_auth.jsthat enforcesADMIN_API_KEYwithAuthorization: Bearer <key>and returns503 ADMIN_NOT_CONFIGUREDwhen unset or401 UNAUTHORIZEDwhen invalid.GET /api/admin/claimsinapi/admin/claims.jsto return newest-first claims fromclaim_requests(defaultlimit=50, capped to200) and computeagentCountfromclaim_agents.GET /api/admin/claim?claimId=...inapi/admin/claim.jsto return the claim row, its agents, and claim events for detailed inspection.public/admin/claims.htmlwith API key storage (session/localStorage), claims table, clickable rows, detail panel, and copy buttons for claim JSON and ENS records; all server APIs uselib/db.jsfor DB access.tests/api-admin-claims.test.jsto validate admin config/auth behavior and mocked DB responses for list/detail endpoints.Testing
npm testat repo root and all tests passed (66tests passed,0failed), including the new admin tests.cd examples/webhook-auto-verify && npm run checkwhich completed successfully.npm installat the repo root failed in this environment due to a registry403when attempting to fetch@neondatabase/serverless.npm run buildis not present in the repo (missingbuildscript), so no build step was executed.Codex Task