KEYCLOAK-11019 Initial support for lazy offline user-session loading#8033
KEYCLOAK-11019 Initial support for lazy offline user-session loading#8033hmlnarik merged 7 commits intokeycloak:masterfrom
Conversation
There was a problem hiding this comment.
Thank you for the PR. I went thru the original PR and there has been done huge amount of work. Thanks again.
Few notes:
- There was some issues in GHA
- model tests were cancelled after 329m. But I can see it passed in @martin-kanis's fork so I assume it is not related.
- cluster tests are failing
- I haven't found any documentation PR, is there a plan to send one?
- the changeSet should be updated, please see inline.
Otherwise it looks good to me.
There was a problem hiding this comment.
This changeSet should be moved to jpa-changelog-14.0.0.xml
There was a problem hiding this comment.
Thanks, moved.
That's correct, it is an independent intermittent issue, tracked as https://issues.redhat.com/browse/KEYCLOAK-18091 |
9214b5c to
1d6bb19
Compare
|
The failing cluster tests were caused by a syntax error in SQL query on MySQL. The |
1d6bb19 to
66a466e
Compare
…ase query if in-memory lookup fails for offline sessions Allow to configure pre-loading of offline user-sessions We now allow to configure whether offline user-sessions should be preloaded on startup from the database. We now trigger offline user-sessions loading when UserSessionProvider#getOfflineUserSessionsStream(realm,user) is called. This ensures that the user can revoke the offline_access consent via the account console. Additionally the (offline) user consents are now displayed correctly for a user in the admin-console. Offline user-sessions are now correctly display if offline user-sessions are loaded lazily. Add note about unsupported lazy offline session loading by broker info: Currently we don't support lazy offline user-session lookup by brokerSessionId and brokerUserId. See: keycloak#7722 (review) Keep behavior of 'logout all sessions' and don't delete dangling offline sessions. As discussed in keycloak#7722 (comment) Throw on unsupported dynamic offline user-session lookups from database
… user-session lookups
Removed redundant condition checking. We use the `coalesce` function to make the queries work for a specific realm / client or all, e.g.: ``` clientSess.clientId = coalesce(CAST(:clientId as text), clientSess.clientId) ``` Note that the explicit cast is required to treat null values as text to avoid confusing databases.
…ation changelog to 14
66a466e to
a65756a
Compare
vramik
left a comment
There was a problem hiding this comment.
Thanks @martin-kanis!
Th PR looks good to me. From my POV there is just documentation PR missing and we've discussed with @hmlnarik that after those changes in queries the index analysis (which was done with the original PR) should re-checked.
|
Indices checked, they look good. @vramik , is the docs the only remaining concern? |
hmlnarik
left a comment
There was a problem hiding this comment.
Pipelines ran successfully. Thank you for the contribution, @thomasdarimont and @martin-kanis !
|
We're seeing the issue this PR is meant to fix. Has this made it into a release, or are there some setting changes? |
This PR includes #7722 + rebase to current master + adds model tests