feat(auth): add client-key-issuance Okta scope#643
Open
sophia-chen-ttd wants to merge 2 commits into
Open
Conversation
Adds a new OktaCustomScope mapped to Role.MAINTAINER so service-account access tokens can call MAINTAINER-protected endpoints (POST /api/client/add, POST /api/site/add, GET /api/site/list, GET /api/client/list/:siteId). This unblocks the /uid2-client-key Claude skill (see UID2-6903) without exposing SUPER_USER or PRIVILEGED operations to the same scope. Tests mirror the existing parameterised SS_PORTAL/SECRET_ROTATION patterns in OktaCustomScopeTest and AdminAuthMiddlewareTest. Refs: UID2-6903 Design: docs/superpowers/specs/2026-05-21-claude-client-key-issuance-design.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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
uid2.admin.client-key-issuanceOkta custom scope mapped toRole.MAINTAINEROktaCustomScopeTestandAdminAuthMiddlewareTestparameterised cases (authorised + unauthorised)/uid2-client-keyClaude skill (UID2-6903)The new scope grants only
MAINTAINER-protected operations (POST /api/client/add,POST /api/site/add,GET /api/site/list,GET /api/client/list/:siteId). It deliberately does not map toSUPER_USERorPRIVILEGED, so client deletion (/api/client/del) and reveal-by-contact (/api/client/reveal) remain unreachable by tokens carrying this scope. Two new unauthorised-case test rows assert this boundary.Test plan
mvn -pl . -am test -Dtest='com.uid2.admin.auth.*'— 48/48 pass locallymvn clean verify— BUILD SUCCESS locallyRelated PRs
(Supersedes #642 — same code, dropped accidentally-included planning docs.)
Refs: UID2-6903
🤖 Generated with Claude Code