From e398922f85ff0deeb91f4372860aae8fd59371e0 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Thu, 8 Oct 2009 14:40:52 +0000 Subject: [PATCH] Removing elements that are no longer supported from the namespace --- .../security/config/Elements.java | 4 --- .../config/SecurityNamespaceHandler.java | 4 --- ...cationProviderBeanDefinitionDecorator.java | 26 ------------------- ...cationProviderBeanDefinitionDecorator.java | 26 ------------------- .../security/config/spring-security-3.0.rnc | 4 --- .../security/config/spring-security-3.0.xsd | 3 --- ...nProviderBeanDefinitionDecoratorTests.java | 20 -------------- ...nProviderBeanDefinitionDecoratorTests.java | 26 ------------------- 8 files changed, 113 deletions(-) delete mode 100644 config/src/main/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecorator.java delete mode 100644 config/src/main/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecorator.java delete mode 100644 config/src/test/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java delete mode 100644 config/src/test/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecoratorTests.java diff --git a/config/src/main/java/org/springframework/security/config/Elements.java b/config/src/main/java/org/springframework/security/config/Elements.java index 64b5a49223..5be9194197 100644 --- a/config/src/main/java/org/springframework/security/config/Elements.java +++ b/config/src/main/java/org/springframework/security/config/Elements.java @@ -46,10 +46,6 @@ public abstract class Elements { public static final String PORT_MAPPING = "port-mapping"; public static final String CUSTOM_FILTER = "custom-filter"; public static final String REQUEST_CACHE = "request-cache"; - @Deprecated - public static final String CUSTOM_AUTH_PROVIDER = "custom-authentication-provider"; - @Deprecated - public static final String CUSTOM_AFTER_INVOCATION_PROVIDER = "custom-after-invocation-provider"; public static final String X509 = "x509"; public static final String FILTER_SECURITY_METADATA_SOURCE = "filter-security-metadata-source"; @Deprecated diff --git a/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java b/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java index c083f449fb..234fc32b9d 100644 --- a/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java +++ b/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java @@ -3,7 +3,6 @@ package org.springframework.security.config; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; import org.springframework.security.config.authentication.AuthenticationManagerBeanDefinitionParser; import org.springframework.security.config.authentication.AuthenticationProviderBeanDefinitionParser; -import org.springframework.security.config.authentication.CustomAuthenticationProviderBeanDefinitionDecorator; import org.springframework.security.config.authentication.JdbcUserServiceBeanDefinitionParser; import org.springframework.security.config.authentication.UserServiceBeanDefinitionParser; import org.springframework.security.config.http.CustomFilterBeanDefinitionDecorator; @@ -13,7 +12,6 @@ import org.springframework.security.config.http.HttpSecurityBeanDefinitionParser import org.springframework.security.config.ldap.LdapProviderBeanDefinitionParser; import org.springframework.security.config.ldap.LdapServerBeanDefinitionParser; import org.springframework.security.config.ldap.LdapUserServiceBeanDefinitionParser; -import org.springframework.security.config.method.CustomAfterInvocationProviderBeanDefinitionDecorator; import org.springframework.security.config.method.GlobalMethodSecurityBeanDefinitionParser; import org.springframework.security.config.method.InterceptMethodsBeanDefinitionDecorator; @@ -46,7 +44,5 @@ public class SecurityNamespaceHandler extends NamespaceHandlerSupport { registerBeanDefinitionDecorator(Elements.INTERCEPT_METHODS, new InterceptMethodsBeanDefinitionDecorator()); registerBeanDefinitionDecorator(Elements.FILTER_CHAIN_MAP, new FilterChainMapBeanDefinitionDecorator()); registerBeanDefinitionDecorator(Elements.CUSTOM_FILTER, new CustomFilterBeanDefinitionDecorator()); - registerBeanDefinitionDecorator(Elements.CUSTOM_AUTH_PROVIDER, new CustomAuthenticationProviderBeanDefinitionDecorator()); - registerBeanDefinitionDecorator(Elements.CUSTOM_AFTER_INVOCATION_PROVIDER, new CustomAfterInvocationProviderBeanDefinitionDecorator()); } } diff --git a/config/src/main/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecorator.java b/config/src/main/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecorator.java deleted file mode 100644 index 9a94b6ac4a..0000000000 --- a/config/src/main/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecorator.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.springframework.security.config.authentication; - -import org.springframework.beans.factory.config.BeanDefinitionHolder; -import org.springframework.beans.factory.xml.BeanDefinitionDecorator; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.security.config.Elements; -import org.w3c.dom.Node; - -/** - * Adds the decorated {@link org.springframework.security.authentication.AuthenticationProvider} to the ProviderManager's - * list. - * - * @author Luke Taylor - * @version $Id$ - */ -public class CustomAuthenticationProviderBeanDefinitionDecorator implements BeanDefinitionDecorator { - @SuppressWarnings("deprecation") - public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder holder, ParserContext parserContext) { - //ConfigUtils.addAuthenticationProvider(parserContext, holder.getBeanName(), (Element) node); - parserContext.getReaderContext().warning(Elements.CUSTOM_AUTH_PROVIDER + " is deprecated in " + - "Spring Security 3.0 and has no effect. Authentication providers should be declared within" + - " the element", parserContext.extractSource(node)); - - return holder; - } -} diff --git a/config/src/main/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecorator.java b/config/src/main/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecorator.java deleted file mode 100644 index 0111427208..0000000000 --- a/config/src/main/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecorator.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.springframework.security.config.method; - -import org.springframework.beans.factory.config.BeanDefinitionHolder; -import org.springframework.beans.factory.xml.BeanDefinitionDecorator; -import org.springframework.beans.factory.xml.ParserContext; -import org.w3c.dom.Node; - -/** - * Adds the decorated {@link org.springframework.security.access.AfterInvocationProvider} to the - * AfterInvocationProviderManager's list. - * - * @author Luke Taylor - * @version $Id$ - * @since 2.0 - */ -public class CustomAfterInvocationProviderBeanDefinitionDecorator implements BeanDefinitionDecorator { - - public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder holder, ParserContext parserContext) { - parserContext.getReaderContext().warning("In Spring Security 3.0, this element is not supported and" + - " has no effect", parserContext.extractSource(node)); -// MethodConfigUtils.getRegisteredAfterInvocationProviders(parserContext).add(holder.getBeanDefinition()); - - return holder; - } - -} diff --git a/config/src/main/resources/org/springframework/security/config/spring-security-3.0.rnc b/config/src/main/resources/org/springframework/security/config/spring-security-3.0.rnc index b9eb7bfc78..adf379f1ef 100644 --- a/config/src/main/resources/org/springframework/security/config/spring-security-3.0.rnc +++ b/config/src/main/resources/org/springframework/security/config/spring-security-3.0.rnc @@ -230,10 +230,6 @@ expression-handler = ## Defines the SecurityExpressionHandler instance which will be used if expression-based access-control is enabled. A default implementation (with no ACL support) will be used if not supplied. element expression-handler {ref} -custom-after-invocation-provider = - ## No longer supported. Use after-invocation-provider instead. - element custom-after-invocation-provider {empty} - protect-pointcut = ## Defines a protected pointcut and the access control configuration attributes that apply to it. Every bean registered in the Spring application context that provides a method that matches the pointcut will receive security authorization. element protect-pointcut {protect-pointcut.attlist, empty} diff --git a/config/src/main/resources/org/springframework/security/config/spring-security-3.0.xsd b/config/src/main/resources/org/springframework/security/config/spring-security-3.0.xsd index cd29869139..75bb778cb7 100644 --- a/config/src/main/resources/org/springframework/security/config/spring-security-3.0.xsd +++ b/config/src/main/resources/org/springframework/security/config/spring-security-3.0.xsd @@ -545,9 +545,6 @@ - - No longer supported. Use after-invocation-provider instead. - diff --git a/config/src/test/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java b/config/src/test/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java deleted file mode 100644 index 86dabac1c3..0000000000 --- a/config/src/test/java/org/springframework/security/config/authentication/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.springframework.security.config.authentication; - -import org.junit.Test; -import org.springframework.security.config.util.InMemoryXmlApplicationContext; - - -public class CustomAuthenticationProviderBeanDefinitionDecoratorTests { - - @Test - public void decoratedProviderParsesSuccessfullyWith20Namespace() { - new InMemoryXmlApplicationContext( - "" + - " " + - " " + - "" + - "" + - " " + - "", "2.0.4", null); - } -} diff --git a/config/src/test/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecoratorTests.java b/config/src/test/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecoratorTests.java deleted file mode 100644 index 43948b2f15..0000000000 --- a/config/src/test/java/org/springframework/security/config/method/CustomAfterInvocationProviderBeanDefinitionDecoratorTests.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.springframework.security.config.method; - -import org.junit.After; -import org.junit.Test; -import org.springframework.context.support.AbstractXmlApplicationContext; -import org.springframework.security.config.util.InMemoryXmlApplicationContext; - -public class CustomAfterInvocationProviderBeanDefinitionDecoratorTests { - private AbstractXmlApplicationContext appContext; - - @After - public void closeAppContext() { - if (appContext != null) { - appContext.close(); - appContext = null; - } - } - - @Test - public void customAfterInvocationProviderIsSupportedIn20Schema() { - appContext = new InMemoryXmlApplicationContext( - "" + - " " + - "", "2.0.4", null); - } -}