* under the License.
*/
-import javax.inject.Inject;
-import javax.servlet.http.HttpServletRequest;
-
import org.apache.archiva.redback.authentication.AuthenticationException;
import org.apache.archiva.redback.authentication.AuthenticationResult;
import org.apache.archiva.redback.authorization.AuthorizationException;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
/**
*
*/
-@Service("servletAuthenticator")
+@Service( "servletAuthenticator" )
public class ArchivaServletAuthenticator
implements ServletAuthenticator
{
{
if ( authzResult.getException() != null )
{
- log.info( "Authorization Denied [ip=" + request.getRemoteAddr() + ",permission=" + permission
- + ",repo=" + repositoryId + "] : " + authzResult.getException().getMessage() );
+ log.info( "Authorization Denied [ip=" + request.getRemoteAddr() + ",permission=" + permission + ",repo="
+ + repositoryId + "] : " + authzResult.getException().getMessage() );
throw new UnauthorizedException( "Access denied for repository " + repositoryId );
}
User user = securitySystem.getUserManager().findUser( principal );
if ( user == null )
{
- throw new UnauthorizedException( "The security system had an internal error - please check your system logs" );
+ throw new UnauthorizedException(
+ "The security system had an internal error - please check your system logs" );
}
if ( user.isLocked() )
{
}
catch ( UserNotFoundException e )
{
- throw new UnauthorizedException( e.getMessage() );
+ throw new UnauthorizedException( e.getMessage(), e );
}
catch ( AuthorizationException e )
{
- throw new UnauthorizedException( e.getMessage() );
+ throw new UnauthorizedException( e.getMessage(), e );
}
}
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.redback.users.User;
-import org.apache.archiva.redback.users.UserNotFoundException;
-import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.archiva.redback.authentication.AuthenticationResult;
import org.apache.archiva.redback.authorization.AuthorizationException;
import org.apache.archiva.redback.role.RoleManager;
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.UserNotFoundException;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
/**
* DefaultUserRepositories
- *
- *
*/
-@Service( "userRepositories" )
+@Service("userRepositories")
public class DefaultUserRepositories
implements UserRepositories
{
}
catch ( UserNotFoundException e )
{
- throw new PrincipalNotFoundException( "Unable to find principal " + principal + "" );
+ throw new PrincipalNotFoundException( "Unable to find principal " + principal + "", e );
}
if ( user.isLocked() )