feat(security): token-issuance UI + served agent-skill (server-verified step-up; anon agent skill)#1619
Conversation
…eviewed) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ession-only Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…SearchApi allowlist constant + drift-guard Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Also adds missing @testing-library/dom peer dependency (required by @testing-library/react@16; was absent, breaking all RTL-based tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d username, copy fix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1619 +/- ##
==========================================
+ Coverage 51.50% 51.63% +0.13%
==========================================
Files 308 310 +2
Lines 12100 12162 +62
Branches 3920 3933 +13
==========================================
+ Hits 6232 6280 +48
- Misses 5578 5598 +20
+ Partials 290 284 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ces section The served skill said "See the field reference for full descriptions" but no such document or endpoint exists. Reword to own the inline field list, and add a References section linking the general Wildbook docs (wildbook.docs.wildme.org) while marking this skill authoritative for the token API where the two differ. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I tried on QA and tested curl -i "https://qa.wildme.org/api/v3/agent-skill", it successfully responded with instructions for AI, but when I opened the generate token page and tried to enter password and confirm, it always shows incorrect password, which is weird because i used the same password to login. I also tried to generate token thru command line: curl -i -X POST
|
naknomum
left a comment
There was a problem hiding this comment.
focused on code review of backend/java, and looks good.
only cursory examination of frontend/react additions, however.


Summary
Builds on the token-scoped read API (merged in #1613) with two user-facing pieces:
A — Token-issuance UI. A logged-in user can mint a short-lived bearer token from a new API Access page (avatar menu → API Access). A password step-up is required and enforced server-side:
AuthTokennow requires and verifies a fresh HTTP Basic credential (User.checkPassword, constant-time, mirroring login) and rejects session-only mints — a stolen/unlocked session or same-origin script can no longer mint without the password. The React mint call uses a cookie-lessfetch(credentials:"omit"); the token is shown once and held only in component state.Cache-Control: no-storeon the response.B — Served agent skill.
GET /api/v3/agent-skill(anonymous) serves a curated markdown that teaches a user's AI agent the token-scoped API, the OpenSearch schema/fields, how to obtain a token, and — importantly — to never accept the user's username/password, only a short-lived token. ASearchApi.TOKEN_ALLOWED_INDICESconstant was extracted so a drift-guard test pins the skill's index claims to the real allowlist; another test forbids leaking internal ACL field names.What changed
User.checkPassword(clearText)— constant-time verify against the stored salted hash.AuthToken— server-side step-up (fresh Basic required; session-only → 401; wrong password → 401),no-store, audit logging (no secrets).AgentSkillservlet +src/main/resources/agent-skill.md+ web.xml (anon rule, exact mapping).SearchApi.TOKEN_ALLOWED_INDICESconstant (behavior-preserving refactor of the inline allowlist).useMintToken(cookie-less, UTF-8 Basic),ApiAccessPage(step-up modal + one-time token display),/api-accessroute, avatar menu item.Testing
UserCheckPasswordTest,AuthTokenTestupdated,AuthTokenStepUpTest,AgentSkillTest,EndpointAuthWiringTest, plusSearchApiTokenAuthTest/SearchApiChildIndexTestconfirm the allowlist refactor didn't regress).useMintToken,ApiAccessPage, avatar-link tests green.package.json/package-lock.jsonchanges.Process
Brainstormed → spec → plan → subagent-driven implementation with per-task spec + code-quality review. Codex reviewed the design, the plan, and the final code (verdict: READY TO MERGE; the step-up bypass it flagged in the design was closed, and a UTF-8 Basic-encoding bug it caught in code review is fixed + tested).
Design spec + plan are included under
docs/superpowers/.🤖 Generated with Claude Code