]> source.dussan.org Git - archiva.git/commitdiff
move user concerns to a specific package
authorOlivier Lamy <olamy@apache.org>
Thu, 3 Jan 2013 17:03:03 +0000 (17:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 3 Jan 2013 17:03:03 +0000 (17:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1428474 13f79535-47bb-0310-9956-ffa450edef68

19 files changed:
redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/apache/archiva/redback/authentication/ldap/LdapBindAuthenticator.java
redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/test/resources/META-INF/spring-context.xml
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUser.java [deleted file]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUserMapper.java [deleted file]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserMapper.java [deleted file]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserUpdate.java [deleted file]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUser.java [new file with mode: 0644]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUserMapper.java [new file with mode: 0644]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserMapper.java [new file with mode: 0644]
redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserUpdate.java [new file with mode: 0644]
redback-common/redback-common-ldap/src/test/java/org/apache/archiva/redback/common/ldap/LdapUserMapperTest.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserManager.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserQuery.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/DefaultLdapController.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/LdapController.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/service/DefaultLdapCacheService.java
redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/service/LdapCacheService.java
redback-users/redback-users-providers/redback-users-ldap/src/test/java/org/apache/archiva/redback/users/ldap/service/LdapCacheServiceTest.java
redback-users/redback-users-providers/redback-users-ldap/src/test/resources/spring-context.xml

index 7cf582fa36b62273b2b3397092f01dea9e54e7e3..58a68074ccff5f71e9119d918bd9912698bbbe88 100644 (file)
@@ -20,8 +20,7 @@ package org.apache.archiva.redback.authentication.ldap;
  */
 
 import org.apache.archiva.redback.authentication.AbstractAuthenticator;
-import org.apache.archiva.redback.authentication.AuthenticationConstants;
-import org.apache.archiva.redback.common.ldap.UserMapper;
+import org.apache.archiva.redback.common.ldap.user.UserMapper;
 import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory;
 import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.configuration.UserConfigurationKeys;
@@ -45,8 +44,6 @@ import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
  * LdapBindAuthenticator:
index dce4872561e8bcd32f84a7daee163abaa380487f..a4ca7ddc8ae482dfa563ef6626849b42d4bb9f23 100644 (file)
@@ -46,7 +46,7 @@
     <property name="userConf" ref="userConfiguration#default"/>
   </bean>
 
-  <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.LdapUserMapper">
+  <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.user.LdapUserMapper">
     <property name="emailAttribute" value="mail"/>
     <property name="fullNameAttribute" value="givenName"/>
     <property name="passwordAttribute" value="userPassword"/>
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUser.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUser.java
deleted file mode 100644 (file)
index 1fe82a8..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-package org.apache.archiva.redback.common.ldap;
-
-/*
- * 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.users.User;
-
-import javax.naming.directory.Attributes;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-// TODO this class should be able to be replaced with a model
-public class LdapUser
-    implements User, Serializable
-{
-
-    private String username;
-
-    private String fullName;
-
-    private String email;
-
-    private String encodedPassword;
-
-    private List<String> previousEncodedPasswords;
-
-    private boolean locked = false;
-
-    private boolean requiresPasswordChange = false;
-
-    private boolean permanent = true;
-
-    private boolean valid = true;
-
-    private Date creationDate = null;
-
-    private int failedLoginAttempts;
-
-    private Date lastLoginDate = null;
-
-    private Date lastPasswordChange = null;
-
-    // DO NOT STORE AS SUCH!!!
-    private String newPassword;
-
-    private Attributes originalAttributes;
-
-    /**
-     * @since 2.1
-     */
-    private String userManagerId = "ldap";
-
-    public LdapUser( String username )
-    {
-        this.username = username;
-        this.previousEncodedPasswords = new ArrayList<String>( 0 );
-        this.failedLoginAttempts = 0;
-    }
-
-    public LdapUser( String username, String fullName, String email )
-    {
-        this( username );
-        this.fullName = fullName;
-        this.email = email;
-    }
-
-    public LdapUser()
-    {
-        previousEncodedPasswords = new ArrayList<String>( 0 );
-        failedLoginAttempts = Integer.MIN_VALUE;
-    }
-
-    public void addPreviousEncodedPassword( String encodedPassword )
-    {
-        previousEncodedPasswords.add( encodedPassword );
-    }
-
-    public Date getAccountCreationDate()
-    {
-        return creationDate;
-    }
-
-    public int getCountFailedLoginAttempts()
-    {
-        return failedLoginAttempts;
-    }
-
-    public String getEmail()
-    {
-        return email;
-    }
-
-    public String getEncodedPassword()
-    {
-        return encodedPassword;
-    }
-
-    public String getFullName()
-    {
-        return fullName;
-    }
-
-    public Date getLastLoginDate()
-    {
-        return lastLoginDate;
-    }
-
-    public Date getLastPasswordChange()
-    {
-        return lastPasswordChange;
-    }
-
-    public String getPassword()
-    {
-        return newPassword;
-    }
-
-    public List<String> getPreviousEncodedPasswords()
-    {
-        return previousEncodedPasswords;
-    }
-
-
-    public String getUsername()
-    {
-        return username;
-    }
-
-    public boolean isLocked()
-    {
-        return locked;
-    }
-
-    public boolean isPasswordChangeRequired()
-    {
-        return requiresPasswordChange;
-    }
-
-    public boolean isPermanent()
-    {
-        return permanent;
-    }
-
-    public boolean isValidated()
-    {
-        return valid;
-    }
-
-    public void setCountFailedLoginAttempts( int count )
-    {
-        failedLoginAttempts = count;
-    }
-
-    public void setEmail( String address )
-    {
-        email = address;
-    }
-
-    public void setEncodedPassword( String encodedPassword )
-    {
-        this.encodedPassword = encodedPassword;
-    }
-
-    public void setFullName( String name )
-    {
-        fullName = name;
-    }
-
-    public void setAccountCreationDate( Date date )
-    {
-        creationDate = date;
-    }
-
-    public void setLastLoginDate( Date date )
-    {
-        lastLoginDate = date;
-    }
-
-    public void setLastPasswordChange( Date passwordChangeDate )
-    {
-        lastPasswordChange = passwordChangeDate;
-    }
-
-    public void setLocked( boolean locked )
-    {
-        this.locked = locked;
-    }
-
-    public void setPassword( String rawPassword )
-    {
-        newPassword = rawPassword;
-    }
-
-    public void setPasswordChangeRequired( boolean changeRequired )
-    {
-        requiresPasswordChange = changeRequired;
-    }
-
-    public void setPermanent( boolean permanent )
-    {
-        this.permanent = permanent;
-    }
-
-    public void setPreviousEncodedPasswords( List<String> encodedPasswordList )
-    {
-        previousEncodedPasswords = new ArrayList<String>( encodedPasswordList );
-    }
-
-    public void setUsername( String name )
-    {
-        username = name;
-    }
-
-    public void setValidated( boolean valid )
-    {
-        this.valid = valid;
-    }
-
-    public Attributes getOriginalAttributes()
-    {
-        return originalAttributes;
-    }
-
-    public void setOriginalAttributes( Attributes originalAttributes )
-    {
-        this.originalAttributes = originalAttributes;
-    }
-
-    public String getUserManagerId()
-    {
-        return userManagerId;
-    }
-
-}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUserMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/LdapUserMapper.java
deleted file mode 100644 (file)
index 6cf3d85..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-package org.apache.archiva.redback.common.ldap;
-
-/*
- * 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.configuration.UserConfiguration;
-import org.apache.archiva.redback.configuration.UserConfigurationKeys;
-import org.apache.archiva.redback.users.User;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-import java.util.Date;
-
-/**
- * @author <a href="jesse@codehaus.org"> jesse
- */
-@Service("userMapper#ldap")
-public class LdapUserMapper
-    implements UserMapper
-{
-    /**
-     *
-     */
-    String emailAttribute = "mail";
-
-    /**
-     *
-     */
-    String fullNameAttribute = "givenName";
-
-    /**
-     *
-     */
-    String passwordAttribute = "userPassword";
-
-    /**
-     *
-     */
-    String userIdAttribute = "cn";
-
-    /**
-     *
-     */
-    String userBaseDn;
-
-    /**
-     *
-     */
-    String userObjectClass = "inetOrgPerson";
-
-    /**
-     *
-     */
-    String userFilter;
-
-    /**
-     *
-     */
-    int maxResultCount = 0;
-
-    @Inject
-    @Named(value = "userConfiguration#default")
-    private UserConfiguration userConf;
-
-    @PostConstruct
-    public void initialize()
-    {
-        emailAttribute = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_EMAIL, emailAttribute );
-        fullNameAttribute =
-            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_FULLNAME, fullNameAttribute );
-        passwordAttribute =
-            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_PASSWORD, passwordAttribute );
-        userIdAttribute = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_ID, userIdAttribute );
-        userBaseDn = userConf.getConcatenatedList( "ldap.config.mapper.attribute.user.base.dn",
-                                                   userConf.getConcatenatedList( "ldap.config.base.dn", userBaseDn ) );
-        userObjectClass =
-            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_OBJECT_CLASS, userObjectClass );
-        userFilter = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_FILTER, userFilter );
-        maxResultCount = userConf.getInt( UserConfigurationKeys.LDAP_MAX_RESULT_COUNT, maxResultCount );
-    }
-
-    public Attributes getCreationAttributes( User user, boolean encodePasswordIfChanged )
-        throws MappingException
-    {
-        Attributes userAttrs = new BasicAttributes();
-
-        boolean passwordSet = false;
-
-        if ( !passwordSet && ( user.getEncodedPassword() != null ) )
-        {
-            userAttrs.put( getPasswordAttribute(), user.getEncodedPassword() );
-        }
-
-        if ( !StringUtils.isEmpty( user.getFullName() ) )
-        {
-            userAttrs.put( getUserFullNameAttribute(), user.getFullName() );
-        }
-
-        if ( !StringUtils.isEmpty( user.getEmail() ) )
-        {
-            userAttrs.put( getEmailAddressAttribute(), user.getEmail() );
-        }
-
-        return userAttrs;
-    }
-
-    public String getEmailAddressAttribute()
-    {
-        return emailAttribute;
-    }
-
-    public String getUserFullNameAttribute()
-    {
-        return fullNameAttribute;
-    }
-
-    public String getPasswordAttribute()
-    {
-        return passwordAttribute;
-    }
-
-    public String[] getUserAttributeNames()
-    {
-        return new String[]{ emailAttribute, fullNameAttribute, passwordAttribute, userIdAttribute };
-    }
-
-    public int getMaxResultCount()
-    {
-        return maxResultCount;
-    }
-
-    public UserUpdate getUpdate( LdapUser user )
-        throws MappingException
-    {
-
-        Attributes addAttrs = new BasicAttributes();
-
-        Attributes modAttrs = new BasicAttributes();
-
-        if ( !StringUtils.isEmpty( user.getFullName() ) )
-        {
-            if ( user.getFullName() == null )
-            {
-                addAttrs.put( getUserFullNameAttribute(), user.getFullName() );
-            }
-            else if ( !user.getFullName().equals( user.getFullName() ) )
-            {
-                modAttrs.put( getUserFullNameAttribute(), user.getFullName() );
-            }
-        }
-
-        if ( !StringUtils.isEmpty( user.getEmail() ) )
-        {
-            if ( user.getEmail() == null )
-            {
-                addAttrs.put( getEmailAddressAttribute(), user.getEmail() );
-            }
-            else if ( !user.getEmail().equals( user.getEmail() ) )
-            {
-                modAttrs.put( getEmailAddressAttribute(), user.getEmail() );
-            }
-        }
-
-        return null;
-    }
-
-    public LdapUser getUser( Attributes attributes )
-        throws MappingException
-    {
-        String userIdAttribute = getUserIdAttribute();
-        String emailAddressAttribute = getEmailAddressAttribute();
-        String nameAttribute = getUserFullNameAttribute();
-        String passwordAttribute = getPasswordAttribute();
-
-        String userId = LdapUtils.getAttributeValue( attributes, userIdAttribute, "username" );
-
-        LdapUser user = new LdapUser( userId );
-        user.setOriginalAttributes( attributes );
-
-        user.setEmail( LdapUtils.getAttributeValue( attributes, emailAddressAttribute, "email address" ) );
-        user.setFullName( LdapUtils.getAttributeValue( attributes, nameAttribute, "name" ) );
-
-        String encodedPassword = LdapUtils.getAttributeValueFromByteArray( attributes, passwordAttribute, "password" );
-
-        // it seems to be a common convention for the password to come back prepended with the encoding type..
-        // however we deal with that via configuration right now so just smoke it.
-        if ( encodedPassword != null && encodedPassword.startsWith( "{" ) )
-        {
-            encodedPassword = encodedPassword.substring( encodedPassword.indexOf( '}' ) + 1 );
-        }
-
-        user.setEncodedPassword( encodedPassword );
-
-        // REDBACK-215: skip NPE
-        user.setLastPasswordChange( new Date() );
-
-        return user;
-    }
-
-    public String getUserIdAttribute()
-    {
-        return userIdAttribute;
-    }
-
-    public String getEmailAttribute()
-    {
-        return emailAttribute;
-    }
-
-    public void setEmailAttribute( String emailAttribute )
-    {
-        this.emailAttribute = emailAttribute;
-    }
-
-    public String getFullNameAttribute()
-    {
-        return fullNameAttribute;
-    }
-
-    public void setFullNameAttribute( String fullNameAttribute )
-    {
-        this.fullNameAttribute = fullNameAttribute;
-    }
-
-    public void setMaxResultCount( int maxResultCount )
-    {
-        this.maxResultCount = maxResultCount;
-    }
-
-    public String getUserBaseDn()
-    {
-        return userBaseDn;
-    }
-
-    public void setUserBaseDn( String userBaseDn )
-    {
-        this.userBaseDn = userBaseDn;
-    }
-
-    public String getUserObjectClass()
-    {
-        return userObjectClass;
-    }
-
-    public String getUserFilter()
-    {
-        return userFilter;
-    }
-
-    public void setUserFilter( String userFilter )
-    {
-        this.userFilter = userFilter;
-    }
-
-    public void setUserObjectClass( String userObjectClass )
-    {
-        this.userObjectClass = userObjectClass;
-    }
-
-    public void setPasswordAttribute( String passwordAttribute )
-    {
-        this.passwordAttribute = passwordAttribute;
-    }
-
-    public void setUserIdAttribute( String userIdAttribute )
-    {
-        this.userIdAttribute = userIdAttribute;
-    }
-
-    public LdapUser newUserInstance( String username, String fullName, String email )
-    {
-        return new LdapUser( username, fullName, email );
-    }
-
-    public LdapUser newTemplateUserInstance()
-    {
-        return new LdapUser();
-    }
-
-    public String[] getReturningAttributes()
-    {
-        return new String[]{ getUserIdAttribute(), getEmailAttribute(), getFullNameAttribute(),
-            getPasswordAttribute() };
-    }
-
-    public UserConfiguration getUserConf()
-    {
-        return userConf;
-    }
-
-    public void setUserConf( UserConfiguration userConf )
-    {
-        this.userConf = userConf;
-    }
-}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserMapper.java
deleted file mode 100644 (file)
index 8ccafd6..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.archiva.redback.common.ldap;
-
-/*
- * 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.users.User;
-
-import javax.naming.directory.Attributes;
-
-/**
- *
- */
-public interface UserMapper
-{
-    LdapUser getUser( Attributes attributes )
-        throws MappingException;
-
-    Attributes getCreationAttributes( User user, boolean encodePasswordIfChanged )
-        throws MappingException;
-
-    UserUpdate getUpdate( LdapUser user )
-        throws MappingException;
-
-    String[] getUserAttributeNames();
-
-    String getEmailAddressAttribute();
-
-    String getUserFullNameAttribute();
-
-    String getPasswordAttribute();
-
-    String getUserIdAttribute();
-
-    String getEmailAttribute();
-
-    String getUserBaseDn();
-
-    String getUserObjectClass();
-
-    String getUserFilter();
-
-    LdapUser newUserInstance( String username, String fullName, String email );
-
-    LdapUser newTemplateUserInstance();
-
-    String[] getReturningAttributes();
-
-    void initialize();
-
-}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserUpdate.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/UserUpdate.java
deleted file mode 100644 (file)
index 48f4e9b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.apache.archiva.redback.common.ldap;
-
-/*
- * 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 javax.naming.directory.Attributes;
-
-/**
- *
- */
-public class UserUpdate
-{
-
-    private final Attributes created;
-
-    private final Attributes modified;
-
-    private final Attributes removed;
-
-    public UserUpdate( Attributes created, Attributes modified, Attributes removed )
-    {
-        this.created = created;
-        this.modified = modified;
-        this.removed = removed;
-    }
-
-    public Attributes getAddedAttributes()
-    {
-        return created;
-    }
-
-    public Attributes getModifiedAttributes()
-    {
-        return modified;
-    }
-
-    public Attributes getRemovedAttributes()
-    {
-        return removed;
-    }
-
-    public boolean hasAdditions()
-    {
-        return ( created != null ) && ( created.size() > 0 );
-    }
-
-    public boolean hasModifications()
-    {
-        return ( modified != null ) && ( modified.size() > 0 );
-    }
-
-
-
-}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUser.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUser.java
new file mode 100644 (file)
index 0000000..941cf1f
--- /dev/null
@@ -0,0 +1,252 @@
+package org.apache.archiva.redback.common.ldap.user;
+
+/*
+ * 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.users.User;
+
+import javax.naming.directory.Attributes;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+// TODO this class should be able to be replaced with a model
+public class LdapUser
+    implements User, Serializable
+{
+
+    private String username;
+
+    private String fullName;
+
+    private String email;
+
+    private String encodedPassword;
+
+    private List<String> previousEncodedPasswords;
+
+    private boolean locked = false;
+
+    private boolean requiresPasswordChange = false;
+
+    private boolean permanent = true;
+
+    private boolean valid = true;
+
+    private Date creationDate = null;
+
+    private int failedLoginAttempts;
+
+    private Date lastLoginDate = null;
+
+    private Date lastPasswordChange = null;
+
+    // DO NOT STORE AS SUCH!!!
+    private String newPassword;
+
+    private Attributes originalAttributes;
+
+    /**
+     * @since 2.1
+     */
+    private String userManagerId = "ldap";
+
+    public LdapUser( String username )
+    {
+        this.username = username;
+        this.previousEncodedPasswords = new ArrayList<String>( 0 );
+        this.failedLoginAttempts = 0;
+    }
+
+    public LdapUser( String username, String fullName, String email )
+    {
+        this( username );
+        this.fullName = fullName;
+        this.email = email;
+    }
+
+    public LdapUser()
+    {
+        previousEncodedPasswords = new ArrayList<String>( 0 );
+        failedLoginAttempts = Integer.MIN_VALUE;
+    }
+
+    public void addPreviousEncodedPassword( String encodedPassword )
+    {
+        previousEncodedPasswords.add( encodedPassword );
+    }
+
+    public Date getAccountCreationDate()
+    {
+        return creationDate;
+    }
+
+    public int getCountFailedLoginAttempts()
+    {
+        return failedLoginAttempts;
+    }
+
+    public String getEmail()
+    {
+        return email;
+    }
+
+    public String getEncodedPassword()
+    {
+        return encodedPassword;
+    }
+
+    public String getFullName()
+    {
+        return fullName;
+    }
+
+    public Date getLastLoginDate()
+    {
+        return lastLoginDate;
+    }
+
+    public Date getLastPasswordChange()
+    {
+        return lastPasswordChange;
+    }
+
+    public String getPassword()
+    {
+        return newPassword;
+    }
+
+    public List<String> getPreviousEncodedPasswords()
+    {
+        return previousEncodedPasswords;
+    }
+
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public boolean isLocked()
+    {
+        return locked;
+    }
+
+    public boolean isPasswordChangeRequired()
+    {
+        return requiresPasswordChange;
+    }
+
+    public boolean isPermanent()
+    {
+        return permanent;
+    }
+
+    public boolean isValidated()
+    {
+        return valid;
+    }
+
+    public void setCountFailedLoginAttempts( int count )
+    {
+        failedLoginAttempts = count;
+    }
+
+    public void setEmail( String address )
+    {
+        email = address;
+    }
+
+    public void setEncodedPassword( String encodedPassword )
+    {
+        this.encodedPassword = encodedPassword;
+    }
+
+    public void setFullName( String name )
+    {
+        fullName = name;
+    }
+
+    public void setAccountCreationDate( Date date )
+    {
+        creationDate = date;
+    }
+
+    public void setLastLoginDate( Date date )
+    {
+        lastLoginDate = date;
+    }
+
+    public void setLastPasswordChange( Date passwordChangeDate )
+    {
+        lastPasswordChange = passwordChangeDate;
+    }
+
+    public void setLocked( boolean locked )
+    {
+        this.locked = locked;
+    }
+
+    public void setPassword( String rawPassword )
+    {
+        newPassword = rawPassword;
+    }
+
+    public void setPasswordChangeRequired( boolean changeRequired )
+    {
+        requiresPasswordChange = changeRequired;
+    }
+
+    public void setPermanent( boolean permanent )
+    {
+        this.permanent = permanent;
+    }
+
+    public void setPreviousEncodedPasswords( List<String> encodedPasswordList )
+    {
+        previousEncodedPasswords = new ArrayList<String>( encodedPasswordList );
+    }
+
+    public void setUsername( String name )
+    {
+        username = name;
+    }
+
+    public void setValidated( boolean valid )
+    {
+        this.valid = valid;
+    }
+
+    public Attributes getOriginalAttributes()
+    {
+        return originalAttributes;
+    }
+
+    public void setOriginalAttributes( Attributes originalAttributes )
+    {
+        this.originalAttributes = originalAttributes;
+    }
+
+    public String getUserManagerId()
+    {
+        return userManagerId;
+    }
+
+}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUserMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUserMapper.java
new file mode 100644 (file)
index 0000000..b615b0c
--- /dev/null
@@ -0,0 +1,318 @@
+package org.apache.archiva.redback.common.ldap.user;
+
+/*
+ * 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.common.ldap.LdapUtils;
+import org.apache.archiva.redback.common.ldap.MappingException;
+import org.apache.archiva.redback.configuration.UserConfiguration;
+import org.apache.archiva.redback.configuration.UserConfigurationKeys;
+import org.apache.archiva.redback.users.User;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttributes;
+import java.util.Date;
+
+/**
+ * @author <a href="jesse@codehaus.org"> jesse
+ */
+@Service("userMapper#ldap")
+public class LdapUserMapper
+    implements UserMapper
+{
+    /**
+     *
+     */
+    String emailAttribute = "mail";
+
+    /**
+     *
+     */
+    String fullNameAttribute = "givenName";
+
+    /**
+     *
+     */
+    String passwordAttribute = "userPassword";
+
+    /**
+     *
+     */
+    String userIdAttribute = "cn";
+
+    /**
+     *
+     */
+    String userBaseDn;
+
+    /**
+     *
+     */
+    String userObjectClass = "inetOrgPerson";
+
+    /**
+     *
+     */
+    String userFilter;
+
+    /**
+     *
+     */
+    int maxResultCount = 0;
+
+    @Inject
+    @Named(value = "userConfiguration#default")
+    private UserConfiguration userConf;
+
+    @PostConstruct
+    public void initialize()
+    {
+        emailAttribute = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_EMAIL, emailAttribute );
+        fullNameAttribute =
+            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_FULLNAME, fullNameAttribute );
+        passwordAttribute =
+            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_PASSWORD, passwordAttribute );
+        userIdAttribute = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_ID, userIdAttribute );
+        userBaseDn = userConf.getConcatenatedList( "ldap.config.mapper.attribute.user.base.dn",
+                                                   userConf.getConcatenatedList( "ldap.config.base.dn", userBaseDn ) );
+        userObjectClass =
+            userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_OBJECT_CLASS, userObjectClass );
+        userFilter = userConf.getString( UserConfigurationKeys.LDAP_MAPPER_USER_ATTRIBUTE_FILTER, userFilter );
+        maxResultCount = userConf.getInt( UserConfigurationKeys.LDAP_MAX_RESULT_COUNT, maxResultCount );
+    }
+
+    public Attributes getCreationAttributes( User user, boolean encodePasswordIfChanged )
+        throws MappingException
+    {
+        Attributes userAttrs = new BasicAttributes();
+
+        boolean passwordSet = false;
+
+        if ( !passwordSet && ( user.getEncodedPassword() != null ) )
+        {
+            userAttrs.put( getPasswordAttribute(), user.getEncodedPassword() );
+        }
+
+        if ( !StringUtils.isEmpty( user.getFullName() ) )
+        {
+            userAttrs.put( getUserFullNameAttribute(), user.getFullName() );
+        }
+
+        if ( !StringUtils.isEmpty( user.getEmail() ) )
+        {
+            userAttrs.put( getEmailAddressAttribute(), user.getEmail() );
+        }
+
+        return userAttrs;
+    }
+
+    public String getEmailAddressAttribute()
+    {
+        return emailAttribute;
+    }
+
+    public String getUserFullNameAttribute()
+    {
+        return fullNameAttribute;
+    }
+
+    public String getPasswordAttribute()
+    {
+        return passwordAttribute;
+    }
+
+    public String[] getUserAttributeNames()
+    {
+        return new String[]{ emailAttribute, fullNameAttribute, passwordAttribute, userIdAttribute };
+    }
+
+    public int getMaxResultCount()
+    {
+        return maxResultCount;
+    }
+
+    public UserUpdate getUpdate( LdapUser user )
+        throws MappingException
+    {
+
+        Attributes addAttrs = new BasicAttributes();
+
+        Attributes modAttrs = new BasicAttributes();
+
+        if ( !StringUtils.isEmpty( user.getFullName() ) )
+        {
+            if ( user.getFullName() == null )
+            {
+                addAttrs.put( getUserFullNameAttribute(), user.getFullName() );
+            }
+            else if ( !user.getFullName().equals( user.getFullName() ) )
+            {
+                modAttrs.put( getUserFullNameAttribute(), user.getFullName() );
+            }
+        }
+
+        if ( !StringUtils.isEmpty( user.getEmail() ) )
+        {
+            if ( user.getEmail() == null )
+            {
+                addAttrs.put( getEmailAddressAttribute(), user.getEmail() );
+            }
+            else if ( !user.getEmail().equals( user.getEmail() ) )
+            {
+                modAttrs.put( getEmailAddressAttribute(), user.getEmail() );
+            }
+        }
+
+        return null;
+    }
+
+    public LdapUser getUser( Attributes attributes )
+        throws MappingException
+    {
+        String userIdAttribute = getUserIdAttribute();
+        String emailAddressAttribute = getEmailAddressAttribute();
+        String nameAttribute = getUserFullNameAttribute();
+        String passwordAttribute = getPasswordAttribute();
+
+        String userId = LdapUtils.getAttributeValue( attributes, userIdAttribute, "username" );
+
+        LdapUser user = new LdapUser( userId );
+        user.setOriginalAttributes( attributes );
+
+        user.setEmail( LdapUtils.getAttributeValue( attributes, emailAddressAttribute, "email address" ) );
+        user.setFullName( LdapUtils.getAttributeValue( attributes, nameAttribute, "name" ) );
+
+        String encodedPassword = LdapUtils.getAttributeValueFromByteArray( attributes, passwordAttribute, "password" );
+
+        // it seems to be a common convention for the password to come back prepended with the encoding type..
+        // however we deal with that via configuration right now so just smoke it.
+        if ( encodedPassword != null && encodedPassword.startsWith( "{" ) )
+        {
+            encodedPassword = encodedPassword.substring( encodedPassword.indexOf( '}' ) + 1 );
+        }
+
+        user.setEncodedPassword( encodedPassword );
+
+        // REDBACK-215: skip NPE
+        user.setLastPasswordChange( new Date() );
+
+        return user;
+    }
+
+    public String getUserIdAttribute()
+    {
+        return userIdAttribute;
+    }
+
+    public String getEmailAttribute()
+    {
+        return emailAttribute;
+    }
+
+    public void setEmailAttribute( String emailAttribute )
+    {
+        this.emailAttribute = emailAttribute;
+    }
+
+    public String getFullNameAttribute()
+    {
+        return fullNameAttribute;
+    }
+
+    public void setFullNameAttribute( String fullNameAttribute )
+    {
+        this.fullNameAttribute = fullNameAttribute;
+    }
+
+    public void setMaxResultCount( int maxResultCount )
+    {
+        this.maxResultCount = maxResultCount;
+    }
+
+    public String getUserBaseDn()
+    {
+        return userBaseDn;
+    }
+
+    public void setUserBaseDn( String userBaseDn )
+    {
+        this.userBaseDn = userBaseDn;
+    }
+
+    public String getUserObjectClass()
+    {
+        return userObjectClass;
+    }
+
+    public String getUserFilter()
+    {
+        return userFilter;
+    }
+
+    public void setUserFilter( String userFilter )
+    {
+        this.userFilter = userFilter;
+    }
+
+    public void setUserObjectClass( String userObjectClass )
+    {
+        this.userObjectClass = userObjectClass;
+    }
+
+    public void setPasswordAttribute( String passwordAttribute )
+    {
+        this.passwordAttribute = passwordAttribute;
+    }
+
+    public void setUserIdAttribute( String userIdAttribute )
+    {
+        this.userIdAttribute = userIdAttribute;
+    }
+
+    public LdapUser newUserInstance( String username, String fullName, String email )
+    {
+        return new LdapUser( username, fullName, email );
+    }
+
+    public LdapUser newTemplateUserInstance()
+    {
+        return new LdapUser();
+    }
+
+    public String[] getReturningAttributes()
+    {
+        return new String[]{ getUserIdAttribute(), getEmailAttribute(), getFullNameAttribute(),
+            getPasswordAttribute() };
+    }
+
+    public UserConfiguration getUserConf()
+    {
+        return userConf;
+    }
+
+    public void setUserConf( UserConfiguration userConf )
+    {
+        this.userConf = userConf;
+    }
+}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserMapper.java
new file mode 100644 (file)
index 0000000..8108c1b
--- /dev/null
@@ -0,0 +1,67 @@
+package org.apache.archiva.redback.common.ldap.user;
+
+/*
+ * 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.common.ldap.MappingException;
+import org.apache.archiva.redback.users.User;
+
+import javax.naming.directory.Attributes;
+
+/**
+ *
+ */
+public interface UserMapper
+{
+    LdapUser getUser( Attributes attributes )
+        throws MappingException;
+
+    Attributes getCreationAttributes( User user, boolean encodePasswordIfChanged )
+        throws MappingException;
+
+    UserUpdate getUpdate( LdapUser user )
+        throws MappingException;
+
+    String[] getUserAttributeNames();
+
+    String getEmailAddressAttribute();
+
+    String getUserFullNameAttribute();
+
+    String getPasswordAttribute();
+
+    String getUserIdAttribute();
+
+    String getEmailAttribute();
+
+    String getUserBaseDn();
+
+    String getUserObjectClass();
+
+    String getUserFilter();
+
+    LdapUser newUserInstance( String username, String fullName, String email );
+
+    LdapUser newTemplateUserInstance();
+
+    String[] getReturningAttributes();
+
+    void initialize();
+
+}
diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserUpdate.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/UserUpdate.java
new file mode 100644 (file)
index 0000000..4e0ddf0
--- /dev/null
@@ -0,0 +1,70 @@
+package org.apache.archiva.redback.common.ldap.user;
+
+/*
+ * 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 javax.naming.directory.Attributes;
+
+/**
+ *
+ */
+public class UserUpdate
+{
+
+    private final Attributes created;
+
+    private final Attributes modified;
+
+    private final Attributes removed;
+
+    public UserUpdate( Attributes created, Attributes modified, Attributes removed )
+    {
+        this.created = created;
+        this.modified = modified;
+        this.removed = removed;
+    }
+
+    public Attributes getAddedAttributes()
+    {
+        return created;
+    }
+
+    public Attributes getModifiedAttributes()
+    {
+        return modified;
+    }
+
+    public Attributes getRemovedAttributes()
+    {
+        return removed;
+    }
+
+    public boolean hasAdditions()
+    {
+        return ( created != null ) && ( created.size() > 0 );
+    }
+
+    public boolean hasModifications()
+    {
+        return ( modified != null ) && ( modified.size() > 0 );
+    }
+
+
+
+}
index c08f9fcec5a9fc8f0c757c5c2506c7cfee754bed..8c29b41fc0e07344c1c8ccae1797c32972ad6b5d 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.redback.common.ldap;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.redback.common.ldap.LdapUserMapper;
+import org.apache.archiva.redback.common.ldap.user.LdapUserMapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
index af76e1310de438a393f97bdddbb5f05ab3428e1b..54f9adf489a09b5e2234cc65bda6130407256e85 100644 (file)
@@ -20,8 +20,8 @@ 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.common.ldap.user.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.UserMapper;
 import org.apache.archiva.redback.users.AbstractUserManager;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
