]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r module redback-authentication-api
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 19:55:10 +0000 (19:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 19:55:10 +0000 (19:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310844 13f79535-47bb-0310-9956-ffa450edef68

53 files changed:
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationConstants.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationDataSource.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationException.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationManager.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationResult.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/Authenticator.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/DefaultAuthenticationManager.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/NotAuthenticatedException.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/PasswordBasedAuthenticationDataSource.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/TokenBasedAuthenticationDataSource.java [new file with mode: 0644]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationConstants.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationDataSource.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationException.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationManager.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationResult.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/Authenticator.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/DefaultAuthenticationManager.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/NotAuthenticatedException.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/PasswordBasedAuthenticationDataSource.java [deleted file]
redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/TokenBasedAuthenticationDataSource.java [deleted file]
redback-authentication/redback-authentication-api/src/main/resources/META-INF/spring-context.xml
redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/codehaus/plexus/redback/authentication/ldap/LdapBindAuthenticator.java
redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/test/java/org/codehaus/plexus/redback/authentication/ldap/LdapBindAuthenticatorTest.java
redback-authentication/redback-authentication-providers/redback-authentication-memory/src/main/java/org/codehaus/plexus/redback/authentication/memory/MemoryAuthenticator.java
redback-authentication/redback-authentication-providers/redback-authentication-memory/src/test/java/org/codehaus/plexus/redback/authentication/memory/MemoryAuthenticatorTest.java
redback-authentication/redback-authentication-providers/redback-authentication-open/src/main/java/org/codehaus/plexus/redback/authentication/open/OpenAuthenticator.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/AdminAutoCreateCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/HttpAuthenticationException.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/HttpAuthenticator.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/basic/HttpBasicAuthentication.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/basic/HttpBasicAuthenticationFilter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/digest/HttpDigestAuthentication.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/digest/HttpDigestAuthenticationFilter.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultLoginService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultUserService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/AuthenticationInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/PermissionsInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/LoginAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/AddAdminUserAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/AutoLoginInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/ForceAdminUserInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/LoginActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AbstractUserCredentialsActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/UserEditActionTest.java
redback-keys/redback-authentication-keys/src/main/java/org/codehaus/plexus/redback/authentication/keystore/KeyStoreAuthenticator.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySession.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySession.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java
redback-system/src/test/java/org/codehaus/plexus/redback/system/TestAuthenticationManager.java
redback-users/redback-authentication-users/src/main/java/org/apache/archiva/redback/authentication/users/UserManagerAuthenticator.java
redback-users/redback-authentication-users/src/test/java/org/apache/archiva/redback/authentication/users/UserManagerAuthenticatorTest.java

diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationConstants.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationConstants.java
new file mode 100644 (file)
index 0000000..7379937
--- /dev/null
@@ -0,0 +1,32 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Contants class used for authentication
+ * @version $Id$
+ */
+public class AuthenticationConstants
+{
+
+    // for User Manager Authenticator
+    public static final String AUTHN_NO_SUCH_USER = "1";
+
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationDataSource.java
new file mode 100644 (file)
index 0000000..f745db9
--- /dev/null
@@ -0,0 +1,38 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Just a tag to indicate that the implementing class is an AuthenticationDataSource.
+ * <p/>
+ * todo which this back to an interface and use the mojo style expression evaluation to populate the particular required fields
+ *
+ * @version $Id$
+ * @see PasswordBasedAuthenticationDataSource
+ * @see TokenBasedAuthenticationDataSource
+ */
+public interface AuthenticationDataSource
+{
+    public String ROLE = AuthenticationDataSource.class.getName();
+
+    String getPrincipal();
+
+    boolean isEnforcePasswordChange();
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationException.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationException.java
new file mode 100644 (file)
index 0000000..a168e2d
--- /dev/null
@@ -0,0 +1,56 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * AuthenticationException.java
+ *
+ * @author Jesse McConnell
+ * @version $Id$
+ */
+public class AuthenticationException
+    extends Exception
+{
+    /**
+     * Constructor AuthenticationException.
+     */
+    public AuthenticationException()
+    {
+    }
+
+    /**
+     * Constructor AuthenticationException.
+     *
+     * @param message
+     */
+    public AuthenticationException( String message )
+    {
+        super( message );
+    }
+
+    public AuthenticationException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public AuthenticationException( Throwable cause )
+    {
+        super( cause );
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationManager.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationManager.java
new file mode 100644 (file)
index 0000000..84280c9
--- /dev/null
@@ -0,0 +1,41 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.codehaus.plexus.redback.policy.AccountLockedException;
+import org.codehaus.plexus.redback.policy.MustChangePasswordException;
+
+import java.util.List;
+
+/**
+ * AuthenticationManager:
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $Id$
+ */
+public interface AuthenticationManager
+{
+    String getId();
+
+    List<Authenticator> getAuthenticators();
+
+    AuthenticationResult authenticate( AuthenticationDataSource source )
+        throws AccountLockedException, AuthenticationException, MustChangePasswordException;
+}
\ No newline at end of file
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationResult.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/AuthenticationResult.java
new file mode 100644 (file)
index 0000000..8e42842
--- /dev/null
@@ -0,0 +1,107 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * AuthenticationResult: wrapper object for information that comes back from the authentication system
+ *
+ * @author Jesse McConnell <jesse@codehaus.org>
+ * @version $Id$
+ */
+public class AuthenticationResult
+    implements Serializable
+{
+    private boolean isAuthenticated;
+
+    /**
+     * FIXME olamy this Object is a pain !!!
+     */
+    private Object principal;
+
+    // TODO: why aren't these just thrown from the authenticate() method?
+    private Exception exception;
+
+    private Map<String,String> exceptionsMap;
+
+    public AuthenticationResult()
+    {
+        this.isAuthenticated = false;
+        this.principal = null;
+        this.exception = null;
+    }
+
+    public AuthenticationResult( boolean authenticated, Object principal, Exception exception )
+    {
+        isAuthenticated = authenticated;
+        this.principal = principal;
+        this.exception = exception;
+    }
+
+    public AuthenticationResult( boolean authenticated, Object principal, Exception exception, Map<String,String> exceptionsMap )
+    {
+        isAuthenticated = authenticated;
+        this.principal = principal;
+        this.exception = exception;
+        this.exceptionsMap = exceptionsMap;
+    }
+
+    public boolean isAuthenticated()
+    {
+        return isAuthenticated;
+    }
+
+    public Object getPrincipal()
+    {
+        return principal;
+    }
+
+    public Exception getException()
+    {
+        return exception;
+    }
+
+    public Map<String,String> getExceptionsMap()
+    {
+        return exceptionsMap;
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append( "AuthenticationResult[" );
+        sb.append( "principal=" ).append( principal );
+        sb.append( ",isAuthenticated=" ).append( Boolean.toString( isAuthenticated ) );
+        sb.append( ",exception=" );
+        if ( exception != null )
+        {
+            sb.append( exception.getClass().getName() );
+            sb.append( " : " ).append( exception.getMessage() );
+        }
+        else
+        {
+            sb.append( "<null>" );
+        }
+        sb.append( ']' );
+        return sb.toString();
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/Authenticator.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/Authenticator.java
new file mode 100644 (file)
index 0000000..9f434ee
--- /dev/null
@@ -0,0 +1,42 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.codehaus.plexus.redback.policy.AccountLockedException;
+import org.codehaus.plexus.redback.policy.MustChangePasswordException;
+
+/**
+ * Authenticator:
+ *
+ * @author Jesse McConnell
+ * @version $Id$
+ */
+public interface Authenticator
+{
+    String getId();
+
+    boolean supportsDataSource( AuthenticationDataSource source );
+
+    AuthenticationResult authenticate( AuthenticationDataSource source )
+        throws AccountLockedException, AuthenticationException, MustChangePasswordException;
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/DefaultAuthenticationManager.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/DefaultAuthenticationManager.java
new file mode 100644 (file)
index 0000000..5d019d5
--- /dev/null
@@ -0,0 +1,126 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationManager;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.codehaus.plexus.redback.policy.AccountLockedException;
+import org.codehaus.plexus.redback.policy.MustChangePasswordException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * DefaultAuthenticationManager: the goal of the authentication manager is to act as a conduit for
+ * authentication requests into different authentication schemes
+ * <p/>
+ * For example, the default implementation can be configured with any number of authenticators and will
+ * sequentially try them for an authenticated result.  This allows you to have the standard user/pass
+ * auth procedure followed by authentication based on a known key for 'remember me' type functionality.
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $Id$
+ */
+@Service("authenticationManager")
+public class DefaultAuthenticationManager
+    implements AuthenticationManager
+{
+    
+    private List<Authenticator> authenticators;
+
+    @Inject
+    private ApplicationContext applicationContext;
+    
+    @SuppressWarnings("unchecked")
+    @PostConstruct
+    public void initialize()
+    {
+        this.authenticators = new ArrayList<Authenticator>
+       ( applicationContext.getBeansOfType( Authenticator.class ).values() );
+    }
+    
+    
+    public String getId()
+    {
+        return "Default Authentication Manager - " + this.getClass().getName() + " : managed authenticators - " +
+            knownAuthenticators();
+    }
+
+    public AuthenticationResult authenticate( AuthenticationDataSource source )
+        throws AccountLockedException, AuthenticationException, MustChangePasswordException
+    {
+        if ( authenticators == null || authenticators.size() == 0 )
+        {
+            return ( new AuthenticationResult( false, null, new AuthenticationException(
+                "no valid authenticators, can't authenticate" ) ) );
+        }
+
+        // put AuthenticationResult exceptions in a map
+        Map<String,String> authnResultExceptionsMap = new HashMap<String,String>();
+        for ( Authenticator authenticator : authenticators )
+        {
+            if ( authenticator.supportsDataSource( source ) )
+            {
+                AuthenticationResult authResult = authenticator.authenticate( source );
+                Map<String,String> exceptionsMap = authResult.getExceptionsMap();
+
+                if ( authResult.isAuthenticated() )
+                {
+                    return authResult;
+                }
+
+                if ( exceptionsMap != null )
+                {
+                    authnResultExceptionsMap.putAll( exceptionsMap );
+                }
+            }
+        }
+
+        return ( new AuthenticationResult( false, null, new AuthenticationException(
+            "authentication failed on authenticators: " + knownAuthenticators() ), authnResultExceptionsMap ) );
+    }
+
+    public List<Authenticator> getAuthenticators()
+    {
+        return authenticators;
+    }
+
+    private String knownAuthenticators()
+    {
+        StringBuffer strbuf = new StringBuffer();
+
+        for ( Authenticator authenticator : authenticators )
+        {
+            strbuf.append( '(' ).append( authenticator.getId() ).append( ") " );
+        }
+
+        return strbuf.toString();
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/NotAuthenticatedException.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/NotAuthenticatedException.java
new file mode 100644 (file)
index 0000000..ae637e4
--- /dev/null
@@ -0,0 +1,58 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * EntityAuthenticationException.java
+ *
+ * @author Dan Diephouse
+ * @since $Id$
+ */
+public class NotAuthenticatedException
+    extends Exception
+{
+    /**
+     * Constructor EntityAuthenticationException.
+     */
+    public NotAuthenticatedException()
+    {
+    }
+
+    /**
+     * Constructor EntityAuthenticationException.
+     *
+     * @param message
+     */
+    public NotAuthenticatedException( String message )
+    {
+        super( message );
+    }
+
+    /**
+     * Constructor EntityAuthenticationException.
+     *
+     * @param message
+     * @param cause
+     */
+    public NotAuthenticatedException( String message, Exception cause )
+    {
+        super( message, cause );
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/PasswordBasedAuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/PasswordBasedAuthenticationDataSource.java
new file mode 100644 (file)
index 0000000..c42b740
--- /dev/null
@@ -0,0 +1,93 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+/**
+ * PasswordBasedAuthenticationDataSource: the username is considered the principal with this data source
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ */
+@Service("authenticationDataSource#password")
+@Scope("prototype")
+public class PasswordBasedAuthenticationDataSource
+    implements AuthenticationDataSource
+{
+    private String password;
+
+    private String principal;
+
+    public PasswordBasedAuthenticationDataSource()
+    {
+
+    }
+
+    public PasswordBasedAuthenticationDataSource( String principal, String password )
+    {
+        this.principal = principal;
+        this.password = password;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public String getPrincipal()
+    {
+        return principal;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    public void setPrincipal( String principal )
+    {
+        this.principal = principal;
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append( "PasswordBasedAuthenticationDataSource[" );
+        sb.append( "principal=" ).append( principal );
+        sb.append( ",password=" );
+        if ( StringUtils.isNotEmpty( password ) )
+        {
+            // Intentionally not showing real password 
+            sb.append( "***" );
+        }
+        sb.append( ']' );
+        return sb.toString();
+    }
+
+    public boolean isEnforcePasswordChange()
+    {
+        return true;
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/TokenBasedAuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/apache/archiva/redback/authentication/TokenBasedAuthenticationDataSource.java
new file mode 100644 (file)
index 0000000..3f25a26
--- /dev/null
@@ -0,0 +1,92 @@
+package org.apache.archiva.redback.authentication;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * TokenBasedAuthenticationDataSource
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+@Service( "authenticationDataSource#token" )
+@Scope( "prototype" )
+public class TokenBasedAuthenticationDataSource
+    implements AuthenticationDataSource
+{
+    private String token;
+
+    private String principal;
+
+    private boolean enforcePasswordChange = true;
+
+    public TokenBasedAuthenticationDataSource( String principal )
+    {
+        this.principal = principal;
+    }
+
+    public TokenBasedAuthenticationDataSource()
+    {
+    }
+
+    public String getPrincipal()
+    {
+        return principal;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+
+    public void setPrincipal( String principal )
+    {
+        this.principal = principal;
+    }
+
+    public void setToken( String token )
+    {
+        this.token = token;
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append( "TokenBasedAuthenticationDataSource[" );
+        sb.append( "principal=" ).append( principal );
+        sb.append( ",token=" ).append( token );
+        sb.append( ']' );
+        return sb.toString();
+    }
+
+    public void setEnforcePasswordChange( boolean enforcePasswordChange )
+    {
+        this.enforcePasswordChange = enforcePasswordChange;
+    }
+
+    public boolean isEnforcePasswordChange()
+    {
+        return enforcePasswordChange;
+    }
+}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationConstants.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationConstants.java
deleted file mode 100644 (file)
index 9397fca..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Contants class used for authentication
- * @version $Id$
- */
-public class AuthenticationConstants
-{
-
-    // for User Manager Authenticator
-    public static final String AUTHN_NO_SUCH_USER = "1";
-
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationDataSource.java
deleted file mode 100644 (file)
index 8eea2a8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Just a tag to indicate that the implementing class is an AuthenticationDataSource.
- * <p/>
- * todo which this back to an interface and use the mojo style expression evaluation to populate the particular required fields
- *
- * @version $Id$
- * @see PasswordBasedAuthenticationDataSource
- * @see TokenBasedAuthenticationDataSource
- */
-public interface AuthenticationDataSource
-{
-    public String ROLE = AuthenticationDataSource.class.getName();
-
-    String getPrincipal();
-
-    boolean isEnforcePasswordChange();
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationException.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationException.java
deleted file mode 100644 (file)
index 9c323c2..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * AuthenticationException.java
- *
- * @author Jesse McConnell
- * @version $Id$
- */
-public class AuthenticationException
-    extends Exception
-{
-    /**
-     * Constructor AuthenticationException.
-     */
-    public AuthenticationException()
-    {
-    }
-
-    /**
-     * Constructor AuthenticationException.
-     *
-     * @param message
-     */
-    public AuthenticationException( String message )
-    {
-        super( message );
-    }
-
-    public AuthenticationException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public AuthenticationException( Throwable cause )
-    {
-        super( cause );
-    }
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationManager.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationManager.java
deleted file mode 100644 (file)
index 23bfdbb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.codehaus.plexus.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.policy.MustChangePasswordException;
-
-import java.util.List;
-
-/**
- * AuthenticationManager:
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $Id$
- */
-public interface AuthenticationManager
-{
-    String getId();
-
-    List<Authenticator> getAuthenticators();
-
-    AuthenticationResult authenticate( AuthenticationDataSource source )
-        throws AccountLockedException, AuthenticationException, MustChangePasswordException;
-}
\ No newline at end of file
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationResult.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/AuthenticationResult.java
deleted file mode 100644 (file)
index 8eeb3b2..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
- * AuthenticationResult: wrapper object for information that comes back from the authentication system
- *
- * @author Jesse McConnell <jesse@codehaus.org>
- * @version $Id$
- */
-public class AuthenticationResult
-    implements Serializable
-{
-    private boolean isAuthenticated;
-
-    /**
-     * FIXME olamy this Object is a pain !!!
-     */
-    private Object principal;
-
-    // TODO: why aren't these just thrown from the authenticate() method?
-    private Exception exception;
-
-    private Map<String,String> exceptionsMap;
-
-    public AuthenticationResult()
-    {
-        this.isAuthenticated = false;
-        this.principal = null;
-        this.exception = null;
-    }
-
-    public AuthenticationResult( boolean authenticated, Object principal, Exception exception )
-    {
-        isAuthenticated = authenticated;
-        this.principal = principal;
-        this.exception = exception;
-    }
-
-    public AuthenticationResult( boolean authenticated, Object principal, Exception exception, Map<String,String> exceptionsMap )
-    {
-        isAuthenticated = authenticated;
-        this.principal = principal;
-        this.exception = exception;
-        this.exceptionsMap = exceptionsMap;
-    }
-
-    public boolean isAuthenticated()
-    {
-        return isAuthenticated;
-    }
-
-    public Object getPrincipal()
-    {
-        return principal;
-    }
-
-    public Exception getException()
-    {
-        return exception;
-    }
-
-    public Map<String,String> getExceptionsMap()
-    {
-        return exceptionsMap;
-    }
-
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-        sb.append( "AuthenticationResult[" );
-        sb.append( "principal=" ).append( principal );
-        sb.append( ",isAuthenticated=" ).append( Boolean.toString( isAuthenticated ) );
-        sb.append( ",exception=" );
-        if ( exception != null )
-        {
-            sb.append( exception.getClass().getName() );
-            sb.append( " : " ).append( exception.getMessage() );
-        }
-        else
-        {
-            sb.append( "<null>" );
-        }
-        sb.append( ']' );
-        return sb.toString();
-    }
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/Authenticator.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/Authenticator.java
deleted file mode 100644 (file)
index d344539..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.codehaus.plexus.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.policy.MustChangePasswordException;
-
-/**
- * Authenticator:
- *
- * @author Jesse McConnell
- * @version $Id$
- */
-public interface Authenticator
-{
-    String getId();
-
-    boolean supportsDataSource( AuthenticationDataSource source );
-
-    AuthenticationResult authenticate( AuthenticationDataSource source )
-        throws AccountLockedException, AuthenticationException, MustChangePasswordException;
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/DefaultAuthenticationManager.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/DefaultAuthenticationManager.java
deleted file mode 100644 (file)
index 93fcc48..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.codehaus.plexus.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.policy.MustChangePasswordException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * DefaultAuthenticationManager: the goal of the authentication manager is to act as a conduit for
- * authentication requests into different authentication schemes
- * <p/>
- * For example, the default implementation can be configured with any number of authenticators and will
- * sequentially try them for an authenticated result.  This allows you to have the standard user/pass
- * auth procedure followed by authentication based on a known key for 'remember me' type functionality.
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $Id$
- */
-@Service("authenticationManager")
-public class DefaultAuthenticationManager
-    implements AuthenticationManager
-{
-    
-    private List<Authenticator> authenticators;
-
-    @Inject
-    private ApplicationContext applicationContext;
-    
-    @SuppressWarnings("unchecked")
-    @PostConstruct
-    public void initialize()
-    {
-        this.authenticators = new ArrayList<Authenticator>
-       ( applicationContext.getBeansOfType( Authenticator.class ).values() );
-    }
-    
-    
-    public String getId()
-    {
-        return "Default Authentication Manager - " + this.getClass().getName() + " : managed authenticators - " +
-            knownAuthenticators();
-    }
-
-    public AuthenticationResult authenticate( AuthenticationDataSource source )
-        throws AccountLockedException, AuthenticationException, MustChangePasswordException
-    {
-        if ( authenticators == null || authenticators.size() == 0 )
-        {
-            return ( new AuthenticationResult( false, null, new AuthenticationException(
-                "no valid authenticators, can't authenticate" ) ) );
-        }
-
-        // put AuthenticationResult exceptions in a map
-        Map<String,String> authnResultExceptionsMap = new HashMap<String,String>();
-        for ( Authenticator authenticator : authenticators )
-        {
-            if ( authenticator.supportsDataSource( source ) )
-            {
-                AuthenticationResult authResult = authenticator.authenticate( source );
-                Map<String,String> exceptionsMap = authResult.getExceptionsMap();
-
-                if ( authResult.isAuthenticated() )
-                {
-                    return authResult;
-                }
-
-                if ( exceptionsMap != null )
-                {
-                    authnResultExceptionsMap.putAll( exceptionsMap );
-                }
-            }
-        }
-
-        return ( new AuthenticationResult( false, null, new AuthenticationException(
-            "authentication failed on authenticators: " + knownAuthenticators() ), authnResultExceptionsMap ) );
-    }
-
-    public List<Authenticator> getAuthenticators()
-    {
-        return authenticators;
-    }
-
-    private String knownAuthenticators()
-    {
-        StringBuffer strbuf = new StringBuffer();
-
-        for ( Authenticator authenticator : authenticators )
-        {
-            strbuf.append( '(' ).append( authenticator.getId() ).append( ") " );
-        }
-
-        return strbuf.toString();
-    }
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/NotAuthenticatedException.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/NotAuthenticatedException.java
deleted file mode 100644 (file)
index a74552e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * EntityAuthenticationException.java
- *
- * @author Dan Diephouse
- * @since $Id$
- */
-public class NotAuthenticatedException
-    extends Exception
-{
-    /**
-     * Constructor EntityAuthenticationException.
-     */
-    public NotAuthenticatedException()
-    {
-    }
-
-    /**
-     * Constructor EntityAuthenticationException.
-     *
-     * @param message
-     */
-    public NotAuthenticatedException( String message )
-    {
-        super( message );
-    }
-
-    /**
-     * Constructor EntityAuthenticationException.
-     *
-     * @param message
-     * @param cause
-     */
-    public NotAuthenticatedException( String message, Exception cause )
-    {
-        super( message, cause );
-    }
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/PasswordBasedAuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/PasswordBasedAuthenticationDataSource.java
deleted file mode 100644 (file)
index 75263ae..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.commons.lang.StringUtils;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-
-/**
- * PasswordBasedAuthenticationDataSource: the username is considered the principal with this data source
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * 
- */
-@Service("authenticationDataSource#password")
-@Scope("prototype")
-public class PasswordBasedAuthenticationDataSource
-    implements AuthenticationDataSource
-{
-    private String password;
-
-    private String principal;
-
-    public PasswordBasedAuthenticationDataSource()
-    {
-
-    }
-
-    public PasswordBasedAuthenticationDataSource( String principal, String password )
-    {
-        this.principal = principal;
-        this.password = password;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public String getPrincipal()
-    {
-        return principal;
-    }
-
-    public void setPassword( String password )
-    {
-        this.password = password;
-    }
-
-    public void setPrincipal( String principal )
-    {
-        this.principal = principal;
-    }
-
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-        sb.append( "PasswordBasedAuthenticationDataSource[" );
-        sb.append( "principal=" ).append( principal );
-        sb.append( ",password=" );
-        if ( StringUtils.isNotEmpty( password ) )
-        {
-            // Intentionally not showing real password 
-            sb.append( "***" );
-        }
-        sb.append( ']' );
-        return sb.toString();
-    }
-
-    public boolean isEnforcePasswordChange()
-    {
-        return true;
-    }
-}
diff --git a/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/TokenBasedAuthenticationDataSource.java b/redback-authentication/redback-authentication-api/src/main/java/org/codehaus/plexus/redback/authentication/TokenBasedAuthenticationDataSource.java
deleted file mode 100644 (file)
index 7a69a5b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.codehaus.plexus.redback.authentication;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-
-
-/**
- * TokenBasedAuthenticationDataSource
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-@Service( "authenticationDataSource#token" )
-@Scope( "prototype" )
-public class TokenBasedAuthenticationDataSource
-    implements AuthenticationDataSource
-{
-    private String token;
-
-    private String principal;
-
-    private boolean enforcePasswordChange = true;
-
-    public TokenBasedAuthenticationDataSource( String principal )
-    {
-        this.principal = principal;
-    }
-
-    public TokenBasedAuthenticationDataSource()
-    {
-    }
-
-    public String getPrincipal()
-    {
-        return principal;
-    }
-
-    public String getToken()
-    {
-        return token;
-    }
-
-    public void setPrincipal( String principal )
-    {
-        this.principal = principal;
-    }
-
-    public void setToken( String token )
-    {
-        this.token = token;
-    }
-
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-        sb.append( "TokenBasedAuthenticationDataSource[" );
-        sb.append( "principal=" ).append( principal );
-        sb.append( ",token=" ).append( token );
-        sb.append( ']' );
-        return sb.toString();
-    }
-
-    public void setEnforcePasswordChange( boolean enforcePasswordChange )
-    {
-        this.enforcePasswordChange = enforcePasswordChange;
-    }
-
-    public boolean isEnforcePasswordChange()
-    {
-        return enforcePasswordChange;
-    }
-}
index b0a4eba9a8f2fe95c0ab673af7d8569f9d5020c0..f2e50d7737fe618d6bd38365bb63571ac60e75e7 100644 (file)
@@ -29,6 +29,6 @@
 
   <context:annotation-config />
   <context:component-scan 
-    base-package="org.codehaus.plexus.redback.authentication"/>
+    base-package="org.apache.archiva.redback.authentication"/>
  
 </beans>
\ No newline at end of file
index b932153e6354a7b278b0d55ce35ff9f67b3ea70c..d2aad35a85f986bc268a94a474bc55d3a5e8a8cc 100644 (file)
@@ -20,11 +20,11 @@ package org.codehaus.plexus.redback.authentication.ldap;
  */
 
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.common.ldap.UserMapper;
 import org.codehaus.plexus.redback.common.ldap.connection.LdapConnection;
 import org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory;
index 6fae15e2dde4e70ee91d1e83102fc6ea5ca67f50..8d970919a6785b8d274f077f58d4a784d3c1de8f 100644 (file)
@@ -20,8 +20,8 @@ package org.codehaus.plexus.redback.authentication.ldap;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.PasswordEncoder;
 import org.codehaus.plexus.redback.policy.encoders.SHA1PasswordEncoder;
 import org.apache.archiva.redback.users.ldap.service.LdapCacheService;
index 062875ff7756dec7f2f32ef61d3ea5752a64d984..1a6853a0b31f8fc3819d868e80fe5dcc6293965a 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.authentication.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.springframework.stereotype.Service;
 
 /**
index ba6df9af110b02c9dd5abfba69af6d759c746b83..311aa644d0dfe53b4847ede7aefad68c590b463c 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.plexus.redback.authentication.memory;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
index fd380baf1ce2456febe93a50d1b917b8053804bf..1e39ed1263617e1b40ae488243f3572a18d419a3 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.authentication.open;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.springframework.stereotype.Service;
 
index a356e0ffcb00adde70643368896b4e7f25dbbd4c..a7548c3fcd7e100509c66d62a1c1fa48d71e4377 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.checks.security;
 
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.configuration.UserConfiguration;
 import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.rbac.RbacManagerException;
index c05ad85963abb447920c583128916526b5d0e6b9..61b2e3f8b7ab5f38f7a722be2f241160c8de9518 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.filter.authentication;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 
 /**
  * HttpAuthenticationException
index c46c27017c64207ce6ea7b278c155cc5fb876795..cbf7402024f621ef0656206d9803786b6e6df4ab 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.redback.integration.filter.authentication;
  * under the License.
  */
 
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 3776c6e1e690a2b658f264b47f123e4868714307..fbfe08c382540815c61e0fdfcbb9df2d1e2dd33f 100644 (file)
@@ -25,10 +25,10 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.commons.codec.binary.Base64;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 6aade049274163152b1d88ddb2f3b4a5b7938028..459e399df3abea486431b1e6f75d9e5d58824869 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.filter.authentication.basic;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.codehaus.redback.integration.filter.authentication.AbstractHttpAuthenticationFilter;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 
index 887aca7db4812d58ef3cb4349c9426500aac3c01..318cdc3ad6f872f2e11ce0e1a88072949a853546 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.redback.integration.filter.authentication.digest;
  * under the License.
  */
 
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.User;
 import org.apache.commons.codec.binary.Base64;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.TokenBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.apache.archiva.redback.users.UserManager;
index c957bfd3f347af538666ee35cb2f4edf2db82602..02ccad01caf293fa4980519fa729fe0fad447141 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.filter.authentication.digest;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.codehaus.redback.integration.filter.authentication.AbstractHttpAuthenticationFilter;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.codehaus.redback.integration.filter.authentication.basic.HttpBasicAuthentication;
index 21a8b8ae2495a85dfc4f8eefa729af9dcc82c690..e81e83a30b09e31f792b3ed8652136142c95295a 100644 (file)
@@ -18,9 +18,9 @@ package org.codehaus.redback.rest.services;
  * specific language governing permissions and limitations
  * under the License.
  */
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.keys.jdo.JdoAuthenticationKey;
index 318bb4820c905dff4ecc881ef8a6ac264c9bda73..84562dc50514f14056087b6948b196380828fd82 100644 (file)
@@ -24,8 +24,8 @@ import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.plexus.cache.Cache;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.TokenBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.configuration.UserConfiguration;
 import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.KeyManager;
index dfb9834be484f6030d086a1b3c40a31061489ca2..df91c39f206031d7dfbc6cc74620b58e58a65c84 100644 (file)
@@ -25,8 +25,8 @@ import org.apache.archiva.redback.users.UserManager;
 import org.apache.cxf.jaxrs.ext.RequestHandler;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.message.Message;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index 675fa2c80d66ddc813f84ddb7ac8741726ca5c65..86514bf6b5dd8fb3788825469840493969340b70 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.cxf.jaxrs.ext.RequestHandler;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.message.Message;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 46fc619bd5a0ad5353a90571e2ffbae2b817e2d4..c37dbf883a836b026d23e1d50f89e0b63eaa951f 100644 (file)
@@ -21,12 +21,12 @@ package org.codehaus.plexus.redback.struts2.action;
 
 import org.apache.archiva.redback.users.User;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.authentication.AuthenticationConstants;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.TokenBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationConstants;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.configuration.UserConfiguration;
 import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.KeyManagerException;
index 0c4f08ffa22527326956639cf2ce0e00efac81b3..75354bbf8b6c41042a6dbb307293ec55580545ab 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.authentication.AuthenticationConstants;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationConstants;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.configuration.UserConfiguration;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index 7ac6753962c6afb4d0aa4f300bb4e605866e96f2..40d2ce61aaf18995c7c52a6144b165b199538cd4 100644 (file)
@@ -23,9 +23,9 @@ import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.TokenBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index 42d381600ef5dbc37989eb2e70c422dc3fbf0a00..548b126e91f17244d478d59410a66b90a566ecec 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.configuration.UserConfiguration;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
index e455a65c52ed72eb6fd2dd168d700afbdc6ce466..97b274440452c0f62960b1b4eaa556448d51700e 100644 (file)
@@ -28,9 +28,9 @@ import static org.easymock.EasyMock.verify;
 import java.util.HashMap;
 
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index 2a08c1b4cdeab1eefc56d31c5e952f017414c7de..cd8b803bed67fecc8df1a2432fd23cf5a4638fc6 100644 (file)
@@ -22,8 +22,8 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 import net.sf.ehcache.CacheManager;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.struts2.StrutsSpringTestCase;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.rbac.RBACManager;
index 531ff032ab00ce0b37e1ed9ceb8e69689dda107c..4df377ef15ea701d0e72ea66531c56820514c6ae 100644 (file)
@@ -22,8 +22,8 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 import com.google.common.collect.Lists;
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionProxy;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
 import org.codehaus.plexus.redback.authorization.AuthorizationResult;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index a87aedf1fce18aa57d48639c1662d5f4147d950e..289ab54a2b04839b141e97a884595d8f1a9ab972 100644 (file)
@@ -20,10 +20,10 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  */
 
 import com.opensymphony.xwork2.Action;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.rbac.RbacManagerException;
index f15e79597bed390d6d120da130674bb56c54a840..217422e7049735e0d67fedc03164ffe296770522 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.authentication.keystore;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.TokenBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.Authenticator;
+import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.keys.KeyManagerException;
index 9b149aaf6260f35fe2c4cf4edbcdc3417b880cf6..1f6257de1182c687e64d932f58cf66a7d1e56b6a 100644 (file)
@@ -20,7 +20,7 @@ package org.codehaus.plexus.redback.system;
  */
 
 import org.apache.archiva.redback.users.User;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.springframework.stereotype.Service;
 
 import java.io.Serializable;
index e2c333582bc956eed5ba042c23d05e3db1eee08f..53509b55f1fb717fd0b5966686b9b8814c99767e 100644 (file)
@@ -22,10 +22,10 @@ package org.codehaus.plexus.redback.system;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationManager;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationManager;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.codehaus.plexus.redback.authorization.AuthorizationDataSource;
 import org.codehaus.plexus.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.authorization.AuthorizationResult;
index 9052bbf6beaa769cc9faba2521288fad2e60e1e2..8ac071a586190511cc1f3829e20462f2bc453e92 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.system;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.users.User;
 
 import java.io.Serializable;
index e2f67c4274621a00a148f235bc55bcb33f9c38b5..b288f8a6e1b374b078e58a77dc025bafe22f2353 100644 (file)
@@ -20,8 +20,8 @@ package org.codehaus.plexus.redback.system;
  */
 
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.codehaus.plexus.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.authorization.AuthorizationResult;
 import org.codehaus.plexus.redback.keys.KeyManager;
index 3b200c5ec526461992ba13fb98006daa7ebed2e5..73a3d8f267131863b058d27c4b18a1ffbd0e3e0e 100644 (file)
@@ -20,7 +20,7 @@ package org.codehaus.plexus.redback.system;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.authentication.AuthenticationManager;
+import org.apache.archiva.redback.authentication.AuthenticationManager;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
index 9c5dad96db7d5daf0a450e71de51d38325a12707..bc55365f784a9e0e7f7d6d466cf894c38c9f26e2 100644 (file)
@@ -19,14 +19,14 @@ package org.apache.archiva.redback.authentication.users;
  * under the License.
  */
 
+import org.apache.archiva.redback.authentication.Authenticator;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationConstants;
-import org.codehaus.plexus.redback.authentication.AuthenticationDataSource;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationConstants;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.policy.PasswordEncoder;
@@ -72,7 +72,7 @@ public class UserManagerAuthenticator
      * @throws MustChangePasswordException
      * @throws MustChangePasswordException
      * @throws PolicyViolationException
-     * @see org.codehaus.plexus.redback.authentication.Authenticator#authenticate(org.codehaus.plexus.redback.authentication.AuthenticationDataSource)
+     * @see org.apache.archiva.redback.authentication.Authenticator#authenticate(org.apache.archiva.redback.authentication.AuthenticationDataSource)
      */
     public AuthenticationResult authenticate( AuthenticationDataSource ds )
         throws AuthenticationException, AccountLockedException, MustChangePasswordException
@@ -158,7 +158,7 @@ public class UserManagerAuthenticator
     }
 
     /**
-     * Returns the wrapped {@link UserManager} used by this {@link Authenticator}
+     * Returns the wrapped {@link UserManager} used by this {@link org.apache.archiva.redback.authentication.Authenticator}
      * implementation for authentication.
      *
      * @return the userManager
index 507abb5011152851fddcab96ce9e0618851ba8fc..bc849a6720e5479e7bbea7c83bbf5cb31ab63cba 100644 (file)
@@ -20,14 +20,13 @@ package org.apache.archiva.redback.authentication.users;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.redback.authentication.users.UserManagerAuthenticator;
+import org.apache.archiva.redback.authentication.Authenticator;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authentication.Authenticator;
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;