feat(auth): add client-key-issuance Okta scope#642
Closed
sophia-chen-ttd wants to merge 4 commits into
Closed
Conversation
Captures the minimum backend change (one new Okta machine-auth scope mapped to Role.MAINTAINER) and the workflow for a /uid2-client-key skill that drives the runbook end-to-end. Scopes the work to UID2 client keys only; operator keys, CSTG, Databricks, and EUID are explicit follow-ups under the broader UID2-6903 epic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task-by-task plan spanning two repos:
Phase 1 (this repo, uid2-admin): add CLIENT_KEY_ISSUANCE Okta scope
mapped to Role.MAINTAINER, with parameterised tests mirroring the
existing SS_PORTAL/SECRET_ROTATION patterns.
Phase 2 (uid2-claude-skills): new /uid2-client-key skill driving the
full runbook end-to-end.
Phase 3 (operational): Okta service account provisioning + 1Password
credential storage.
Refs: UID2-6903
Spec: docs/superpowers/specs/2026-05-21-claude-client-key-issuance-design.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three changes from the user: - Drop the 1Password CLI dependency. Credentials live in shell env vars (UID2_ADMIN_CLAUDE_<ENV>_OKTA_CLIENT_ID/_SECRET, shared _AUTH_SERVER). Secret distribution becomes a print-to-terminal + engineer-driven out-of-band share via the existing Confluence-documented flow. - Site-not-found halts with a two-option prompt: re-check with a corrected name (loop), or authorise creating a new site. No more auto-create on a no-match miss. - Add 'test' env (https://admin.test.uidapi.com). Skill ships with three envs (test/integ/prod), and the integration test in Task 19 now runs against the test deployment, not integ. Same Okta tenant, one service account per env (per AdminAuthMiddleware:148 the JWT's environment claim must match the admin's configured environment). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Contributor
Author
|
Superseded by #643 — same code, just dropped the accidentally-committed planning docs from this branch's history. |
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 locallyRefs: UID2-6903
🤖 Generated with Claude Code