aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-security/src
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-12-10 16:37:30 +0000
committerOlivier Lamy <olamy@apache.org>2012-12-10 16:37:30 +0000
commit48deda62b152020268c7fcbf9b870b3c06f43fbd (patch)
treef4257c06e185180b7d490f9280234c806ca3e920 /archiva-modules/archiva-web/archiva-security/src
parent166d6359edd3dbf7b044e6a4ff9e873490f95ad8 (diff)
downloadarchiva-48deda62b152020268c7fcbf9b870b3c06f43fbd.tar.gz
archiva-48deda62b152020268c7fcbf9b870b3c06f43fbd.zip
[MRM-1721] Chaining user manager implementations.
take care of last changes in redback to be able to track exception when using userManagerImpl. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1419573 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-security/src')
-rw-r--r--archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java5
-rw-r--r--archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java7
2 files changed, 11 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java
index 74e4567bc..0cbc02fd2 100644
--- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java
+++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java
@@ -30,6 +30,7 @@ import org.apache.archiva.redback.system.DefaultSecuritySession;
import org.apache.archiva.redback.system.SecuritySession;
import org.apache.archiva.redback.system.SecuritySystem;
import org.apache.archiva.redback.users.User;
+import org.apache.archiva.redback.users.UserManagerException;
import org.apache.archiva.redback.users.UserNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -115,7 +116,11 @@ public class ArchivaServletAuthenticator
catch ( AuthorizationException e )
{
throw new UnauthorizedException( e.getMessage(), e );
+ } catch ( UserManagerException e )
+ {
+ throw new UnauthorizedException( e.getMessage(), e );
}
+
}
diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java
index 91ba7a3e0..58aad4b96 100644
--- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java
+++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java
@@ -30,6 +30,7 @@ import org.apache.archiva.redback.system.DefaultSecuritySession;
import org.apache.archiva.redback.system.SecuritySession;
import org.apache.archiva.redback.system.SecuritySystem;
import org.apache.archiva.redback.users.User;
+import org.apache.archiva.redback.users.UserManagerException;
import org.apache.archiva.redback.users.UserNotFoundException;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.slf4j.Logger;
@@ -43,7 +44,7 @@ import java.util.List;
/**
* DefaultUserRepositories
*/
-@Service ( "userRepositories" )
+@Service( "userRepositories" )
public class DefaultUserRepositories
implements UserRepositories
{
@@ -151,6 +152,10 @@ public class DefaultUserRepositories
{
throw new PrincipalNotFoundException( "Unable to find principal " + principal + "", e );
}
+ catch ( UserManagerException e )
+ {
+ throw new ArchivaSecurityException( e.getMessage(), e );
+ }
if ( user.isLocked() )
{