Repository navigation
Conversation
16c387a to
21d8613
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The test can pass with the old early return because the client representation request prepopulates the username query, preventing it from exercising the intended managed-user cache-miss path.
1 open issue
What changed in this PR
Extends the username/email caching fix from #54646 to federated-identity and service-account lookups, addressing #55237 when users are already managed in the session.
Changes:
- Caches both lookup queries on eligible managed-user paths, preserving revision and lifespan handling.
- Adds realm checks and a service-account client-link check.
- Adds integration tests that inspect cache entries after sequential user lookups.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/model/UserCacheManagedUserQueryTest.java |
Adds managed-user query-caching tests for both lookup types. |
model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/UserCacheSession.java |
Stores eligible lookup queries before returning already-managed users. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The regression test setup prepopulates the username query cache, so the lookup takes the cache-hit path and passes without the production fix rather than exercising the intended managed-user cache-miss branch.
Review effort: Balanced
…users Closes keycloak#55237 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
21d8613 to
d1973ad
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.broker.KcSamlBrokerTest#loginClientWithDotsInNameKeycloak CI - FIPS IT (strict) |
Closes #55237