Merge pull request #4163 from mposolda/master
KEYCLOAK-4939 ConcurrentLoginTest broken in latest master
This commit is contained in:
commit
ce9320755d
4 changed files with 6 additions and 15 deletions
|
@ -69,10 +69,6 @@ public class AuthenticatedClientSessionAdapter implements AuthenticatedClientSes
|
|||
}
|
||||
} else {
|
||||
this.userSession = (UserSessionAdapter) userSession;
|
||||
|
||||
if (sessionEntity.getAuthenticatedClientSessions() == null) {
|
||||
sessionEntity.setAuthenticatedClientSessions(new HashMap<>());
|
||||
}
|
||||
sessionEntity.getAuthenticatedClientSessions().put(clientUUID, entity);
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ import java.util.Iterator;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -518,7 +519,8 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
|
|||
entity.setBrokerUserId(userSession.getBrokerUserId());
|
||||
entity.setIpAddress(userSession.getIpAddress());
|
||||
entity.setLoginUsername(userSession.getLoginUsername());
|
||||
entity.setNotes(userSession.getNotes());
|
||||
entity.setNotes(userSession.getNotes()== null ? new ConcurrentHashMap<>() : userSession.getNotes());
|
||||
entity.setAuthenticatedClientSessions(new ConcurrentHashMap<>());
|
||||
entity.setRememberMe(userSession.isRememberMe());
|
||||
entity.setState(userSession.getState());
|
||||
entity.setUser(userSession.getUser().getId());
|
||||
|
@ -555,10 +557,6 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
|
|||
entity.setTimestamp(clientSession.getTimestamp());
|
||||
|
||||
Map<String, AuthenticatedClientSessionEntity> clientSessions = importedUserSession.getEntity().getAuthenticatedClientSessions();
|
||||
if (clientSessions == null) {
|
||||
clientSessions = new HashMap<>();
|
||||
importedUserSession.getEntity().setAuthenticatedClientSessions(clientSessions);
|
||||
}
|
||||
|
||||
clientSessions.put(clientSession.getClient().getId(), entity);
|
||||
|
||||
|
|
|
@ -159,9 +159,6 @@ public class UserSessionAdapter implements UserSessionModel {
|
|||
|
||||
@Override
|
||||
public void setNote(String name, String value) {
|
||||
if (entity.getNotes() == null) {
|
||||
entity.setNotes(new ConcurrentHashMap<>());
|
||||
}
|
||||
if (value == null) {
|
||||
if (entity.getNotes().containsKey(name)) {
|
||||
removeNote(name);
|
||||
|
@ -201,8 +198,8 @@ public class UserSessionAdapter implements UserSessionModel {
|
|||
provider.updateSessionEntity(entity, realm, user, loginUsername, ipAddress, authMethod, rememberMe, brokerSessionId, brokerUserId);
|
||||
|
||||
entity.setState(null);
|
||||
entity.setNotes(null);
|
||||
entity.setAuthenticatedClientSessions(null);
|
||||
entity.getNotes().clear();
|
||||
entity.getAuthenticatedClientSessions().clear();
|
||||
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class UserSessionEntity extends SessionEntity {
|
|||
|
||||
private Map<String, String> notes = new ConcurrentHashMap<>();
|
||||
|
||||
private Map<String, AuthenticatedClientSessionEntity> authenticatedClientSessions;
|
||||
private Map<String, AuthenticatedClientSessionEntity> authenticatedClientSessions = new ConcurrentHashMap<>();
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
|
|
Loading…
Reference in a new issue