index 153b540bd42ce2ed548c46702fb1c8adfdee5cc2..6f09794495b7a869f63cc85a84d9b33c342d08ec 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap;
  * under the License.
  */
 
-import org.apache.archiva.redback.common.ldap.UserMapper;
+import org.apache.archiva.redback.common.ldap.user.UserMapper;
 import org.apache.archiva.redback.users.AbstractUserQuery;
 
 public class LdapUserQuery
index aa9c175bc8c4ad6e48820c142046c5de8f28656f..6f2baf005f87645cd56d02a47a3c8a3e854b6ca3 100644 (file)
@@ -33,9 +33,9 @@ import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 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.common.ldap.user.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.LdapUserMapper;
+import org.apache.archiva.redback.common.ldap.user.UserMapper;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.common.ldap.MappingException;
index eb147fcbdd9dacbf0b44289bfdb7d5e7663af674..f09ef98dabeec69adace1631bfc31e1403429d54 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap.ctl;
  * under the License.
  */
 
-import org.apache.archiva.redback.common.ldap.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.LdapUser;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.common.ldap.MappingException;
 import org.apache.archiva.redback.users.ldap.LdapUserQuery;
index c39565e6219c77e4fd19390c52dee7266542c97d..2802f8a070acfa36d8f8e41b1d7de08e8074f0b9 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap.service;
  * under the License.
  */
 
