Skip to content

Commit d57ea02

Browse files
UID2-7271: add CREATE role for Claude admin automation
Maps the new uid2.admin.create Okta scope to Role.CREATE and grants it access to the five add endpoints: site, client key, operator key, service link, and CSTG keypair. This keeps create access separate from read-only so Claude can request only the scope it needs for each task. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c8d7cb3 commit d57ea02

6 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/java/com/uid2/admin/auth/OktaCustomScope.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public enum OktaCustomScope {
1414
METRICS_EXPORT("uid2.admin.metrics-export", Role.METRICS_EXPORT),
1515
ENCLAVE_REGISTRAR("uid2.admin.enclave-registrar", Role.ENCLAVE_REGISTRAR),
1616
READ_ONLY("uid2.admin.read-only", Role.READ_ONLY),
17+
CREATE("uid2.admin.create", Role.CREATE),
1718
INVALID("invalid", Role.UNKNOWN);
1819
private final String name;
1920
private final Role role;

src/main/java/com/uid2/admin/vertx/service/ClientKeyService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void setupRoutes(Router router) {
9595
synchronized (writeLock) {
9696
this.handleClientAdd(ctx);
9797
}
98-
}, new AuditParams(List.of("name", "roles", "site_id"), Collections.emptyList()), Role.MAINTAINER, Role.SHARING_PORTAL));
98+
}, new AuditParams(List.of("name", "roles", "site_id"), Collections.emptyList()), Role.MAINTAINER, Role.SHARING_PORTAL, Role.CREATE));
9999

100100
router.post(API_CLIENT_DEL.toString()).blockingHandler(auth.handle((ctx) -> {
101101
synchronized (writeLock) {

src/main/java/com/uid2/admin/vertx/service/ClientSideKeypairService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void setupRoutes(Router router) {
7070
synchronized (writeLock) {
7171
this.handleAddKeypair(ctx);
7272
}
73-
}, new AuditParams(Collections.emptyList(), List.of("site_id", "name", "contact", "disabled")), Role.MAINTAINER, Role.SHARING_PORTAL));
73+
}, new AuditParams(Collections.emptyList(), List.of("site_id", "name", "contact", "disabled")), Role.MAINTAINER, Role.SHARING_PORTAL, Role.CREATE));
7474
router.post(API_CLIENT_SIDE_KEYPAIRS_UPDATE.toString()).blockingHandler(auth.handle((ctx) -> {
7575
synchronized (writeLock) {
7676
this.handleUpdateKeypair(ctx);

src/main/java/com/uid2/admin/vertx/service/OperatorKeyService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void setupRoutes(Router router) {
8585
synchronized (writeLock) {
8686
this.handleOperatorAdd(ctx);
8787
}
88-
}, new AuditParams(List.of("name", "protocol", "site_id", "operator_type", "roles"), Collections.emptyList()), Role.MAINTAINER));
88+
}, new AuditParams(List.of("name", "protocol", "site_id", "operator_type", "roles"), Collections.emptyList()), Role.MAINTAINER, Role.CREATE));
8989

9090
router.post(API_OPERATOR_DEL.toString()).blockingHandler(auth.handle((ctx) -> {
9191
synchronized (writeLock) {

src/main/java/com/uid2/admin/vertx/service/ServiceLinkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void setupRoutes(Router router) {
5555
synchronized (writeLock) {
5656
this.handleServiceLinkAdd(ctx);
5757
}
58-
}, new AuditParams(Collections.emptyList(), List.of("link_id", "service_id", "site_id", "name", "roles")), Role.MAINTAINER));
58+
}, new AuditParams(Collections.emptyList(), List.of("link_id", "service_id", "site_id", "name", "roles")), Role.MAINTAINER, Role.CREATE));
5959
router.post(API_SERVICE_LINK_UPDATE.toString()).blockingHandler(auth.handle((ctx) -> {
6060
synchronized (writeLock) {
6161
this.handleServiceLinkUpdate(ctx);

src/main/java/com/uid2/admin/vertx/service/SiteService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void setupRoutes(Router router) {
6969
synchronized (writeLock) {
7070
this.handleSiteAdd(ctx);
7171
}
72-
}, new AuditParams(List.of("name", "enable", "types", "description"), List.of("domain_names", "app_names")), Role.MAINTAINER, Role.SHARING_PORTAL));
72+
}, new AuditParams(List.of("name", "enable", "types", "description"), List.of("domain_names", "app_names")), Role.MAINTAINER, Role.SHARING_PORTAL, Role.CREATE));
7373
router.post(API_SITE_ENABLE.toString()).blockingHandler(auth.handle((ctx) -> {
7474
synchronized (writeLock) {
7575
this.handleSiteEnable(ctx);

0 commit comments

Comments
 (0)