Claude Sonnet 5.5 · 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
- 3 of 8
- Comments published
- 4
- Comments matching a bug
- 3
- Comments not matching
- 1
- Cost of this PR
- $3.295
Published comments (4)
Client removal handler throws when V2 fine-grained authz is enabled — With both feature flags on, `management()` returns `MgmtPermissionsV2`, and `ClientPermissionsV2.setPermissionsEnabled` always throws `UnsupportedOperationException`, so client deletion fails. Skip this V1 cleanup in the `ClientRemovedEvent` handler when V2 is enabled, or make `setPermissionsEnabled` a no-op.
NPE when Clients type resource is missing in hasPermission — `getResourceTypeResource` can return null, and passing it to `findByResource` causes an NPE and a 500 instead of a denial. Return false when the resource is null before calling `findByResource`.
getClientsWithPermission matches no per-client resources — Per-client resources from `AdminPermissionsSchema.getOrCreateResource` have no type, so `findByType` misses them and only finds the type-level "Clients" resource, which is not a client id. Callers like `AvailableRoleMappingResource` get wrong results; iterate clients and look up each resource by owner and name.
canExchangeTo throws UnsupportedOperationException in V2 instead of denying — `AbstractTokenExchangeProvider` still calls `canExchangeTo`, so under V2 token exchange fails with `UnsupportedOperationException` instead of a permission denial. Return false in `canExchangeTo`, or guard the caller.