GPT-6.1 Sol · 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
$1.325

Published comments (4)

mediumbugmodel/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java:405-406

Organization-aware eligibility leaves stale login cache membership on update — When an organization is disabled, `getById` makes `original` fail `getLoginPredicate()`, so changing `hideOnLogin` or `linkOnly` can preserve stale cache membership that reappears when the organization is enabled. Reload `original` through `idpDelegate.getById` before comparing eligibility.

mediumbugmodel/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java:236-240

Login cache refresh can resurrect stale organization results — Concurrent invalidation can make `query` stale before this branch copies it into an entry with a newer revision, restoring outdated organization results. Preserve `query` only if its revision remains valid; otherwise, cache only the freshly loaded search.

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

Login cache test never asserts returned provider identities — Discarding every `getForLogin` result lets this test pass even if the method populates the cache but returns `Stream.empty()`. Collect and assert provider identities on the initial lookup, a repeated cache hit, and after invalidation.

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

Cleanup targets a literal alias and leaves identity provider fixtures behind — Deleting the literal `alias` leaves the `idp-alias-*` fixtures behind, risking duplicate-alias failures in other tests. Register cleanup with `idpRep.getAlias()` here and for the additional provider created later in this test.

Gold bugs found (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.

Gold bugs missed (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.