From 48deda62b152020268c7fcbf9b870b3c06f43fbd Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 10 Dec 2012 16:37:30 +0000 Subject: [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 --- .../org/apache/archiva/security/ArchivaServletAuthenticator.java | 5 +++++ .../java/org/apache/archiva/security/DefaultUserRepositories.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'archiva-modules/archiva-web/archiva-security/src') 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; @@ -113,9 +114,13 @@ public class ArchivaServletAuthenticator throw new UnauthorizedException( e.getMessage(), e ); } 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() ) { -- cgit v1.2.3