Skip to content

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

Open
sophia-chen-ttd wants to merge 3 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 3 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>
Release Workflow and others added 2 commits May 21, 2026 04:05
CLAUDE_ACCESS is a new fine-grained role (uid2-shared 11.4.21-alpha-349-SNAPSHOT)
designed specifically for machine/service-account access. It grants read access
to all non-reveal endpoints and add-only POST access, without the full breadth
of Role.MAINTAINER. Mapping CLIENT_KEY_ISSUANCE to CLAUDE_ACCESS instead of
MAINTAINER tightens the privilege boundary for this Okta scope.

Also adds an unauthorized test case asserting that a CLIENT_KEY_ISSUANCE token
cannot access MAINTAINER-only endpoints, explicitly verifying the subset constraint.

Refs: UID2-6903

Co-Authored-By: Claude Sonnet 4.6 <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