MiniMax M3 · Heavy
add-client-resource-type-and-scopes-to-authorization-schema-keycloak
Keycloak · Java · L · 300–799 lines · 5 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.
- Gold bugs found
- 2 of 8
- Comments published
- 4
- Comments matching a bug
- 2
- Comments not matching
- 2
- Cost of this PR
- $0.464
Published comments (4)
getClientsWithPermission leaks the 'Clients' type-resource name into callers — Filter out entries where `resource.getName()` equals `AdminPermissionsSchema.CLIENTS_RESOURCE_TYPE`.
ClientPermissionsV2.setPermissionsEnabled throws on client removal under fine-grained authz — `ClientPermissionsV2.setPermissionsEnabled` throws `UnsupportedOperationException`, yet the `AdminPermissions` listener calls it on `ClientRemovedEvent` whenever `ADMIN_FINE_GRAINED_AUTHZ` is enabled, so client removal in V2 mode always fails. Implement V2 cleanup there, or gate the listener to fire only under V1 via an `instanceof ClientPermissions` check.
ADMIN_FINE_GRAINED_AUTHZ listener triggers V2 setPermissionsEnabled UnsupportedOperationException — `AdminPermissions`'s `ProviderEventListener` calls `setPermissionsEnabled(false)` on `ClientRemovedEvent` under `ADMIN_FINE_GRAINED_AUTHZ`, but the V2 impl `ClientPermissionsV2.setPermissionsEnabled` throws `UnsupportedOperationException`. Restrict the branch to the legacy/V1 path with an extra V2 feature check so it skips V2.
ADMIN_FINE_GRAINED_AUTHZ gate skipped V1 cleanup on role/client/group removal — Gating the three `AdminPermissions` cleanup listeners behind `ADMIN_FINE_GRAINED_AUTHZ` silently breaks the V1 cleanup contract, leaving orphan permissions whenever the feature is off (the default). Keep the V1 handlers registered unconditionally and gate only the V2-only additions.