DeepSeek V4.1 Flash · 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
4
Comments matching a bug
1
Comments not matching
3
Cost of this PR
$0.308

Published comments (4)

highbugserver-spi/src/main/java/org/keycloak/models/IdentityProviderStorageProvider.java:252-255

Organization clause in shared login predicate hides linked brokers — `IdentityProviderBean.federatedProviderPredicate()` also uses `getLoginPredicate()`, so users linked to an organization IDP without `BROKER_PUBLIC=true` lose that provider from the login page. Keep the stricter predicate local to the invalidation code or add an explicit method instead of altering the shared predicate.

mediumperformancemodel/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java:232-242

Login IDP cache invalidates shared entry for each new organization — Every login page then loads and copies the IDP ids of all organizations, and each new organization's first request triggers a full reload. Include `organizationId` in `cacheKeyForLogin` so entries are per-organization, or accept a per-search-key entry instead of invalidating the shared one.

mediumbugtestsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/cache/OrganizationCacheTest.java:417-440

Login cache test misses login-eligible IDP create/remove — Both IDPs fail `getLoginPredicate()`, so dropping the invalidation calls from `create()` and `remove()` would still pass, leaving the stale-login-list regression undetected. Add a step that creates and removes a login-eligible IDP and asserts the login caches become null for every `FetchMode`.

mediumbugtestsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/cache/OrganizationCacheTest.java:400-414

Discarded getForLogin results leave cached return path untested — The return half of the cached branch, resolving ids via `getById`, is never verified, so an empty or wrong returned set still passes. Collect the aliases returned by `getForLogin` and assert them against the expected set alongside the cache-entry count.

Gold bugs found (1)

highAdding the organization/BROKER_PUBLIC check to the shared LoginFilter.getLoginPredicate also changes IdentityProviderBean.federatedProviderPredicate, so with organizations disabled a user's linked IdP that has an organizationId but is not public is no longer shown on the login page.

Gold bugs missed (1)

lowThe test registers cleanup for the literal alias "alias" instead of the created IDP aliases, so the created identity providers are never cleaned up.