1
0
mirror of synced 2026-08-04 09:17:02 +00:00

SEC-1132: package refactoring of non-core modules

This commit is contained in:
Luke Taylor
2009-03-27 05:01:03 +00:00
parent bec84f874a
commit f746a20ab4
83 changed files with 215 additions and 256 deletions
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap;
package org.springframework.security.ldap;
import org.springframework.security.Authentication;
import org.springframework.ldap.core.DirContextOperations;
@@ -1,32 +0,0 @@
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
*
* Licensed 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.
*/
package org.springframework.security.ldap;
import org.springframework.dao.DataAccessException;
import javax.naming.NamingException;
/**
* @author Luke Taylor
* @deprecated Spring ldap is used instead.
* @version $Id$
*/
public interface NamingExceptionTranslator {
//~ Methods ========================================================================================================
DataAccessException translate(String task, NamingException e);
}
@@ -2,8 +2,8 @@ package org.springframework.security.ldap;
import org.springframework.security.Authentication;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.ldap.userdetails.LdapUserDetails;
import org.springframework.security.providers.AnonymousAuthenticationToken;
import org.springframework.security.userdetails.ldap.LdapUserDetails;
import org.springframework.ldap.core.AuthenticationSource;
import org.apache.commons.logging.Log;
@@ -1,28 +0,0 @@
package org.springframework.security.ldap;
import org.springframework.ldap.core.support.BaseLdapPathContextSource;
import org.springframework.ldap.core.ContextSource;
import javax.naming.directory.DirContext;
/**
* Extension of {@link ContextSource} which allows binding explicitly as a particular user.
*
* @author Luke Taylor
* @version $Id$
* @since 2.0
*
* @deprecated As of Spring LDAP 1.3, ContextSource provides this method itself.
*/
public interface SpringSecurityContextSource extends BaseLdapPathContextSource {
/**
* Obtains a context using the supplied distinguished name and credentials.
*
* @param userDn the distinguished name of the user to authenticate as
* @param credentials the user's password
* @return a context authenticated as the supplied user
*/
DirContext getReadWriteContext(String userDn, Object credentials);
}
@@ -13,11 +13,11 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.ldap.LdapAuthenticator;
import org.springframework.security.ldap.LdapUserSearch;
import org.springframework.security.providers.ldap.LdapAuthenticator;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap;
package org.springframework.security.ldap.authentication;
import java.util.List;
@@ -23,14 +23,15 @@ import org.springframework.security.AuthenticationServiceException;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.ldap.LdapAuthenticator;
import org.springframework.security.ldap.LdapAuthoritiesPopulator;
import org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator;
import org.springframework.security.ldap.userdetails.LdapUserDetailsMapper;
import org.springframework.security.ldap.userdetails.UserDetailsContextMapper;
import org.springframework.security.providers.AuthenticationProvider;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UsernameNotFoundException;
import org.springframework.security.userdetails.ldap.LdapUserDetailsMapper;
import org.springframework.security.userdetails.ldap.UserDetailsContextMapper;
import org.springframework.security.util.AuthorityUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
@@ -55,9 +56,9 @@ import org.apache.commons.logging.LogFactory;
* <h3>LdapAuthenticator</h3>
* This interface is responsible for performing the user authentication and retrieving
* the user's information from the directory. Example implementations are {@link
* org.springframework.security.providers.ldap.authenticator.BindAuthenticator BindAuthenticator} which authenticates
* org.springframework.security.ldap.authentication.BindAuthenticator BindAuthenticator} which authenticates
* the user by "binding" as that user, and
* {@link org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator PasswordComparisonAuthenticator}
* {@link org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator PasswordComparisonAuthenticator}
* which compares the supplied password with the value stored in the directory, using an LDAP "compare"
* operation.
* <p>
@@ -124,7 +125,7 @@ import org.apache.commons.logging.LogFactory;
* @author Luke Taylor
* @version $Id$
*
* @see org.springframework.security.providers.ldap.authenticator.BindAuthenticator
* @see org.springframework.security.ldap.authentication.BindAuthenticator
* @see DefaultLdapAuthoritiesPopulator
*/
public class LdapAuthenticationProvider implements AuthenticationProvider, MessageSourceAware {
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -32,7 +32,7 @@ import org.springframework.util.Assert;
/**
* An {@link org.springframework.security.providers.ldap.LdapAuthenticator LdapAuthenticator} which compares the login
* An {@link org.springframework.security.ldap.LdapAuthenticator LdapAuthenticator} which compares the login
* password with the value stored in the directory using a remote LDAP "compare" operation.
*
* <p>
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import java.util.List;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import org.springframework.security.userdetails.UserDetails;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import java.util.ArrayList;
import java.util.List;
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import org.springframework.security.Authentication;
import org.springframework.security.BadCredentialsException;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import java.util.List;
@@ -1,4 +1,4 @@
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.security.ldap.LdapAuthoritiesPopulator;
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import org.springframework.util.Assert;
@@ -1,4 +1,4 @@
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import java.util.List;
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import java.util.List;
@@ -1,5 +0,0 @@
<html>
<body>
LDAP authenticator implementations.
</body>
</html>
@@ -1,9 +1,9 @@
package org.springframework.security.ldap;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.ldap.userdetails.LdapUserDetailsImpl;
import org.springframework.security.providers.AnonymousAuthenticationToken;
import org.springframework.security.providers.TestingAuthenticationToken;
import org.springframework.security.userdetails.ldap.LdapUserDetailsImpl;
import org.springframework.security.util.AuthorityUtils;
import org.springframework.ldap.core.AuthenticationSource;
import org.springframework.ldap.core.DistinguishedName;
@@ -13,12 +13,13 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import org.springframework.security.Authentication;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.ldap.AbstractLdapIntegrationTests;
import org.springframework.security.ldap.authentication.BindAuthenticator;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap;
package org.springframework.security.ldap.authentication;
import static org.junit.Assert.*;
@@ -30,11 +30,13 @@ import org.springframework.ldap.core.DistinguishedName;
import org.springframework.security.Authentication;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.ldap.LdapAuthenticator;
import org.springframework.security.ldap.LdapAuthoritiesPopulator;
import org.springframework.security.ldap.authentication.LdapAuthenticationProvider;
import org.springframework.security.ldap.userdetails.LdapUserDetailsMapper;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UsernameNotFoundException;
import org.springframework.security.userdetails.ldap.LdapUserDetailsMapper;
import org.springframework.security.util.AuthorityUtils;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import static org.junit.Assert.*;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import org.springframework.security.ldap.LdapUserSearch;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
@@ -26,6 +26,7 @@ import org.jmock.Mockery;
import org.jmock.integration.junit4.JUnit4Mockery;
import org.junit.Test;
import org.springframework.ldap.core.support.BaseLdapPathContextSource;
import org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
@@ -13,12 +13,13 @@
* limitations under the License.
*/
package org.springframework.security.providers.ldap.authenticator;
package org.springframework.security.ldap.authentication;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.Authentication;
import org.springframework.security.ldap.AbstractLdapIntegrationTests;
import org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator;
import org.springframework.security.providers.encoding.LdapShaPasswordEncoder;
import org.springframework.security.providers.encoding.PlaintextPasswordEncoder;
@@ -1,9 +1,10 @@
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import junit.framework.TestCase;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.security.ldap.userdetails.InetOrgPerson;
/**
* @author Luke Taylor
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -30,6 +30,11 @@ import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.ldap.AbstractLdapIntegrationTests;
import org.springframework.security.ldap.DefaultLdapUsernameToDnMapper;
import org.springframework.security.ldap.SpringSecurityLdapTemplate;
import org.springframework.security.ldap.userdetails.InetOrgPerson;
import org.springframework.security.ldap.userdetails.InetOrgPersonContextMapper;
import org.springframework.security.ldap.userdetails.LdapUserDetails;
import org.springframework.security.ldap.userdetails.LdapUserDetailsManager;
import org.springframework.security.ldap.userdetails.PersonContextMapper;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.security.userdetails.UsernameNotFoundException;
import org.springframework.security.util.AuthorityUtils;
@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
@@ -22,6 +22,9 @@ import junit.framework.TestCase;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.security.ldap.userdetails.LdapUserDetails;
import org.springframework.security.ldap.userdetails.LdapUserDetailsImpl;
import org.springframework.security.ldap.userdetails.LdapUserDetailsMapper;
import org.springframework.security.util.AuthorityUtils;
/**
@@ -1,4 +1,4 @@
package org.springframework.security.userdetails.ldap;
package org.springframework.security.ldap.userdetails;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -12,7 +12,9 @@ import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.ldap.LdapAuthoritiesPopulator;
import org.springframework.security.providers.ldap.authenticator.MockUserSearch;
import org.springframework.security.ldap.authentication.MockUserSearch;
import org.springframework.security.ldap.userdetails.LdapUserDetailsMapper;
import org.springframework.security.ldap.userdetails.LdapUserDetailsService;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.util.AuthorityUtils;