package move to o.a.a.r module redback-common-ldap

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-04-07 21:21:24 +00:00
parent 35fa98b376
commit 4d7d7f4731
27 changed files with 47 additions and 50 deletions

View File

@ -19,16 +19,16 @@ package org.apache.archiva.redback.authentication.ldap;
* under the License. * under the License.
*/ */
import org.apache.archiva.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.archiva.redback.authentication.AuthenticationDataSource; import org.apache.archiva.redback.authentication.AuthenticationDataSource;
import org.apache.archiva.redback.authentication.AuthenticationException; import org.apache.archiva.redback.authentication.AuthenticationException;
import org.apache.archiva.redback.authentication.AuthenticationResult; import org.apache.archiva.redback.authentication.AuthenticationResult;
import org.apache.archiva.redback.authentication.Authenticator; import org.apache.archiva.redback.authentication.Authenticator;
import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource; import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
import org.codehaus.plexus.redback.common.ldap.UserMapper; import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnection; import org.apache.archiva.redback.common.ldap.connection.LdapException;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory;
import org.codehaus.plexus.redback.common.ldap.connection.LdapException;
import org.codehaus.plexus.redback.configuration.UserConfiguration; import org.codehaus.plexus.redback.configuration.UserConfiguration;
import org.apache.archiva.redback.users.ldap.service.LdapCacheService; import org.apache.archiva.redback.users.ldap.service.LdapCacheService;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -36,7 +36,7 @@
<property name="password" value="secret"/> <property name="password" value="secret"/>
</bean> </bean>
<bean name="ldapConnectionFactory#configurable" class="org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory"> <bean name="ldapConnectionFactory#configurable" class="org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory">
<property name="hostname" value="localhost"/> <property name="hostname" value="localhost"/>
<property name="port" value="${ldapPort}"/> <property name="port" value="${ldapPort}"/>
<property name="baseDn" value="dc=redback,dc=plexus,dc=codehaus,dc=org"/> <property name="baseDn" value="dc=redback,dc=plexus,dc=codehaus,dc=org"/>
@ -46,7 +46,7 @@
<property name="userConf" ref="userConfiguration"/> <property name="userConf" ref="userConfiguration"/>
</bean> </bean>
<bean name="userMapper#ldap" class="org.codehaus.plexus.redback.common.ldap.LdapUserMapper"> <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.LdapUserMapper">
<property name="emailAttribute" value="mail"/> <property name="emailAttribute" value="mail"/>
<property name="fullNameAttribute" value="givenName"/> <property name="fullNameAttribute" value="givenName"/>
<property name="passwordAttribute" value="userPassword"/> <property name="passwordAttribute" value="userPassword"/>

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -28,6 +28,6 @@
default-lazy-init="true"> default-lazy-init="true">
<context:annotation-config /> <context:annotation-config />
<context:component-scan base-package="org.codehaus.plexus.redback.common.ldap"/> <context:component-scan base-package="org.apache.archiva.redback.common.ldap"/>
</beans> </beans>

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap; package org.apache.archiva.redback.common.ldap;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -20,6 +20,7 @@ package org.codehaus.plexus.redback.common.ldap;
*/ */
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.archiva.redback.common.ldap.LdapUserMapper;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;

View File

@ -1,4 +1,4 @@
package org.codehaus.plexus.redback.common.ldap.connection; package org.apache.archiva.redback.common.ldap.connection;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -20,6 +20,7 @@ package org.codehaus.plexus.redback.common.ldap.connection;
*/ */
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;

View File

@ -20,11 +20,8 @@
--> -->
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean name="userConfiguration" class="org.codehaus.plexus.redback.configuration.UserConfiguration"> <bean name="userConfiguration" class="org.codehaus.plexus.redback.configuration.UserConfiguration">
<property name="configs"> <property name="configs">

View File

@ -63,9 +63,9 @@
</configuration> </configuration>
</component> </component>
<component> <component>
<role>org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory</role> <role>org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory</role>
<role-hint>configurable</role-hint> <role-hint>configurable</role-hint>
<implementation>org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory</implementation> <implementation>org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory</implementation>
<description></description> <description></description>
<configuration> <configuration>
<hostname>localhost</hostname> <hostname>localhost</hostname>

View File

@ -20,15 +20,15 @@ package org.apache.archiva.redback.users.ldap;
*/ */
import org.apache.archiva.redback.common.ldap.LdapUser;
import org.apache.archiva.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.users.AbstractUserManager; import org.apache.archiva.redback.users.AbstractUserManager;
import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserNotFoundException; import org.apache.archiva.redback.users.UserNotFoundException;
import org.codehaus.plexus.redback.common.ldap.LdapUser; import org.apache.archiva.redback.common.ldap.MappingException;
import org.codehaus.plexus.redback.common.ldap.MappingException; import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
import org.codehaus.plexus.redback.common.ldap.UserMapper; import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnection; import org.apache.archiva.redback.common.ldap.connection.LdapException;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory;
import org.codehaus.plexus.redback.common.ldap.connection.LdapException;
import org.apache.archiva.redback.users.UserQuery; import org.apache.archiva.redback.users.UserQuery;
import org.apache.archiva.redback.users.ldap.ctl.LdapController; import org.apache.archiva.redback.users.ldap.ctl.LdapController;
import org.apache.archiva.redback.users.ldap.ctl.LdapControllerException; import org.apache.archiva.redback.users.ldap.ctl.LdapControllerException;

View File

@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap;
* under the License. * under the License.
*/ */
import org.codehaus.plexus.redback.common.ldap.UserMapper; import org.apache.archiva.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.users.AbstractUserQuery; import org.apache.archiva.redback.users.AbstractUserQuery;
public class LdapUserQuery public class LdapUserQuery

