GLM-5.3 · 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
0 of 2
Comments published
4
Comments matching a bug
0
Comments not matching
4
Cost of this PR
$2.379

Published comments (4)

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

Login-cache invalidation on create/remove of login-available IDP is untested — A stale login IDP could keep being served from the cache until expiry without this test failing. Add steps that create and remove a login-available IDP and assert all three `cacheKeyForLogin` entries are invalidated.

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

testCacheIDPForLogin never asserts on getForLogin's returned stream — The cache-hit path of `getForLogin` skips the `createOrganizationAwareIdentityProviderModel` mapping, so a hit and a miss can return different models unnoticed here. Assert the count and aliases returned by a second, cache-hit call for each `FetchMode`.

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

Test never exercises the cached-query merge branch of getForLogin — Broken merge logic in `getForLogin` would still pass because the test queries only one search key per `FetchMode`, never triggering the cached-query merge. Query the same `FetchMode` under a second organization and assert both search keys are served correctly.

mediumsecurityserver-spi/src/main/java/org/keycloak/models/IdentityProviderStorageProvider.java:254

getLoginPredicate() may NPE when identity provider config is null — If an IDP has null config, `getLoginPredicate()` throws an NPE. Guard the `idp.getConfig()` access before reading `OrganizationModel.BROKER_PUBLIC`.

Gold bugs found (0)

None.

Gold bugs missed (2)

lowThe test registers cleanup for the literal alias "alias" instead of the created IDP aliases, so the created identity providers are never cleaned up.
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.