Skip to content

feat(auth): add client-key-issuance Okta scope#643

Open
sophia-chen-ttd wants to merge 2 commits into
mainfrom
sc-UID2-6903-add-okta-scope
Open

feat(auth): add client-key-issuance Okta scope#643
sophia-chen-ttd wants to merge 2 commits into
mainfrom
sc-UID2-6903-add-okta-scope

Conversation

@sophia-chen-ttd
Copy link
Copy Markdown
Contributor

Summary

  • Add uid2.admin.client-key-issuance Okta custom scope mapped to Role.MAINTAINER
  • Extend OktaCustomScopeTest and AdminAuthMiddlewareTest parameterised cases (authorised + unauthorised)
  • Unblocks the /uid2-client-key Claude 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 to SUPER_USER or PRIVILEGED, 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 locally
  • mvn clean verify — BUILD SUCCESS locally
  • Reviewer confirms the scope→role mapping is appropriate (MAINTAINER only — no SUPER_USER / PRIVILEGED leakage)

Related PRs

  • UnifiedID2/uid2-okta-configuration#195 — defines the Okta scope + whitelists the test service-account app
  • uid2/uid2-claude-skills branch sc-UID2-6903-client-key-skill — the /uid2-client-key skill itself

(Supersedes #642 — same code, dropped accidentally-included planning docs.)

Refs: UID2-6903

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant