DeepSeek V4.1 Flash · Balanced
add-caching-support-for-identityproviderstorageprovider-getforlogin-operations-keycloak
Keycloak · Java · M · 100–299 lines · 3 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 1 of 2
- Comments published
- 3
- Comments matching a bug
- 1
- Comments not matching
- 2
- Cost of this PR
- $0.144
Published comments (3)
Organization clause in shared login predicate hides org-linked IDPs — `getLoginPredicate()` also backs `IdentityProviderBean.federatedProviderPredicate()`, so this clause silently hides org-linked IDPs without `BROKER_PUBLIC=true` from the linked-federated-identity list when organizations are disabled. Move the organization clause into the cache layer's invalidation predicate, not the shared login predicate.
Login cache invalidation uses org-aware enabled state for original IDP — For an IDP bound to a disabled organization, `original.isEnabled()` is false even though the IDP sits in the login cache, so an update to `hideOnLogin` or `linkOnly` returns early and leaves stale entries. Test `getLoginPredicate()` on the stored model from `idpDelegate.getById(...)` instead of the wrapped `original`.
Login IDP cache key omits organizationId, causing unbounded entry growth — Keying the login cache by realm and `FetchMode` only lets each new `organizationId` grow the same `IdentityProviderListQuery` and evict the whole entry cluster-wide via `invalidateObject`, forcing DB reloads. Include `organizationId` in the key, as `cacheKeyOrgId` does for `getByOrganization`.