You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/12/06 10:04:40 UTC

[isis] branch master updated: ISIS-2464: AuthenticationManager: sync threads on map rather than on just authenticate method

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f0fb5c  ISIS-2464: AuthenticationManager: sync threads on map rather than on just authenticate method
6f0fb5c is described below

commit 6f0fb5cd79542fc0b2dd80382c7d3b14e8cbfffe
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Dec 6 11:04:31 2020 +0100

    ISIS-2464: AuthenticationManager: sync threads on map rather than on
    just authenticate method
---
 .../core/security/authentication/manager/AuthenticationManager.java   | 4 ++--
 .../standard/AuthenticationManager_authenticators_Test.java           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/security/src/main/java/org/apache/isis/core/security/authentication/manager/AuthenticationManager.java b/core/security/src/main/java/org/apache/isis/core/security/authentication/manager/AuthenticationManager.java
index 479bf6a..16b06c2 100644
--- a/core/security/src/main/java/org/apache/isis/core/security/authentication/manager/AuthenticationManager.java
+++ b/core/security/src/main/java/org/apache/isis/core/security/authentication/manager/AuthenticationManager.java
@@ -55,7 +55,7 @@ public class AuthenticationManager {
 
     @Getter private final Can<Authenticator> authenticators;
     
-    private final Map<String, String> userByValidationCode = _Maps.newHashMap();
+    private final Map<String, String> userByValidationCode = _Maps.newConcurrentHashMap();
     private final RandomCodeGenerator randomCodeGenerator;
     private final Can<Registrar> registrars;
 
@@ -75,7 +75,7 @@ public class AuthenticationManager {
 
     // -- SESSION MANAGEMENT (including authenticate)
 
-    public synchronized final Authentication authenticate(AuthenticationRequest request) {
+    public final Authentication authenticate(AuthenticationRequest request) {
         
         if (request == null) {
             return null;
diff --git a/core/security/src/test/java/org/apache/isis/security/authentication/standard/AuthenticationManager_authenticators_Test.java b/core/security/src/test/java/org/apache/isis/security/authentication/standard/AuthenticationManager_authenticators_Test.java
index 558eaeb..07ee2c1 100644
--- a/core/security/src/test/java/org/apache/isis/security/authentication/standard/AuthenticationManager_authenticators_Test.java
+++ b/core/security/src/test/java/org/apache/isis/security/authentication/standard/AuthenticationManager_authenticators_Test.java
@@ -57,7 +57,7 @@ public class AuthenticationManager_authenticators_Test {
                 Collections.singletonList(auth), 
                 new RandomCodeGeneratorDefault());
         assertThat(authenticationManager.getAuthenticators().size(), is(1));
-        assertThat(authenticationManager.getAuthenticators().get(0), is(sameInstance(auth)));
+        assertThat(authenticationManager.getAuthenticators().getElseFail(0), is(sameInstance(auth)));
     }
 
 }