Kimi K3.1 Pro · 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
- 4
- Comments matching a bug
- 1
- Comments not matching
- 3
- Cost of this PR
- $1.272
Published comments (4)
Organization-disabled brokers can skip login-cache invalidation — A disabled organization makes `original.isEnabled()` false even when the persisted broker is enabled, so `getLoginPredicate()` can skip invalidation and serve stale login results after re-enablement. Evaluate the predicate against the raw persisted broker from `idpDelegate.getById()`, or invalidate whenever a login-relevant field changes.
Case-insensitive broker-public check skips login cache invalidation — A case-only `BROKER_PUBLIC` change leaves both `getLoginPredicate()` results true, skipping invalidation even though the JPA delegate's query accepts only lowercase `true`, so login-cache membership becomes stale. Align the predicate with that exact comparison, or compare raw config values before deciding whether to invalidate.
Cleanup targets a nonexistent alias and leaks test identity providers — Cleanup registered for the literal `alias` leaves every `idp-alias-*` broker behind, allowing these providers to contaminate later tests. Register cleanup for each actual alias, preferably with `getCleanup().addIdentityProviderAlias(...)`.
Login cache fills refetch every IDP and cause 1+N queries — A cold fill discards the models returned by `idpDelegate.getForLogin()` and then calls `getById()` for each cached ID, turning one login query into 1+N queries when per-IDP entries are cold. Cache their IDs, but return the loaded models through `createOrganizationAwareIdentityProviderModel()` instead of refetching them.