mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 17:22:13 +00:00
Removing elements that are no longer supported from the namespace
This commit is contained in:
parent
7f658f7a53
commit
e398922f85
@ -46,10 +46,6 @@ public abstract class Elements {
|
|||||||
public static final String PORT_MAPPING = "port-mapping";
|
public static final String PORT_MAPPING = "port-mapping";
|
||||||
public static final String CUSTOM_FILTER = "custom-filter";
|
public static final String CUSTOM_FILTER = "custom-filter";
|
||||||
public static final String REQUEST_CACHE = "request-cache";
|
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 X509 = "x509";
|
||||||
public static final String FILTER_SECURITY_METADATA_SOURCE = "filter-security-metadata-source";
|
public static final String FILTER_SECURITY_METADATA_SOURCE = "filter-security-metadata-source";
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -3,7 +3,6 @@ package org.springframework.security.config;
|
|||||||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||||
import org.springframework.security.config.authentication.AuthenticationManagerBeanDefinitionParser;
|
import org.springframework.security.config.authentication.AuthenticationManagerBeanDefinitionParser;
|
||||||
import org.springframework.security.config.authentication.AuthenticationProviderBeanDefinitionParser;
|
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.JdbcUserServiceBeanDefinitionParser;
|
||||||
import org.springframework.security.config.authentication.UserServiceBeanDefinitionParser;
|
import org.springframework.security.config.authentication.UserServiceBeanDefinitionParser;
|
||||||
import org.springframework.security.config.http.CustomFilterBeanDefinitionDecorator;
|
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.LdapProviderBeanDefinitionParser;
|
||||||
import org.springframework.security.config.ldap.LdapServerBeanDefinitionParser;
|
import org.springframework.security.config.ldap.LdapServerBeanDefinitionParser;
|
||||||
import org.springframework.security.config.ldap.LdapUserServiceBeanDefinitionParser;
|
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.GlobalMethodSecurityBeanDefinitionParser;
|
||||||
import org.springframework.security.config.method.InterceptMethodsBeanDefinitionDecorator;
|
import org.springframework.security.config.method.InterceptMethodsBeanDefinitionDecorator;
|
||||||
|
|
||||||
@ -46,7 +44,5 @@ public class SecurityNamespaceHandler extends NamespaceHandlerSupport {
|
|||||||
registerBeanDefinitionDecorator(Elements.INTERCEPT_METHODS, new InterceptMethodsBeanDefinitionDecorator());
|
registerBeanDefinitionDecorator(Elements.INTERCEPT_METHODS, new InterceptMethodsBeanDefinitionDecorator());
|
||||||
registerBeanDefinitionDecorator(Elements.FILTER_CHAIN_MAP, new FilterChainMapBeanDefinitionDecorator());
|
registerBeanDefinitionDecorator(Elements.FILTER_CHAIN_MAP, new FilterChainMapBeanDefinitionDecorator());
|
||||||
registerBeanDefinitionDecorator(Elements.CUSTOM_FILTER, new CustomFilterBeanDefinitionDecorator());
|
registerBeanDefinitionDecorator(Elements.CUSTOM_FILTER, new CustomFilterBeanDefinitionDecorator());
|
||||||
registerBeanDefinitionDecorator(Elements.CUSTOM_AUTH_PROVIDER, new CustomAuthenticationProviderBeanDefinitionDecorator());
|
|
||||||
registerBeanDefinitionDecorator(Elements.CUSTOM_AFTER_INVOCATION_PROVIDER, new CustomAfterInvocationProviderBeanDefinitionDecorator());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 <authentication-provider> element", parserContext.extractSource(node));
|
|
||||||
|
|
||||||
return holder;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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.
|
## 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}
|
element expression-handler {ref}
|
||||||
|
|
||||||
custom-after-invocation-provider =
|
|
||||||
## No longer supported. Use after-invocation-provider instead.
|
|
||||||
element custom-after-invocation-provider {empty}
|
|
||||||
|
|
||||||
protect-pointcut =
|
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.
|
## 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}
|
element protect-pointcut {protect-pointcut.attlist, empty}
|
||||||
|
@ -545,9 +545,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<xs:element name="custom-after-invocation-provider"><xs:annotation>
|
|
||||||
<xs:documentation>No longer supported. Use after-invocation-provider instead.</xs:documentation>
|
|
||||||
</xs:annotation><xs:complexType/></xs:element>
|
|
||||||
|
|
||||||
<xs:attributeGroup name="protect-pointcut.attlist">
|
<xs:attributeGroup name="protect-pointcut.attlist">
|
||||||
<xs:attribute name="expression" use="required" type="xs:string">
|
<xs:attribute name="expression" use="required" type="xs:string">
|
||||||
|
@ -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(
|
|
||||||
"<b:bean class='org.springframework.security.authentication.dao.DaoAuthenticationProvider'>" +
|
|
||||||
" <custom-authentication-provider />" +
|
|
||||||
" <b:property name='userDetailsService' ref='us'/>" +
|
|
||||||
"</b:bean>" +
|
|
||||||
"<user-service id='us'>" +
|
|
||||||
" <user name='bob' password='bobspassword' authorities='ROLE_A,ROLE_B' />" +
|
|
||||||
"</user-service>", "2.0.4", 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(
|
|
||||||
"<b:bean id='aip' class='org.springframework.security.config.MockAfterInvocationProvider'>" +
|
|
||||||
" <custom-after-invocation-provider />" +
|
|
||||||
"</b:bean>", "2.0.4", null);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user