diff --git a/core/pom.xml b/core/pom.xml index 7133a8ffd6..bf50ad6aa9 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -58,11 +58,6 @@ org.aspectj com.springsource.org.aspectj.weaver - - org.springframework.ldap - spring-ldap-core - true - cglib cglib-nodep @@ -102,33 +97,13 @@ servlet-api true - - org.apache.directory.server - apacheds-core - 1.0.2 - compile - true - - - org.apache.directory.server - apacheds-server-jndi - 1.0.2 - compile - true - - - org.apache.mina - mina-core - 1.0.5 - compile - true - org.apache.tomcat annotations-api 6.0.14 true + org.jmock jmock-junit4 diff --git a/core/src/main/java/org/springframework/security/config/Elements.java b/core/src/main/java/org/springframework/security/config/Elements.java index 1c5d6a8001..55b25d43a2 100644 --- a/core/src/main/java/org/springframework/security/config/Elements.java +++ b/core/src/main/java/org/springframework/security/config/Elements.java @@ -6,7 +6,7 @@ package org.springframework.security.config; * @author Ben Alex * @version $Id$ */ -abstract class Elements { +public abstract class Elements { public static final String AUTHENTICATION_MANAGER = "authentication-manager"; public static final String USER_SERVICE = "user-service"; diff --git a/core/src/main/java/org/springframework/security/config/LdapConfigUtils.java b/core/src/main/java/org/springframework/security/config/LdapConfigUtils.java deleted file mode 100644 index 6cc65cf1e9..0000000000 --- a/core/src/main/java/org/springframework/security/config/LdapConfigUtils.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.springframework.security.config; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.config.BeanFactoryPostProcessor; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.core.Ordered; -import org.springframework.ldap.core.support.BaseLdapPathContextSource; - -/** - * @author Luke Taylor - * @version $Id$ - * @since 2.0 - */ -class LdapConfigUtils { - - /** - * Checks for the presence of a ContextSource instance. Also supplies the standard reference to any - * unconfigured or beans. This is - * necessary in cases where the user has given the server a specific Id, but hasn't used - * the server-ref attribute to link this to the other ldap definitions. See SEC-799. - */ - private static class ContextSourceSettingPostProcessor implements BeanFactoryPostProcessor, Ordered { - /** If set to true, a bean parser has indicated that the default context source name needs to be set */ - private boolean defaultNameRequired; - - public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException { - String[] sources = bf.getBeanNamesForType(BaseLdapPathContextSource.class); - - if (sources.length == 0) { - throw new SecurityConfigurationException("No BaseLdapPathContextSource instances found. Have you " + - "added an <" + Elements.LDAP_SERVER + " /> element to your application context?"); - } - - if (!bf.containsBean(BeanIds.CONTEXT_SOURCE) && defaultNameRequired) { - if (sources.length > 1) { - throw new SecurityConfigurationException("More than one BaseLdapPathContextSource instance found. " + - "Please specify a specific server id using the 'server-ref' attribute when configuring your <" + - Elements.LDAP_PROVIDER + "> " + "or <" + Elements.LDAP_USER_SERVICE + ">."); - } - - bf.registerAlias(sources[0], BeanIds.CONTEXT_SOURCE); - } - } - - public void setDefaultNameRequired(boolean defaultNameRequired) { - this.defaultNameRequired = defaultNameRequired; - } - - public int getOrder() { - return LOWEST_PRECEDENCE; - } - } - - static void registerPostProcessorIfNecessary(BeanDefinitionRegistry registry, boolean defaultNameRequired) { - if (registry.containsBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR)) { - if (defaultNameRequired) { - BeanDefinition bd = registry.getBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR); - bd.getPropertyValues().addPropertyValue("defaultNameRequired", Boolean.valueOf(defaultNameRequired)); - } - return; - } - - BeanDefinition bd = new RootBeanDefinition(ContextSourceSettingPostProcessor.class); - registry.registerBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR, bd); - bd.getPropertyValues().addPropertyValue("defaultNameRequired", Boolean.valueOf(defaultNameRequired)); - } - -} diff --git a/core/src/main/java/org/springframework/security/config/LdapProviderBeanDefinitionParser.java b/core/src/main/java/org/springframework/security/config/LdapProviderBeanDefinitionParser.java index dd1e917117..8db6996d30 100644 --- a/core/src/main/java/org/springframework/security/config/LdapProviderBeanDefinitionParser.java +++ b/core/src/main/java/org/springframework/security/config/LdapProviderBeanDefinitionParser.java @@ -1,17 +1,14 @@ package org.springframework.security.config; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.config.RuntimeBeanReference; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.beans.factory.xml.BeanDefinitionParser; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.security.providers.encoding.PasswordEncoder; -import org.springframework.util.StringUtils; -import org.springframework.util.xml.DomUtils; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; /** @@ -83,9 +80,9 @@ public class LdapProviderBeanDefinitionParser implements BeanDefinitionParser { parserContext.getReaderContext().warning("Salt source information isn't valid when used with LDAP", passwordEncoderElement); } - } else if (StringUtils.hasText(hash)) { - Class encoderClass = PasswordEncoderParser.ENCODER_CLASSES.get(hash); - authenticatorBuilder.addPropertyValue("passwordEncoder", new RootBeanDefinition(encoderClass)); + } else if (StringUtils.hasText(hash)) {; + authenticatorBuilder.addPropertyValue("passwordEncoder", + PasswordEncoderParser.createPasswordEncoderBeanDefinition(hash, false)); } } diff --git a/core/src/main/java/org/springframework/security/config/LdapServerBeanDefinitionParser.java b/core/src/main/java/org/springframework/security/config/LdapServerBeanDefinitionParser.java index 85ad1fbf4c..d043bff9e6 100644 --- a/core/src/main/java/org/springframework/security/config/LdapServerBeanDefinitionParser.java +++ b/core/src/main/java/org/springframework/security/config/LdapServerBeanDefinitionParser.java @@ -148,7 +148,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser { contextSource.addPropertyValue("userDn", "uid=admin,ou=system"); contextSource.addPropertyValue("password", "secret"); - RootBeanDefinition apacheContainer = new RootBeanDefinition("org.springframework.security.config.ApacheDSContainer", null, null); + RootBeanDefinition apacheContainer = new RootBeanDefinition("org.springframework.security.config.ldap.ApacheDSContainer", null, null); apacheContainer.setSource(source); apacheContainer.getConstructorArgumentValues().addGenericArgumentValue(configuration.getBeanDefinition()); apacheContainer.getConstructorArgumentValues().addGenericArgumentValue(contextSource.getBeanDefinition()); diff --git a/core/src/main/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParser.java b/core/src/main/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParser.java index a5443fab4a..916af868f9 100644 --- a/core/src/main/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParser.java +++ b/core/src/main/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParser.java @@ -2,7 +2,9 @@ package org.springframework.security.config; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.util.StringUtils; @@ -88,11 +90,25 @@ public class LdapUserServiceBeanDefinitionParser extends AbstractUserDetailsServ RuntimeBeanReference contextSource = new RuntimeBeanReference(server); contextSource.setSource(parserContext.extractSource(elt)); - LdapConfigUtils.registerPostProcessorIfNecessary(parserContext.getRegistry(), requiresDefaultName); + registerPostProcessorIfNecessary(parserContext.getRegistry(), requiresDefaultName); return contextSource; } + private static void registerPostProcessorIfNecessary(BeanDefinitionRegistry registry, boolean defaultNameRequired) { + if (registry.containsBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR)) { + if (defaultNameRequired) { + BeanDefinition bd = registry.getBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR); + bd.getPropertyValues().addPropertyValue("defaultNameRequired", Boolean.valueOf(defaultNameRequired)); + } + return; + } + + BeanDefinitionBuilder bdb = BeanDefinitionBuilder.rootBeanDefinition("org.springframework.security.config.ldap.ContextSourceSettingPostProcessor"); + bdb.addPropertyValue("defaultNameRequired", Boolean.valueOf(defaultNameRequired)); + registry.registerBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR, bdb.getBeanDefinition()); + } + static RootBeanDefinition parseUserDetailsClass(Element elt, ParserContext parserContext) { String userDetailsClass = elt.getAttribute(ATT_USER_CLASS); diff --git a/core/src/main/java/org/springframework/security/config/PasswordEncoderParser.java b/core/src/main/java/org/springframework/security/config/PasswordEncoderParser.java index 8f48110345..0e472e2ba1 100644 --- a/core/src/main/java/org/springframework/security/config/PasswordEncoderParser.java +++ b/core/src/main/java/org/springframework/security/config/PasswordEncoderParser.java @@ -6,16 +6,18 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeanMetadataElement; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.security.providers.encoding.BaseDigestPasswordEncoder; +import org.springframework.security.providers.encoding.LdapShaPasswordEncoder; import org.springframework.security.providers.encoding.Md4PasswordEncoder; import org.springframework.security.providers.encoding.Md5PasswordEncoder; import org.springframework.security.providers.encoding.PasswordEncoder; import org.springframework.security.providers.encoding.PlaintextPasswordEncoder; import org.springframework.security.providers.encoding.ShaPasswordEncoder; -import org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; @@ -39,10 +41,10 @@ class PasswordEncoderParser { static final String OPT_HASH_MD5 = "md5"; static final String OPT_HASH_LDAP_SHA = "{sha}"; - static final Map> ENCODER_CLASSES; + private static final Map> ENCODER_CLASSES; static { - ENCODER_CLASSES = new HashMap>(6); + ENCODER_CLASSES = new HashMap>(); ENCODER_CLASSES.put(OPT_HASH_PLAINTEXT, PlaintextPasswordEncoder.class); ENCODER_CLASSES.put(OPT_HASH_SHA, ShaPasswordEncoder.class); ENCODER_CLASSES.put(OPT_HASH_SHA256, ShaPasswordEncoder.class); @@ -51,7 +53,7 @@ class PasswordEncoderParser { ENCODER_CLASSES.put(OPT_HASH_LDAP_SHA, LdapShaPasswordEncoder.class); } - private Log logger = LogFactory.getLog(getClass()); + private static Log logger = LogFactory.getLog(PasswordEncoderParser.class); private BeanMetadataElement passwordEncoder; private BeanMetadataElement saltSource; @@ -73,22 +75,8 @@ class PasswordEncoderParser { if (StringUtils.hasText(ref)) { passwordEncoder = new RuntimeBeanReference(ref); } else { - Class beanClass = ENCODER_CLASSES.get(hash); - RootBeanDefinition beanDefinition = new RootBeanDefinition(beanClass); - - if (OPT_HASH_SHA256.equals(hash)) { - beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, new Integer(256)); - } - - beanDefinition.setSource(parserContext.extractSource(element)); - if (useBase64) { - if (BaseDigestPasswordEncoder.class.isAssignableFrom(beanClass)) { - beanDefinition.getPropertyValues().addPropertyValue("encodeHashAsBase64", "true"); - } else { - logger.warn(ATT_BASE_64 + " isn't compatible with " + hash + " and will be ignored"); - } - } - passwordEncoder = beanDefinition; + passwordEncoder = createPasswordEncoderBeanDefinition(hash, useBase64); + ((RootBeanDefinition)passwordEncoder).setSource(parserContext.extractSource(element)); } Element saltSourceElt = DomUtils.getChildElementByTagName(element, Elements.SALT_SOURCE); @@ -98,6 +86,24 @@ class PasswordEncoderParser { } } + static BeanDefinition createPasswordEncoderBeanDefinition(String hash, boolean useBase64) { + Class beanClass = ENCODER_CLASSES.get(hash); + BeanDefinitionBuilder beanBldr = BeanDefinitionBuilder.rootBeanDefinition(beanClass); + + if (OPT_HASH_SHA256.equals(hash)) { + beanBldr.addConstructorArgValue(new Integer(256)); + } + + if (useBase64) { + if (BaseDigestPasswordEncoder.class.isAssignableFrom(beanClass)) { + beanBldr.addPropertyValue("encodeHashAsBase64", "true"); + } else { + logger.warn(ATT_BASE_64 + " isn't compatible with " + hash + " and will be ignored"); + } + } + return beanBldr.getBeanDefinition(); + } + public BeanMetadataElement getPasswordEncoder() { return passwordEncoder; } diff --git a/core/src/main/java/org/springframework/security/ldap/LdapCallback.java b/core/src/main/java/org/springframework/security/ldap/LdapCallback.java deleted file mode 100644 index d52fa2df66..0000000000 --- a/core/src/main/java/org/springframework/security/ldap/LdapCallback.java +++ /dev/null @@ -1,35 +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 javax.naming.NamingException; -import javax.naming.directory.DirContext; - - -/** - * Callback object for use with SpringSecurityLdapTemplate. - * - * @deprecated use spring-ldap ContextExecutor instead. - * @TODO: Delete before 2.0 release - * - * @author Ben Alex - */ -public interface LdapCallback { - //~ Methods ======================================================================================================== - - Object doInDirContext(DirContext dirContext) - throws NamingException; -} diff --git a/core/src/main/java/org/springframework/security/ldap/LdapEntryMapper.java b/core/src/main/java/org/springframework/security/ldap/LdapEntryMapper.java deleted file mode 100644 index 6ba6924543..0000000000 --- a/core/src/main/java/org/springframework/security/ldap/LdapEntryMapper.java +++ /dev/null @@ -1,35 +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 javax.naming.NamingException; -import javax.naming.directory.Attributes; - - -/** - * A mapper for use with {@link SpringSecurityLdapTemplate}. Creates a customized object from - * a set of attributes retrieved from a directory entry. - * - * @author Luke Taylor - * @deprecated in favour of Spring LDAP ContextMapper - * @version $Id$ - */ -public interface LdapEntryMapper { - //~ Methods ======================================================================================================== - - Object mapAttributes(String dn, Attributes attributes) - throws NamingException; -} diff --git a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoder.java b/core/src/main/java/org/springframework/security/providers/encoding/LdapShaPasswordEncoder.java similarity index 96% rename from core/src/main/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoder.java rename to core/src/main/java/org/springframework/security/providers/encoding/LdapShaPasswordEncoder.java index d8dfd0d2c9..f565254027 100644 --- a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoder.java +++ b/core/src/main/java/org/springframework/security/providers/encoding/LdapShaPasswordEncoder.java @@ -13,10 +13,8 @@ * limitations under the License. */ -package org.springframework.security.providers.ldap.authenticator; +package org.springframework.security.providers.encoding; -import org.springframework.security.providers.encoding.PasswordEncoder; -import org.springframework.security.providers.encoding.ShaPasswordEncoder; import org.apache.commons.codec.binary.Base64; diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties index a6fd809a78..1105fbba99 100644 --- a/core/src/test/resources/log4j.properties +++ b/core/src/test/resources/log4j.properties @@ -9,6 +9,3 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%p %c{1} - %m%n log4j.logger.org.springframework.security=DEBUG -log4j.logger.org.springframework.ldap=DEBUG - -log4j.logger.org.apache.directory=ERROR diff --git a/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java b/ldap/src/main/java/org/springframework/security/config/ldap/ApacheDSContainer.java similarity index 98% rename from core/src/main/java/org/springframework/security/config/ApacheDSContainer.java rename to ldap/src/main/java/org/springframework/security/config/ldap/ApacheDSContainer.java index b307551a2f..dd133079f5 100644 --- a/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java +++ b/ldap/src/main/java/org/springframework/security/config/ldap/ApacheDSContainer.java @@ -1,4 +1,4 @@ -package org.springframework.security.config; +package org.springframework.security.config.ldap; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.DisposableBean; @@ -8,6 +8,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.Lifecycle; import org.springframework.core.io.Resource; import org.springframework.ldap.core.ContextSource; +import org.springframework.security.config.LdapServerBeanDefinitionParser; import org.springframework.util.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/core/src/main/java/org/springframework/security/ldap/DefaultLdapUsernameToDnMapper.java b/ldap/src/main/java/org/springframework/security/ldap/DefaultLdapUsernameToDnMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/DefaultLdapUsernameToDnMapper.java rename to ldap/src/main/java/org/springframework/security/ldap/DefaultLdapUsernameToDnMapper.java diff --git a/core/src/main/java/org/springframework/security/ldap/DefaultSpringSecurityContextSource.java b/ldap/src/main/java/org/springframework/security/ldap/DefaultSpringSecurityContextSource.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/DefaultSpringSecurityContextSource.java rename to ldap/src/main/java/org/springframework/security/ldap/DefaultSpringSecurityContextSource.java diff --git a/core/src/main/java/org/springframework/security/ldap/LdapAuthoritiesPopulator.java b/ldap/src/main/java/org/springframework/security/ldap/LdapAuthoritiesPopulator.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/LdapAuthoritiesPopulator.java rename to ldap/src/main/java/org/springframework/security/ldap/LdapAuthoritiesPopulator.java diff --git a/core/src/main/java/org/springframework/security/ldap/LdapUserSearch.java b/ldap/src/main/java/org/springframework/security/ldap/LdapUserSearch.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/LdapUserSearch.java rename to ldap/src/main/java/org/springframework/security/ldap/LdapUserSearch.java diff --git a/core/src/main/java/org/springframework/security/ldap/LdapUsernameToDnMapper.java b/ldap/src/main/java/org/springframework/security/ldap/LdapUsernameToDnMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/LdapUsernameToDnMapper.java rename to ldap/src/main/java/org/springframework/security/ldap/LdapUsernameToDnMapper.java diff --git a/core/src/main/java/org/springframework/security/ldap/LdapUtils.java b/ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/LdapUtils.java rename to ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java diff --git a/core/src/main/java/org/springframework/security/ldap/NamingExceptionTranslator.java b/ldap/src/main/java/org/springframework/security/ldap/NamingExceptionTranslator.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/NamingExceptionTranslator.java rename to ldap/src/main/java/org/springframework/security/ldap/NamingExceptionTranslator.java diff --git a/core/src/main/java/org/springframework/security/ldap/SpringSecurityAuthenticationSource.java b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityAuthenticationSource.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/SpringSecurityAuthenticationSource.java rename to ldap/src/main/java/org/springframework/security/ldap/SpringSecurityAuthenticationSource.java diff --git a/core/src/main/java/org/springframework/security/ldap/SpringSecurityContextSource.java b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityContextSource.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/SpringSecurityContextSource.java rename to ldap/src/main/java/org/springframework/security/ldap/SpringSecurityContextSource.java diff --git a/core/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java rename to ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java diff --git a/core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java b/ldap/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java rename to ldap/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java diff --git a/core/src/main/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulator.java b/ldap/src/main/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulator.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulator.java rename to ldap/src/main/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulator.java diff --git a/core/src/main/java/org/springframework/security/ldap/populator/package.html b/ldap/src/main/java/org/springframework/security/ldap/populator/package.html similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/populator/package.html rename to ldap/src/main/java/org/springframework/security/ldap/populator/package.html diff --git a/core/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java b/ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java rename to ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java diff --git a/core/src/main/java/org/springframework/security/ldap/search/package.html b/ldap/src/main/java/org/springframework/security/ldap/search/package.html similarity index 100% rename from core/src/main/java/org/springframework/security/ldap/search/package.html rename to ldap/src/main/java/org/springframework/security/ldap/search/package.html diff --git a/core/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticationProvider.java b/ldap/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticationProvider.java similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticationProvider.java rename to ldap/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticationProvider.java diff --git a/core/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticator.java b/ldap/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticator.java similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticator.java rename to ldap/src/main/java/org/springframework/security/providers/ldap/LdapAuthenticator.java diff --git a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/AbstractLdapAuthenticator.java b/ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/AbstractLdapAuthenticator.java similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/authenticator/AbstractLdapAuthenticator.java rename to ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/AbstractLdapAuthenticator.java diff --git a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java b/ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java rename to ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java diff --git a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java b/ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java similarity index 98% rename from core/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java rename to ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java index 3687fa0f51..b5f3a60faf 100644 --- a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java +++ b/ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticator.java @@ -25,6 +25,7 @@ import org.springframework.security.BadCredentialsException; import org.springframework.security.ldap.LdapUtils; import org.springframework.security.ldap.SpringSecurityLdapTemplate; import org.springframework.security.providers.UsernamePasswordAuthenticationToken; +import org.springframework.security.providers.encoding.LdapShaPasswordEncoder; import org.springframework.security.providers.encoding.PasswordEncoder; import org.springframework.security.userdetails.UsernameNotFoundException; import org.springframework.util.Assert; diff --git a/core/src/main/java/org/springframework/security/providers/ldap/authenticator/package.html b/ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/package.html similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/authenticator/package.html rename to ldap/src/main/java/org/springframework/security/providers/ldap/authenticator/package.html diff --git a/core/src/main/java/org/springframework/security/providers/ldap/package.html b/ldap/src/main/java/org/springframework/security/providers/ldap/package.html similarity index 100% rename from core/src/main/java/org/springframework/security/providers/ldap/package.html rename to ldap/src/main/java/org/springframework/security/providers/ldap/package.html diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPerson.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPerson.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPerson.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPerson.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPersonContextMapper.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPersonContextMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPersonContextMapper.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/InetOrgPersonContextMapper.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManager.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManager.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManager.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManager.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapper.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapper.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapper.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsService.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsService.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsService.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsService.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/Person.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/Person.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/Person.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/Person.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/PersonContextMapper.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/PersonContextMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/PersonContextMapper.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/PersonContextMapper.java diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/UserDetailsContextMapper.java b/ldap/src/main/java/org/springframework/security/userdetails/ldap/UserDetailsContextMapper.java similarity index 100% rename from core/src/main/java/org/springframework/security/userdetails/ldap/UserDetailsContextMapper.java rename to ldap/src/main/java/org/springframework/security/userdetails/ldap/UserDetailsContextMapper.java diff --git a/core/src/test/java/org/springframework/security/config/LdapProviderBeanDefinitionParserTests.java b/ldap/src/test/java/org/springframework/security/LdapProviderBeanDefinitionParserTests.java similarity index 96% rename from core/src/test/java/org/springframework/security/config/LdapProviderBeanDefinitionParserTests.java rename to ldap/src/test/java/org/springframework/security/LdapProviderBeanDefinitionParserTests.java index a5cf801472..4ab4c0d40d 100644 --- a/core/src/test/java/org/springframework/security/config/LdapProviderBeanDefinitionParserTests.java +++ b/ldap/src/test/java/org/springframework/security/LdapProviderBeanDefinitionParserTests.java @@ -1,4 +1,4 @@ -package org.springframework.security.config; +package org.springframework.security; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -6,6 +6,8 @@ import static org.junit.Assert.assertTrue; import org.junit.After; import org.junit.Test; import org.springframework.security.Authentication; +import org.springframework.security.config.BeanIds; +import org.springframework.security.config.SecurityConfigurationException; import org.springframework.security.providers.ProviderManager; import org.springframework.security.providers.UsernamePasswordAuthenticationToken; import org.springframework.security.providers.ldap.LdapAuthenticationProvider; diff --git a/core/src/test/java/org/springframework/security/config/LdapServerBeanDefinitionParserTests.java b/ldap/src/test/java/org/springframework/security/LdapServerBeanDefinitionParserTests.java similarity index 96% rename from core/src/test/java/org/springframework/security/config/LdapServerBeanDefinitionParserTests.java rename to ldap/src/test/java/org/springframework/security/LdapServerBeanDefinitionParserTests.java index 9b8ca7a416..e64ca52885 100644 --- a/core/src/test/java/org/springframework/security/config/LdapServerBeanDefinitionParserTests.java +++ b/ldap/src/test/java/org/springframework/security/LdapServerBeanDefinitionParserTests.java @@ -1,8 +1,9 @@ -package org.springframework.security.config; +package org.springframework.security; import org.junit.After; import org.junit.Test; import org.springframework.ldap.core.LdapTemplate; +import org.springframework.security.config.BeanIds; import org.springframework.security.ldap.DefaultSpringSecurityContextSource; import org.springframework.security.util.InMemoryXmlApplicationContext; diff --git a/core/src/test/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParserTests.java b/ldap/src/test/java/org/springframework/security/LdapUserServiceBeanDefinitionParserTests.java similarity index 99% rename from core/src/test/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParserTests.java rename to ldap/src/test/java/org/springframework/security/LdapUserServiceBeanDefinitionParserTests.java index 401771ca83..8f17a84fdf 100644 --- a/core/src/test/java/org/springframework/security/config/LdapUserServiceBeanDefinitionParserTests.java +++ b/ldap/src/test/java/org/springframework/security/LdapUserServiceBeanDefinitionParserTests.java @@ -1,4 +1,4 @@ -package org.springframework.security.config; +package org.springframework.security; import java.util.Set; diff --git a/core/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java b/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java rename to ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java b/ldap/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java rename to ldap/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/LdapUtilsTests.java b/ldap/src/test/java/org/springframework/security/ldap/LdapUtilsTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/LdapUtilsTests.java rename to ldap/src/test/java/org/springframework/security/ldap/LdapUtilsTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/SpringSecurityAuthenticationSourceTests.java b/ldap/src/test/java/org/springframework/security/ldap/SpringSecurityAuthenticationSourceTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/SpringSecurityAuthenticationSourceTests.java rename to ldap/src/test/java/org/springframework/security/ldap/SpringSecurityAuthenticationSourceTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java b/ldap/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java rename to ldap/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulatorTests.java b/ldap/src/test/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulatorTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulatorTests.java rename to ldap/src/test/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulatorTests.java diff --git a/core/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java b/ldap/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java similarity index 60% rename from core/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java rename to ldap/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java index 5cafae7e4b..8f098716f1 100644 --- a/core/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java +++ b/ldap/src/test/java/org/springframework/security/ldap/populator/UserDetailsServiceLdapAuthoritiesPopulatorTests.java @@ -1,28 +1,32 @@ package org.springframework.security.ldap.populator; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.*; + import java.util.List; -import org.springframework.security.userdetails.UserDetailsService; -import org.springframework.security.userdetails.MockUserDetailsService; -import org.springframework.security.GrantedAuthority; - -import org.springframework.ldap.core.DirContextAdapter; - import org.junit.Test; -import static org.junit.Assert.*; +import org.springframework.ldap.core.DirContextAdapter; +import org.springframework.security.GrantedAuthority; +import org.springframework.security.userdetails.UserDetails; +import org.springframework.security.userdetails.UserDetailsService; +import org.springframework.security.util.AuthorityUtils; /** * @author Luke Taylor * @version $Id$ */ public class UserDetailsServiceLdapAuthoritiesPopulatorTests { - UserDetailsService uds = new MockUserDetailsService(); @Test public void delegationToUserDetailsServiceReturnsCorrectRoles() throws Exception { - UserDetailsServiceLdapAuthoritiesPopulator populator = new UserDetailsServiceLdapAuthoritiesPopulator(uds); + UserDetailsService uds = mock(UserDetailsService.class); + UserDetails user = mock(UserDetails.class); + when(uds.loadUserByUsername("joe")).thenReturn(user); + when(user.getAuthorities()).thenReturn(AuthorityUtils.createAuthorityList("ROLE_USER")); - List auths = populator.getGrantedAuthorities(new DirContextAdapter(), "valid"); + UserDetailsServiceLdapAuthoritiesPopulator populator = new UserDetailsServiceLdapAuthoritiesPopulator(uds); + List auths = populator.getGrantedAuthorities(new DirContextAdapter(), "joe"); assertEquals(1, auths.size()); assertEquals("ROLE_USER", auths.get(0).getAuthority()); diff --git a/core/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java b/ldap/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java rename to ldap/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java diff --git a/core/src/test/java/org/springframework/security/providers/ldap/LdapAuthenticationProviderTests.java b/ldap/src/test/java/org/springframework/security/providers/ldap/LdapAuthenticationProviderTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/providers/ldap/LdapAuthenticationProviderTests.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/LdapAuthenticationProviderTests.java diff --git a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticatorTests.java b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticatorTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticatorTests.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/BindAuthenticatorTests.java diff --git a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java similarity index 98% rename from core/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java index 216e169bb1..402d443644 100644 --- a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java +++ b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/LdapShaPasswordEncoderTests.java @@ -19,6 +19,7 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; +import org.springframework.security.providers.encoding.LdapShaPasswordEncoder; /** diff --git a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/MockUserSearch.java b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/MockUserSearch.java similarity index 100% rename from core/src/test/java/org/springframework/security/providers/ldap/authenticator/MockUserSearch.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/MockUserSearch.java diff --git a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorMockTests.java b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorMockTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorMockTests.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorMockTests.java diff --git a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java similarity index 98% rename from core/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java rename to ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java index 33ee2fd63e..10b6e43913 100644 --- a/core/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java +++ b/ldap/src/test/java/org/springframework/security/providers/ldap/authenticator/PasswordComparisonAuthenticatorTests.java @@ -20,6 +20,7 @@ import org.springframework.security.Authentication; import org.springframework.security.ldap.AbstractLdapIntegrationTests; +import org.springframework.security.providers.encoding.LdapShaPasswordEncoder; import org.springframework.security.providers.encoding.PlaintextPasswordEncoder; import org.springframework.security.providers.UsernamePasswordAuthenticationToken; diff --git a/core/src/test/java/org/springframework/security/userdetails/ldap/InetOrgPersonTests.java b/ldap/src/test/java/org/springframework/security/userdetails/ldap/InetOrgPersonTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/userdetails/ldap/InetOrgPersonTests.java rename to ldap/src/test/java/org/springframework/security/userdetails/ldap/InetOrgPersonTests.java diff --git a/core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManagerTests.java b/ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManagerTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManagerTests.java rename to ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsManagerTests.java diff --git a/core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapperTests.java b/ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapperTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapperTests.java rename to ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapperTests.java diff --git a/core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsServiceTests.java b/ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsServiceTests.java similarity index 100% rename from core/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsServiceTests.java rename to ldap/src/test/java/org/springframework/security/userdetails/ldap/LdapUserDetailsServiceTests.java diff --git a/ldap/src/test/resources/log4j.properties b/ldap/src/test/resources/log4j.properties new file mode 100644 index 0000000000..63f39ae846 --- /dev/null +++ b/ldap/src/test/resources/log4j.properties @@ -0,0 +1,14 @@ +# Logging +# +# $Id: log4j.properties 3455 2008-12-11 17:00:13Z ltaylor $ + +log4j.rootLogger=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%p %c{1} - %m%n + +log4j.logger.org.springframework.security=DEBUG +log4j.logger.org.springframework.ldap=DEBUG + +log4j.logger.org.apache.directory=ERROR diff --git a/core/src/test/resources/test-server.ldif b/ldap/src/test/resources/test-server.ldif similarity index 100% rename from core/src/test/resources/test-server.ldif rename to ldap/src/test/resources/test-server.ldif diff --git a/core/src/test/resources/test-server2.xldif b/ldap/src/test/resources/test-server2.xldif similarity index 100% rename from core/src/test/resources/test-server2.xldif rename to ldap/src/test/resources/test-server2.xldif diff --git a/ntlm/pom.xml b/ntlm/pom.xml index 720054b196..f18b8fbd2c 100755 --- a/ntlm/pom.xml +++ b/ntlm/pom.xml @@ -15,6 +15,11 @@ spring-security-core ${project.version} + + org.springframework.security + spring-security-ldap + ${project.version} + org.samba.jcifs diff --git a/pom.xml b/pom.xml index 6104dffb07..94fe87a9b9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,14 +9,15 @@ core - - ntlm - openid - samples + ldap cas + openid acl + ntlm + samples taglibs itest + Spring Security @@ -292,6 +293,11 @@ 4.5 test + + org.mockito + mockito-core + 1.7 + diff --git a/samples/ldap/pom.xml b/samples/ldap/pom.xml index c43e98a8a0..42bfb85074 100644 --- a/samples/ldap/pom.xml +++ b/samples/ldap/pom.xml @@ -12,7 +12,7 @@ org.springframework.security - spring-security-core + spring-security-ldap ${project.version} @@ -24,11 +24,13 @@ org.springframework.web.servlet ${spring.version} + org.springframework org.springframework.aop @@ -38,13 +40,13 @@ org.apache.directory.server apacheds-core 1.0.2 - compile + runtime org.apache.directory.server apacheds-server-jndi 1.0.2 - compile + runtime org.slf4j @@ -52,11 +54,6 @@ 1.4.3 runtime - - org.springframework.ldap - spring-ldap-core - runtime -