-import org.apache.archiva.redback.common.ldap.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.LdapUser;
 import org.apache.archiva.redback.components.cache.builder.CacheBuilder;
 import org.springframework.stereotype.Service;
 
@@ -65,7 +65,7 @@ public class DefaultLdapCacheService
     }
 
     /**
-     * @see LdapCacheService#addUser(org.apache.archiva.redback.common.ldap.LdapUser)
+     * @see LdapCacheService#addUser(org.apache.archiva.redback.common.ldap.user.LdapUser)
      */
     public void addUser( LdapUser user )
     {
index 5075ba2bbc2b124e1cf6ae8c551b194eb787df53..e0102f18b9e6cafebefd7d0c64fb62fb5e6a538b 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.redback.users.ldap.service;
  * under the License.
  */
 
-import org.apache.archiva.redback.common.ldap.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.LdapUser;
 
 /**
  * LdapCacheService
index 004075bac79b778d141e2f234a89dfb50816a951..778b967678c73a10ea5738ca11a5b56b379ab3d3 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.redback.users.ldap.service;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.redback.common.ldap.LdapUser;
+import org.apache.archiva.redback.common.ldap.user.LdapUser;
 import org.junit.After;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index 0db63d91a3e9efd780ae1b5db81fc79855cb9098..aa90e62035cb52e4b055055314072854a579d147 100644 (file)
@@ -46,7 +46,7 @@
     <property name="userConf" ref="userConfiguration#default"/>
   </bean>
 
-  <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.LdapUserMapper">
+  <bean name="userMapper#ldap" class="org.apache.archiva.redback.common.ldap.user.LdapUserMapper">
     <property name="emailAttribute" value="mail"/>
     <property name="fullNameAttribute" value="givenName"/>
     <property name="passwordAttribute" value="userPassword"/>