Kimi K3.1 Pro · Heavy
add-caching-support-for-identityproviderstorageprovider-getforlogin-operations-keycloak
Keycloak · Java · M · 100–299 lines · 3 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
- 1 of 2
- Comments published
- 6
- Comments matching a bug
- 1
- Comments not matching
- 5
- Cost of this PR
- $2.111
Published comments (6)
Disabled organizations suppress required IDP login-cache invalidation — For a disabled organization, `registerIDPLoginInvalidationOnUpdate` tests organization-effective `original` state, so hiding an IDP or making it link-only or private can skip invalidation; re-enabling the organization then serves the stale IDP. Evaluate the raw stored IDP from `idpDelegate.getById`, not organization-effective `isEnabled`.
Login cache key conflates null and empty organization IDs — Because `searchKey` maps null and empty organization IDs to the same value, the first cached `ORG_ONLY` or `ALL` query can serve the other input, returning organization providers for a blank ID or dropping them for null. Encode null distinctly from an empty string.
Cold login-cache fill refetches every IDP through `getById` — With a cold IDP cache, each new mode/organization query adds N single-ID database lookups to the initial delegate query. Retain the models returned by `idpDelegate.getForLogin`, or bulk-load them, instead of refetching every ID through `getById`.
Login IDP cache test never exercises cache hits — The `query != null` branch in `getForLogin` can return wrong providers or throw while this test still passes, because every query is cold or follows invalidation and intermediate checks only inspect `IdentityProviderListQuery`. Repeat an identical mode/organization query without invalidation and assert its returned providers.
Login cache test does not exercise private organization-linked providers — Because every organization-linked provider sets `BROKER_PUBLIC=true`, removing the new organization/public clause in `getLoginPredicate()` leaves all expected counts unchanged. Add an enabled, organization-linked private provider and assert its exclusion from login results and the cache.
Cleanup registers a nonexistent alias and leaks the created providers — Cleanup targets the literal alias `alias`, so none of the generated providers is removed; the later registration repeats the mismatch for `idp-alias-20`, leaking providers into subsequent tests or failing cleanup. Register cleanup with each provider's actual alias.