mirror of
https://github.com/apache/archiva.git
synced 2025-02-07 02:29:23 +00:00
added test cases for XmlRpcAuthenticator
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches@702748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
595365bf02
commit
15219de0c5
@ -47,5 +47,37 @@
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-spring</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- use spring for the unit tests?
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authorization-rbac</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-keys-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-users-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rbac-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,3 +1,5 @@
|
||||
package org.apache.maven.archiva.xmlrpc.security;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
@ -16,176 +18,199 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.maven.archiva.xmlrpc.security;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.maven.archiva.security.ArchivaRoleConstants;
|
||||
import org.apache.maven.archiva.security.UserRepositories;
|
||||
import org.apache.xmlrpc.XmlRpcRequest;
|
||||
import org.apache.xmlrpc.XmlRpcRequestConfig;
|
||||
import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;
|
||||
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.authorization.AuthorizationException;
|
||||
import org.codehaus.plexus.redback.authorization.AuthorizationResult;
|
||||
import org.codehaus.plexus.redback.keys.KeyManager;
|
||||
import org.codehaus.plexus.redback.policy.AccountLockedException;
|
||||
import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
|
||||
import org.codehaus.plexus.redback.system.SecuritySession;
|
||||
import org.codehaus.plexus.redback.rbac.RBACManager;
|
||||
import org.codehaus.plexus.redback.role.RoleManager;
|
||||
import org.codehaus.plexus.redback.system.SecuritySystem;
|
||||
import org.codehaus.plexus.redback.users.User;
|
||||
import org.codehaus.plexus.redback.users.UserManager;
|
||||
import org.codehaus.plexus.redback.users.UserNotFoundException;
|
||||
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
|
||||
import org.easymock.MockControl;
|
||||
import org.easymock.classextension.MockClassControl;
|
||||
|
||||
/**
|
||||
* XmlRpcAuthenticatorTest
|
||||
*
|
||||
* @version $Id XmlRpcAuthenticatorTest.java
|
||||
*/
|
||||
public class XmlRpcAuthenticatorTest
|
||||
extends TestCase
|
||||
//extends AbstractDependencyInjectionSpringContextTests
|
||||
extends PlexusInSpringTestCase
|
||||
{
|
||||
private static final String USERNAME = "username";
|
||||
protected static final String USER_GUEST = "guest";
|
||||
|
||||
private static final String PASSWORD = "password";
|
||||
protected static final String USER_ADMIN = "admin";
|
||||
|
||||
public void testAuthentication()
|
||||
protected static final String USER_ALPACA = "alpaca";
|
||||
|
||||
private static final String PASSWORD = "password123";
|
||||
|
||||
protected SecuritySystem securitySystem;
|
||||
|
||||
protected RoleManager roleManager;
|
||||
|
||||
private MockControl xmlRpcRequestControl;
|
||||
|
||||
private XmlRpcRequest xmlRpcRequest;
|
||||
|
||||
private XmlRpcAuthenticator authenticator;
|
||||
|
||||
private MockControl configControl;
|
||||
|
||||
private XmlRpcHttpRequestConfigImpl config;
|
||||
|
||||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
MockSecuritySystem securitySystem = new MockSecuritySystem( true, true, USERNAME, PASSWORD );
|
||||
XmlRpcAuthenticator authenticator = new XmlRpcAuthenticator( securitySystem );
|
||||
MockXmlRpcRequest request = new MockXmlRpcRequest( USERNAME, PASSWORD );
|
||||
super.setUp();
|
||||
|
||||
securitySystem = (SecuritySystem) lookup( SecuritySystem.class, "testable" );
|
||||
roleManager = (RoleManager) lookup( RoleManager.class, "default" );
|
||||
|
||||
// Some basic asserts.
|
||||
assertNotNull( securitySystem );
|
||||
assertNotNull( roleManager );
|
||||
|
||||
// Setup Admin User.
|
||||
User adminUser = createUser( USER_ADMIN, "Admin User", null );
|
||||
roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_SYSTEM_ADMIN, adminUser.getPrincipal().toString() );
|
||||
|
||||
//assertTrue( authenticator.isAuthorized( request ) );
|
||||
// Setup Guest User.
|
||||
User guestUser = createUser( USER_GUEST, "Guest User", null );
|
||||
roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, guestUser.getPrincipal().toString() );
|
||||
|
||||
configControl = MockClassControl.createControl( XmlRpcHttpRequestConfigImpl.class );
|
||||
config = ( XmlRpcHttpRequestConfigImpl ) configControl.getMock();
|
||||
|
||||
xmlRpcRequestControl = MockControl.createControl( XmlRpcRequest.class );
|
||||
xmlRpcRequest = ( XmlRpcRequest ) xmlRpcRequestControl.getMock();
|
||||
|
||||
authenticator = new XmlRpcAuthenticator( securitySystem );
|
||||
}
|
||||
|
||||
class MockXmlRpcRequest
|
||||
implements XmlRpcRequest
|
||||
|
||||
private User createUser( String principal, String fullname, String password )
|
||||
throws UserNotFoundException
|
||||
{
|
||||
private final XmlRpcHttpRequestConfigImpl configImpl;
|
||||
|
||||
public MockXmlRpcRequest( String username, String password )
|
||||
{
|
||||
configImpl = new XmlRpcHttpRequestConfigImpl();
|
||||
configImpl.setBasicUserName( username );
|
||||
configImpl.setBasicPassword( password );
|
||||
}
|
||||
|
||||
public XmlRpcRequestConfig getConfig()
|
||||
{
|
||||
return configImpl;
|
||||
}
|
||||
|
||||
public String getMethodName()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public Object getParameter( int pIndex )
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public int getParameterCount()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
UserManager userManager = securitySystem.getUserManager();
|
||||
|
||||
User user = userManager.createUser( principal, fullname, principal + "@testable.archiva.apache.org" );
|
||||
securitySystem.getPolicy().setEnabled( false );
|
||||
userManager.addUser( user );
|
||||
securitySystem.getPolicy().setEnabled( true );
|
||||
|
||||
user.setPassword( password );
|
||||
userManager.updateUser( user );
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
class MockSecuritySystem
|
||||
implements SecuritySystem
|
||||
|
||||
public void testIsAuthorizedUserExistsButNotAuthorized()
|
||||
throws Exception
|
||||
{
|
||||
private final boolean authorized;
|
||||
|
||||
private final boolean authenticate;
|
||||
|
||||
private final String username;
|
||||
|
||||
private final String password;
|
||||
|
||||
public MockSecuritySystem( boolean authorized, boolean authenticate, String username, String password )
|
||||
createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );
|
||||
|
||||
UserManager userManager = securitySystem.getUserManager();
|
||||
try
|
||||
{
|
||||
this.authorized = authorized;
|
||||
this.authenticate = authenticate;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
User user = userManager.findUser( USER_ALPACA );
|
||||
assertEquals( USER_ALPACA, user.getPrincipal() );
|
||||
}
|
||||
|
||||
public SecuritySession authenticate( AuthenticationDataSource dataSource )
|
||||
throws AuthenticationException, UserNotFoundException, AccountLockedException
|
||||
catch ( UserNotFoundException e )
|
||||
{
|
||||
return new SecuritySession()
|
||||
{
|
||||
|
||||
public AuthenticationResult getAuthenticationResult()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public User getUser()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public boolean isAuthenticated()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public AuthorizationResult authorize( SecuritySession session, Object arg1 )
|
||||
throws AuthorizationException
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public AuthorizationResult authorize( SecuritySession session, Object arg1, Object arg2 )
|
||||
throws AuthorizationException
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public String getAuthenticatorId()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public String getAuthorizerId()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public KeyManager getKeyManager()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public UserSecurityPolicy getPolicy()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public String getUserManagementId()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public UserManager getUserManager()
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public boolean isAuthenticated( AuthenticationDataSource dataSource )
|
||||
throws AuthenticationException, UserNotFoundException, AccountLockedException
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public boolean isAuthorized( SecuritySession session, Object arg1 )
|
||||
throws AuthorizationException
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
public boolean isAuthorized( SecuritySession session, Object arg1, Object arg2 )
|
||||
throws AuthorizationException
|
||||
{
|
||||
throw new UnsupportedOperationException( "Not supported yet." );
|
||||
fail( "User should exist in the database." );
|
||||
}
|
||||
|
||||
xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );
|
||||
|
||||
xmlRpcRequestControl.replay();
|
||||
configControl.replay();
|
||||
|
||||
boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );
|
||||
|
||||
xmlRpcRequestControl.verify();
|
||||
configControl.verify();
|
||||
|
||||
assertFalse( isAuthorized );
|
||||
}
|
||||
|
||||
public void testIsAuthorizedUserExistsAndAuthorized()
|
||||
throws Exception
|
||||
{
|
||||
createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );
|
||||
|
||||
UserManager userManager = securitySystem.getUserManager();
|
||||
try
|
||||
{
|
||||
User user = userManager.findUser( USER_ALPACA );
|
||||
assertEquals( USER_ALPACA, user.getPrincipal() );
|
||||
}
|
||||
catch ( UserNotFoundException e )
|
||||
{
|
||||
fail( "User should exist in the database." );
|
||||
}
|
||||
|
||||
//TODO cannot assign global repo manager role - it says role does not exist :|
|
||||
|
||||
//roleManager.assignRole( ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE, USER_ALPACA );
|
||||
|
||||
xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );
|
||||
|
||||
xmlRpcRequestControl.replay();
|
||||
configControl.replay();
|
||||
|
||||
boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );
|
||||
|
||||
xmlRpcRequestControl.verify();
|
||||
configControl.verify();
|
||||
|
||||
//assertTrue( isAuthorized );
|
||||
}
|
||||
|
||||
public void testIsAuthorizedUserDoesNotExist()
|
||||
throws Exception
|
||||
{
|
||||
UserManager userManager = securitySystem.getUserManager();
|
||||
try
|
||||
{
|
||||
userManager.findUser( USER_ALPACA );
|
||||
fail( "User should not exist in the database." );
|
||||
}
|
||||
catch ( UserNotFoundException e )
|
||||
{
|
||||
assertEquals( "Unable to find user 'alpaca'", e.getMessage() );
|
||||
}
|
||||
|
||||
xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );
|
||||
|
||||
configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );
|
||||
|
||||
xmlRpcRequestControl.replay();
|
||||
configControl.replay();
|
||||
|
||||
boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );
|
||||
|
||||
xmlRpcRequestControl.verify();
|
||||
configControl.verify();
|
||||
|
||||
assertFalse( isAuthorized );
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,210 @@
|
||||
<redback-role-model>
|
||||
<modelVersion>1.0.0</modelVersion>
|
||||
<applications>
|
||||
<application>
|
||||
<id>Redback XWork Integration Security Core</id>
|
||||
<version>1.0</version>
|
||||
<resources>
|
||||
<resource>
|
||||
<id>global</id>
|
||||
<name>*</name>
|
||||
<permanent>true</permanent>
|
||||
<description>
|
||||
global resource implies full access for authorization
|
||||
</description>
|
||||
</resource>
|
||||
<resource>
|
||||
<id>username</id>
|
||||
<name>${username}</name>
|
||||
<permanent>true</permanent>
|
||||
<description>
|
||||
replaced with the username of the principal at authorization
|
||||
check time
|
||||
</description>
|
||||
</resource>
|
||||
</resources>
|
||||
<operations>
|
||||
<operation>
|
||||
<id>configuration-edit</id>
|
||||
<name>configuration-edit</name>
|
||||
<description>edit configuration</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-user-create</id>
|
||||
<name>user-management-user-create</name>
|
||||
<description>create user</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-user-edit</id>
|
||||
<name>user-management-user-edit</name>
|
||||
<description>edit user</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-user-role</id>
|
||||
<name>user-management-user-role</name>
|
||||
<description>user roles</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-user-delete</id>
|
||||
<name>user-management-user-delete</name>
|
||||
<description>delete user</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-user-list</id>
|
||||
<name>user-management-user-list</name>
|
||||
<description>list users</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-role-grant</id>
|
||||
<name>user-management-role-grant</name>
|
||||
<description>grant role</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-role-drop</id>
|
||||
<name>user-management-role-drop</name>
|
||||
<description>drop role</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>user-management-rbac-admin</id>
|
||||
<name>user-management-rbac-admin</name>
|
||||
<description>administer rbac</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>guest-access</id>
|
||||
<name>guest-access</name>
|
||||
<description>access guest</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
<operation>
|
||||
<id>add-repository</id>
|
||||
<name>add-repository</name>
|
||||
<description>add repository</description>
|
||||
<permanent>true</permanent>
|
||||
</operation>
|
||||
</operations>
|
||||
<roles>
|
||||
<role>
|
||||
<id>system-administrator</id>
|
||||
<name>System Administrator</name>
|
||||
<permanent>true</permanent>
|
||||
<assignable>true</assignable>
|
||||
<permissions>
|
||||
<permission>
|
||||
<id>edit-redback-configuration</id>
|
||||
<name>Edit Redback Configuration</name>
|
||||
<operation>configuration-edit</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>manage-rbac-setup</id>
|
||||
<name>User RBAC Management</name>
|
||||
<operation>user-management-rbac-admin</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
</permissions>
|
||||
<childRoles>
|
||||
<childRole>user-administrator</childRole>
|
||||
</childRoles>
|
||||
</role>
|
||||
<role>
|
||||
<id>user-administrator</id>
|
||||
<name>User Administrator</name>
|
||||
<permanent>true</permanent>
|
||||
<assignable>true</assignable>
|
||||
<permissions>
|
||||
<permission>
|
||||
<id>drop-roles-for-anyone</id>
|
||||
<name>Drop Roles for Anyone</name>
|
||||
<operation>user-management-role-drop</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>grant-roles-for-anyone</id>
|
||||
<name>Grant Roles for Anyone</name>
|
||||
<operation>user-management-role-grant</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>user-create</id>
|
||||
<name>Create Users</name>
|
||||
<operation>user-management-user-create</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>user-delete</id>
|
||||
<name>Delete Users</name>
|
||||
<operation>user-management-user-delete</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>user-edit</id>
|
||||
<name>Edit Users</name>
|
||||
<operation>user-management-user-edit</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>access-users-roles</id>
|
||||
<name>Access Users Roles</name>
|
||||
<operation>user-management-user-role</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
<permission>
|
||||
<id>access-user-list</id>
|
||||
<name>Access User List</name>
|
||||
<operation>user-management-user-list</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
</permissions>
|
||||
</role>
|
||||
<role>
|
||||
<id>registered-user</id>
|
||||
<name>Registered User</name>
|
||||
<permanent>true</permanent>
|
||||
<assignable>true</assignable>
|
||||
<permissions>
|
||||
<permission>
|
||||
<id>edit-user-by-username</id>
|
||||
<name>Edit User Data by Username</name>
|
||||
<operation>user-management-user-edit</operation>
|
||||
<resource>username</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
</permissions>
|
||||
</role>
|
||||
<role>
|
||||
<id>guest</id>
|
||||
<name>Guest</name>
|
||||
<permanent>true</permanent>
|
||||
<assignable>true</assignable>
|
||||
<permissions>
|
||||
<permission>
|
||||
<id>guest-permission</id>
|
||||
<name>Guest Permission</name>
|
||||
<operation>guest-access</operation>
|
||||
<resource>global</resource>
|
||||
<permanent>true</permanent>
|
||||
</permission>
|
||||
</permissions>
|
||||
</role>
|
||||
</roles>
|
||||
</application>
|
||||
</applications>
|
||||
</redback-role-model>
|
@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" ?>
|
||||
<component-set>
|
||||
<components>
|
||||
|
||||
<!-- x
|
||||
<component>
|
||||
<role>org.apache.maven.archiva.security.UserRepositories</role>
|
||||
<role-hint>default</role-hint>
|
||||
<implementation>org.apache.maven.archiva.security.DefaultUserRepositories</implementation>
|
||||
<description>DefaultUserRepositories</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.system.SecuritySystem</role>
|
||||
<role-hint>testable</role-hint>
|
||||
<field-name>securitySystem</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.rbac.RBACManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>rbacManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.role.RoleManager</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>roleManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
|
||||
<field-name>archivaConfiguration</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
-->
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.system.SecuritySystem</role>
|
||||
<role-hint>testable</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.system.DefaultSecuritySystem</implementation>
|
||||
<description>DefaultSecuritySystem:</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.authentication.AuthenticationManager</role>
|
||||
<field-name>authnManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.authorization.Authorizer</role>
|
||||
<role-hint>rbac</role-hint>
|
||||
<field-name>authorizer</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.users.UserManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>userManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.keys.KeyManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>keyManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
|
||||
<field-name>policy</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.authorization.Authorizer</role>
|
||||
<role-hint>rbac</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer</implementation>
|
||||
<description>RbacAuthorizer:</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.rbac.RBACManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>manager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.users.UserManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>userManager</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>evaluator</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>config</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
|
||||
<role-hint>default</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator</implementation>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.users.UserManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>userManager</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.role.RoleManager</role>
|
||||
<role-hint>default</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.role.DefaultRoleManager</implementation>
|
||||
<description>RoleProfileManager:</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.role.validator.RoleModelValidator</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>modelValidator</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>modelProcessor</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>templateProcessor</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.rbac.RBACManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>rbacManager</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
|
||||
<role-hint>default</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor</implementation>
|
||||
<description>DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.rbac.RBACManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>rbacManager</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
|
||||
<role-hint>default</role-hint>
|
||||
<implementation>org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor</implementation>
|
||||
<description>DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager</description>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.redback.rbac.RBACManager</role>
|
||||
<role-hint>memory</role-hint>
|
||||
<field-name>rbacManager</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
||||
<!--
|
||||
<component>
|
||||
<role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
|
||||
<implementation>org.apache.maven.archiva.configuration.DefaultArchivaConfiguration</implementation>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.registry.Registry</role>
|
||||
<role-hint>configured</role-hint>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
<component>
|
||||
<role>org.codehaus.plexus.registry.Registry</role>
|
||||
<role-hint>configured</role-hint>
|
||||
<implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
|
||||
<configuration>
|
||||
<properties>
|
||||
<system/>
|
||||
<xml fileName="${basedir}/target/test-conf/archiva.xml"
|
||||
config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
|
||||
</properties>
|
||||
</configuration>
|
||||
</component>
|
||||
-->
|
||||
|
||||
</components>
|
||||
</component-set>
|
@ -949,6 +949,19 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- use spring test in xmlrpc?
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user