View File

@ -33,12 +33,12 @@ import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls; import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult; import javax.naming.directory.SearchResult;
import org.apache.archiva.redback.common.ldap.LdapUser;
import org.apache.archiva.redback.common.ldap.LdapUserMapper;
import org.apache.archiva.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserManager; import org.apache.archiva.redback.users.UserManager;
import org.codehaus.plexus.redback.common.ldap.LdapUser; import org.apache.archiva.redback.common.ldap.MappingException;
import org.codehaus.plexus.redback.common.ldap.LdapUserMapper;
import org.codehaus.plexus.redback.common.ldap.MappingException;
import org.codehaus.plexus.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.users.ldap.LdapUserQuery; import org.apache.archiva.redback.users.ldap.LdapUserQuery;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -139,7 +139,7 @@ public class DefaultLdapController
ctls.setDerefLinkFlag( true ); ctls.setDerefLinkFlag( true );
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE ); ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
ctls.setReturningAttributes( mapper.getReturningAttributes() ); ctls.setReturningAttributes( mapper.getReturningAttributes() );
ctls.setCountLimit( ( ( LdapUserMapper ) mapper ).getMaxResultCount() ); ctls.setCountLimit( ( (LdapUserMapper) mapper ).getMaxResultCount() );
String finalFilter = "(&(objectClass=" + mapper.getUserObjectClass() + ")" + String finalFilter = "(&(objectClass=" + mapper.getUserObjectClass() + ")" +
( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + query.getLdapFilter(mapper) + ")"; ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + query.getLdapFilter(mapper) + ")";

View File

@ -19,9 +19,9 @@ package org.apache.archiva.redback.users.ldap.ctl;
* under the License. * under the License.
*/ */
import org.apache.archiva.redback.common.ldap.LdapUser;
import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.User;
import org.codehaus.plexus.redback.common.ldap.LdapUser; import org.apache.archiva.redback.common.ldap.MappingException;
import org.codehaus.plexus.redback.common.ldap.MappingException;
import org.apache.archiva.redback.users.ldap.LdapUserQuery; import org.apache.archiva.redback.users.ldap.LdapUserQuery;
import javax.naming.directory.DirContext; import javax.naming.directory.DirContext;

View File

@ -19,9 +19,8 @@ package org.apache.archiva.redback.users.ldap.service;
* under the License. * under the License.
*/ */
import org.apache.archiva.redback.users.ldap.service.LdapCacheService; import org.apache.archiva.redback.common.ldap.LdapUser;
import org.codehaus.plexus.cache.builder.CacheBuilder; import org.codehaus.plexus.cache.builder.CacheBuilder;
import org.codehaus.plexus.redback.common.ldap.LdapUser;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.inject.Inject; import javax.inject.Inject;
@ -66,7 +65,7 @@ public class DefaultLdapCacheService
} }
/** /**
* @see LdapCacheService#addUser(org.codehaus.plexus.redback.common.ldap.LdapUser) * @see LdapCacheService#addUser(org.apache.archiva.redback.common.ldap.LdapUser)
*/ */
public void addUser( LdapUser user ) public void addUser( LdapUser user )
{ {

View File

@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap.service;
* under the License. * under the License.
*/ */
import org.codehaus.plexus.redback.common.ldap.LdapUser; import org.apache.archiva.redback.common.ldap.LdapUser;
/** /**
* LdapCacheService * LdapCacheService

View File

@ -21,8 +21,8 @@ package org.apache.archiva.redback.users.ldap;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.User;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnection; import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
import org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory; import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory;
import org.codehaus.plexus.redback.policy.PasswordEncoder; import org.codehaus.plexus.redback.policy.PasswordEncoder;
import org.codehaus.plexus.redback.policy.encoders.SHA1PasswordEncoder; import org.codehaus.plexus.redback.policy.encoders.SHA1PasswordEncoder;
import org.apache.archiva.redback.users.UserManager; import org.apache.archiva.redback.users.UserManager;

View File

@ -20,8 +20,7 @@ package org.apache.archiva.redback.users.ldap.service;
*/ */
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.archiva.redback.users.ldap.service.LdapCacheService; import org.apache.archiva.redback.common.ldap.LdapUser;
import org.codehaus.plexus.redback.common.ldap.LdapUser;
import org.junit.After; import org.junit.After;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -36,7 +36,7 @@
<property name="password" value="secret"/> <property name="password" value="secret"/>
</bean> </bean>
<bean name="ldapConnectionFactory#configurable" class="org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory"> <bean name="ldapConnectionFactory#configurable" class="org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory">
<property name="hostname" value="localhost"/> <property name="hostname" value="localhost"/>
<property name="port" value="${ldapPort}"/> <property name="port" value="${ldapPort}"/>
<property name="baseDn" value="dc=redback,dc=plexus,dc=codehaus,dc=org"/> <property name="baseDn" value="dc=redback,dc=plexus,dc=codehaus,dc=org"/>
@ -46,7 +46,7 @@
<property name="userConf" ref="userConfiguration"/> <property name="userConf" ref="userConfiguration"/>
</bean> </bean>
<bean name="userMapper#ldap" class="org.codehaus.plexus.redback.common.ldap.LdapUserMapper"> <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.LdapUserMapper">
<property name="emailAttribute" value="mail"/> <property name="emailAttribute" value="mail"/>
<property name="fullNameAttribute" value="givenName"/> <property name="fullNameAttribute" value="givenName"/>
<property name="passwordAttribute" value="userPassword"/> <property name="passwordAttribute" value="userPassword"/>