feat(security): token-issuance UI + served agent-skill (server-verified step-up; anon agent skill)#1619
Open
JasonWildMe wants to merge 10 commits into
Open
feat(security): token-issuance UI + served agent-skill (server-verified step-up; anon agent skill)#1619JasonWildMe wants to merge 10 commits into
JasonWildMe wants to merge 10 commits into
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>
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
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