mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
RemoteUserSessionProvider remote query calls must not use negative values for offsets and maxResults
Closes #43769 Signed-off-by: Ryan Emerson <remerson@ibm.com>
This commit is contained in:
parent
e1250632aa
commit
606abcfbb4
@ -439,10 +439,10 @@ public class RemoteUserSessionProvider implements UserSessionProvider {
|
||||
|
||||
private Stream<UserSessionModel> streamUserSessionByClientId(RealmModel realm, String clientId, boolean offline, Integer offset, Integer maxResults) {
|
||||
var userSessionIdQuery = ClientSessionQueries.fetchUserSessionIdForClientId(getClientSessionTransaction(offline).getCache(), realm.getId(), clientId);
|
||||
if (offset != null) {
|
||||
if (offset != null && offset > -1) {
|
||||
userSessionIdQuery.startOffset(offset);
|
||||
}
|
||||
userSessionIdQuery.maxResults(maxResults == null ? Integer.MAX_VALUE : maxResults);
|
||||
userSessionIdQuery.maxResults(maxResults == null || maxResults == -1 ? Integer.MAX_VALUE : maxResults);
|
||||
var userSessionTx = getUserSessionTransaction(offline);
|
||||
return Flowable.fromIterable(QueryHelper.toCollection(userSessionIdQuery, QueryHelper.SINGLE_PROJECTION_TO_STRING))
|
||||
.flatMapMaybe(userSessionTx::maybeGet, false, MAX_CONCURRENT_REQUESTS)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user