From 51171efa7a9c476360f300504a46f6a266a2412d Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 14 Oct 2013 11:55:56 -0500 Subject: [PATCH] SEC-2357: Move *RequestMatcher to .matcher package --- buildSrc/build.gradle | 1 + .../web/AbstractRequestMatcherConfigurer.java | 26 ++++++------- .../annotation/web/builders/HttpSecurity.java | 10 ++--- .../annotation/web/builders/WebSecurity.java | 2 +- ...bstractAuthenticationFilterConfigurer.java | 4 +- ...stractRequestMatcherMappingConfigurer.java | 2 +- .../ChannelSecurityConfigurer.java | 2 +- .../web/configurers/CsrfConfigurer.java | 2 +- .../ExceptionHandlingConfigurer.java | 2 +- .../ExpressionUrlAuthorizationConfigurer.java | 2 +- .../web/configurers/FormLoginConfigurer.java | 4 +- .../web/configurers/HttpBasicConfigurer.java | 6 +-- .../web/configurers/LogoutConfigurer.java | 4 +- .../web/configurers/PermitAllSupport.java | 2 +- .../configurers/RequestCacheConfigurer.java | 12 +++--- .../UrlAuthorizationConfigurer.java | 2 +- .../openid/OpenIDLoginConfigurer.java | 4 +- .../http/DefaultFilterChainValidator.java | 4 +- .../config/http/HttpConfigurationBuilder.java | 2 +- .../HttpSecurityBeanDefinitionParser.java | 2 +- .../security/config/http/MatcherType.java | 8 ++-- .../web/RequestMatchersTests.groovy | 4 +- .../web/builders/NamespaceHttpTests.groovy | 4 +- .../WebSecurityConfigurationTests.groovy | 2 +- ...equestMatcherMappingConfigurerTests.groovy | 6 +-- .../configurers/CsrfConfigurerTests.groovy | 2 +- .../configurers/DefaultFiltersTests.groovy | 2 +- .../FormLoginConfigurerTests.groovy | 2 +- .../configurers/HeadersConfigurerTests.groovy | 2 +- .../configurers/NamespaceDebugTests.groovy | 6 +-- .../NamespaceHttpCustomFilterTests.groovy | 6 +-- .../NamespaceHttpHeadersTests.groovy | 2 +- .../configurers/NamespaceHttpJeeTests.groovy | 6 +-- .../NamespaceHttpLogoutTests.groovy | 6 +-- .../configurers/PermitAllSupportTests.groovy | 2 +- .../config/http/CsrfConfigTests.groovy | 2 +- .../config/http/HttpHeadersConfigTests.groovy | 2 +- .../http/InterceptUrlConfigTests.groovy | 2 +- .../config/http/MiscHttpConfigTests.groovy | 2 +- .../config/FilterChainProxyConfigTests.java | 6 +-- .../DefaultFilterChainValidatorTests.java | 2 +- .../security/util/filtertest-valid.xml | 10 ++--- docs/manual/src/asciidoctor/index.adoc | 2 +- .../web/DefaultSecurityFilterChain.java | 2 +- .../security/web/FilterChainProxy.java | 2 +- ...ilterInvocationSecurityMetadataSource.java | 2 +- .../expression/WebSecurityExpressionRoot.java | 2 +- ...ilterInvocationSecurityMetadataSource.java | 2 +- ...bstractAuthenticationProcessingFilter.java | 2 +- .../DelegatingAuthenticationEntryPoint.java | 6 +-- .../authentication/logout/LogoutFilter.java | 2 +- .../security/web/csrf/CsrfFilter.java | 4 +- .../DelegatingRequestMatcherHeaderWriter.java | 2 +- .../web/header/writers/HstsHeaderWriter.java | 2 +- .../savedrequest/HttpSessionRequestCache.java | 4 +- .../web/util/AntPathRequestMatcher.java | 2 +- .../security/web/util/AnyRequestMatcher.java | 2 +- .../security/web/util/ELRequestMatcher.java | 2 +- .../security/web/util/IpAddressMatcher.java | 2 +- .../web/util/RegexRequestMatcher.java | 2 +- .../security/web/util/RequestMatcher.java | 1 + .../web/util/RequestMatcherEditor.java | 3 +- .../AndRequestMatcher.java | 4 +- .../AntPathRequestMatcher.java | 24 +++++------- .../AnyRequestMatcher.java | 6 +-- .../ELRequestMatcher.java | 4 +- .../ELRequestMatcherContext.java | 2 +- .../IpAddressMatcher.java | 4 +- .../MediaTypeRequestMatcher.java | 4 +- .../NegatedRequestMatcher.java | 4 +- .../OrRequestMatcher.java | 4 +- .../RegexRequestMatcher.java | 4 +- .../RequestHeaderRequestMatcher.java | 4 +- .../web/util/matcher/RequestMatcher.java | 21 ++++++++++ .../util/matcher/RequestMatcherEditor.java | 39 +++++++++++++++++++ .../security/web/FilterChainProxyTests.java | 2 +- ...InvocationSecurityMetadataSourceTests.java | 4 +- ...InvocationSecurityMetadataSourceTests.java | 4 +- ...legatingAuthenticationEntryPointTests.java | 2 +- .../security/web/csrf/CsrfFilterTests.java | 2 +- ...gatingRequestMatcherHeaderWriterTests.java | 2 +- .../header/writers/HstsHeaderWriterTests.java | 2 +- .../HttpSessionRequestCacheTests.java | 2 +- .../AndRequestMatcherTests.java | 6 +-- .../AntPathRequestMatcherTests.java | 6 +-- .../ELRequestMatcherTests.java | 4 +- .../IpAddressMatcherTests.java | 4 +- ...diaTypeRequestMatcherRequestHCNSTests.java | 4 +- .../MediaTypeRequestMatcherTests.java | 4 +- .../NegatedRequestMatcherTests.java | 6 +-- .../OrRequestMatcherTests.java | 6 +-- .../RegexRequestMatcherTests.java | 4 +- .../RequestHeaderRequestMatcherTests.java | 4 +- 93 files changed, 239 insertions(+), 182 deletions(-) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/AndRequestMatcher.java (95%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/AntPathRequestMatcher.java (89%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/AnyRequestMatcher.java (86%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/ELRequestMatcher.java (94%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/ELRequestMatcherContext.java (95%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/IpAddressMatcher.java (95%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/MediaTypeRequestMatcher.java (98%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/NegatedRequestMatcher.java (94%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/OrRequestMatcher.java (95%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/RegexRequestMatcher.java (96%) rename web/src/main/java/org/springframework/security/web/util/{matchers => matcher}/RequestHeaderRequestMatcher.java (96%) create mode 100644 web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java create mode 100644 web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcherEditor.java rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/AndRequestMatcherTests.java (94%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/AntPathRequestMatcherTests.java (97%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/ELRequestMatcherTests.java (95%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/IpAddressMatcherTests.java (94%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/MediaTypeRequestMatcherRequestHCNSTests.java (97%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/MediaTypeRequestMatcherTests.java (98%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/NegatedRequestMatcherTests.java (89%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/OrRequestMatcherTests.java (94%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/RegexRequestMatcherTests.java (96%) rename web/src/test/java/org/springframework/security/web/util/{matchers => matcher}/RequestHeaderRequestMatcherTests.java (95%) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 0ac2b0dfca..0f4af0b504 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -40,6 +40,7 @@ dependencies { exclude group: 'rubygems', module :'erubis' exclude group: 'rubygems', module :'slim' } + compile 'net.alchim31:livereload-jvm:0.1.0' compile 'org.apache.avalon.framework:avalon-framework-api:4.3.1' compile 'org.apache.avalon.framework:avalon-framework-impl:4.3.1' compile 'org.apache.xmlgraphics:fop:1.1' diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherConfigurer.java index 5cb70bf764..1177ef8631 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherConfigurer.java @@ -23,10 +23,10 @@ import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.SecurityBuilder; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configurers.AbstractRequestMatcherMappingConfigurer; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.matchers.RegexRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RegexRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * A base class for registering {@link RequestMatcher}'s. For example, it might allow for specifying which @@ -46,7 +46,7 @@ public abstract class AbstractRequestMatcherConfigurer attributes is present diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy index d59e3a4284..864d6f429a 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy @@ -40,7 +40,7 @@ import org.springframework.security.web.access.WebInvocationPrivilegeEvaluator; import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; import org.springframework.security.web.access.expression.WebSecurityExpressionHandler; import org.springframework.security.web.access.intercept.FilterSecurityInterceptor; -import org.springframework.security.web.util.matchers.AnyRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher import org.springframework.test.util.ReflectionTestUtils; /** diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherMappingConfigurerTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherMappingConfigurerTests.groovy index 61b9d149ac..b841546a9e 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherMappingConfigurerTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherMappingConfigurerTests.groovy @@ -23,9 +23,9 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractRequestMatcherMappingConfigurer; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher; -import org.springframework.security.web.util.matchers.RegexRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.RegexRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import spock.lang.Specification; diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.groovy index aff7f93fd5..8ab6451bc4 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.groovy @@ -27,7 +27,7 @@ import org.springframework.security.web.access.AccessDeniedHandler import org.springframework.security.web.csrf.CsrfFilter; import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.web.servlet.support.RequestDataValueProcessor; import spock.lang.Unroll; diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.groovy index 03eed5f529..0ed5d460ac 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.groovy @@ -43,7 +43,7 @@ import org.springframework.security.web.header.HeaderWriterFilter import org.springframework.security.web.savedrequest.RequestCacheAwareFilter import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter import org.springframework.security.web.session.SessionManagementFilter -import org.springframework.security.web.util.matchers.AnyRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher /** * diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/FormLoginConfigurerTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/FormLoginConfigurerTests.groovy index a79ec3721d..0bb4a6de47 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/FormLoginConfigurerTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/FormLoginConfigurerTests.groovy @@ -46,7 +46,7 @@ import org.springframework.security.web.header.HeaderWriterFilter import org.springframework.security.web.savedrequest.RequestCacheAwareFilter import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter import org.springframework.security.web.session.SessionManagementFilter -import org.springframework.security.web.util.matchers.AnyRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher import org.springframework.test.util.ReflectionTestUtils import spock.lang.Unroll diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/HeadersConfigurerTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/HeadersConfigurerTests.groovy index 4b308733ee..313d6a4090 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/HeadersConfigurerTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/HeadersConfigurerTests.groovy @@ -27,7 +27,7 @@ import org.springframework.security.web.access.AccessDeniedHandler import org.springframework.security.web.csrf.CsrfFilter; import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.web.servlet.support.RequestDataValueProcessor; import spock.lang.Unroll; diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceDebugTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceDebugTests.groovy index 0faee83291..0c88d047cc 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceDebugTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceDebugTests.groovy @@ -51,9 +51,9 @@ import org.springframework.security.web.context.SecurityContextPersistenceFilter import org.springframework.security.web.debug.DebugFilter; import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher import spock.lang.Ignore; diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.groovy index 09d0beef23..67f3e2cde5 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.groovy @@ -52,9 +52,9 @@ import org.springframework.security.web.context.NullSecurityContextRepository; import org.springframework.security.web.context.SecurityContextPersistenceFilter import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher import spock.lang.Ignore; diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpHeadersTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpHeadersTests.groovy index 5f94f5d79c..7abd8196ff 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpHeadersTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpHeadersTests.groovy @@ -27,7 +27,7 @@ import org.springframework.security.web.header.writers.XXssProtectionHeaderWrite import org.springframework.security.web.header.writers.frameoptions.StaticAllowFromStrategy import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter.XFrameOptionsMode -import org.springframework.security.web.util.matchers.AnyRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher /** * Tests to verify that all the functionality of attributes is present diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpJeeTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpJeeTests.groovy index a7544bcab2..63f28ae8a2 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpJeeTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpJeeTests.groovy @@ -67,9 +67,9 @@ import org.springframework.security.web.context.NullSecurityContextRepository; import org.springframework.security.web.context.SecurityContextPersistenceFilter import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher import org.springframework.test.util.ReflectionTestUtils; /** diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.groovy index c7e2ddb7b8..2fcdf94d1e 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.groovy @@ -60,9 +60,9 @@ import org.springframework.security.web.context.NullSecurityContextRepository; import org.springframework.security.web.context.SecurityContextPersistenceFilter import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher /** * Tests to verify that all the functionality of attributes is present diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/PermitAllSupportTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/PermitAllSupportTests.groovy index dff9723443..03a13ef52b 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/PermitAllSupportTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/PermitAllSupportTests.groovy @@ -23,7 +23,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.RequestMatcher /** * @author Rob Winch diff --git a/config/src/test/groovy/org/springframework/security/config/http/CsrfConfigTests.groovy b/config/src/test/groovy/org/springframework/security/config/http/CsrfConfigTests.groovy index 1db8093d53..20fe73ea7e 100644 --- a/config/src/test/groovy/org/springframework/security/config/http/CsrfConfigTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/http/CsrfConfigTests.groovy @@ -31,7 +31,7 @@ import org.springframework.security.web.csrf.CsrfToken; import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.csrf.DefaultCsrfToken; import org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor -import org.springframework.security.web.util.RequestMatcher +import org.springframework.security.web.util.matcher.RequestMatcher import org.springframework.web.servlet.support.RequestDataValueProcessor; import spock.lang.Unroll diff --git a/config/src/test/groovy/org/springframework/security/config/http/HttpHeadersConfigTests.groovy b/config/src/test/groovy/org/springframework/security/config/http/HttpHeadersConfigTests.groovy index 4226628bc7..f118ed3883 100644 --- a/config/src/test/groovy/org/springframework/security/config/http/HttpHeadersConfigTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/http/HttpHeadersConfigTests.groovy @@ -20,7 +20,7 @@ import org.springframework.mock.web.MockHttpServletResponse import org.springframework.security.web.FilterChainProxy import org.springframework.security.web.header.HeaderWriterFilter import org.springframework.security.web.header.writers.StaticHeadersWriter -import org.springframework.security.web.util.matchers.AnyRequestMatcher +import org.springframework.security.web.util.matcher.AnyRequestMatcher /** * diff --git a/config/src/test/groovy/org/springframework/security/config/http/InterceptUrlConfigTests.groovy b/config/src/test/groovy/org/springframework/security/config/http/InterceptUrlConfigTests.groovy index 119097f0ba..c67d2cf61b 100644 --- a/config/src/test/groovy/org/springframework/security/config/http/InterceptUrlConfigTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/http/InterceptUrlConfigTests.groovy @@ -70,7 +70,7 @@ import org.springframework.security.access.vote.AffirmativeBased import org.springframework.security.access.PermissionEvaluator import org.springframework.security.core.Authentication import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler -import org.springframework.security.web.util.matchers.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher import org.springframework.security.authentication.AuthenticationManager diff --git a/config/src/test/groovy/org/springframework/security/config/http/MiscHttpConfigTests.groovy b/config/src/test/groovy/org/springframework/security/config/http/MiscHttpConfigTests.groovy index c746440112..506d16fca1 100644 --- a/config/src/test/groovy/org/springframework/security/config/http/MiscHttpConfigTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/http/MiscHttpConfigTests.groovy @@ -71,7 +71,7 @@ import org.springframework.security.access.vote.AffirmativeBased import org.springframework.security.access.PermissionEvaluator import org.springframework.security.core.Authentication import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler -import org.springframework.security.web.util.matchers.AntPathRequestMatcher +import org.springframework.security.web.util.matcher.AntPathRequestMatcher import org.springframework.security.authentication.AuthenticationManager diff --git a/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java b/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java index 324f17e932..b203a1067f 100644 --- a/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java +++ b/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java @@ -39,9 +39,9 @@ import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.context.SecurityContextPersistenceFilter; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * Tests {@link FilterChainProxy}. diff --git a/config/src/test/java/org/springframework/security/config/http/DefaultFilterChainValidatorTests.java b/config/src/test/java/org/springframework/security/config/http/DefaultFilterChainValidatorTests.java index 5709dc7d8b..3a20fedb02 100644 --- a/config/src/test/java/org/springframework/security/config/http/DefaultFilterChainValidatorTests.java +++ b/config/src/test/java/org/springframework/security/config/http/DefaultFilterChainValidatorTests.java @@ -38,7 +38,7 @@ import org.springframework.security.web.access.intercept.FilterInvocationSecurit import org.springframework.security.web.access.intercept.FilterSecurityInterceptor; import org.springframework.security.web.authentication.AnonymousAuthenticationFilter; import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; /** * diff --git a/config/src/test/resources/org/springframework/security/util/filtertest-valid.xml b/config/src/test/resources/org/springframework/security/util/filtertest-valid.xml index e21448cf74..8ba04ee5d2 100644 --- a/config/src/test/resources/org/springframework/security/util/filtertest-valid.xml +++ b/config/src/test/resources/org/springframework/security/util/filtertest-valid.xml @@ -45,9 +45,9 @@ - + - + @@ -137,7 +137,7 @@ - + @@ -151,7 +151,7 @@ - + @@ -161,7 +161,7 @@ - + diff --git a/docs/manual/src/asciidoctor/index.adoc b/docs/manual/src/asciidoctor/index.adoc index b40e5ddec9..f929d92f9d 100644 --- a/docs/manual/src/asciidoctor/index.adoc +++ b/docs/manual/src/asciidoctor/index.adoc @@ -3086,7 +3086,7 @@ At times you may want to only write a header for certain requests. For example, - diff --git a/web/src/main/java/org/springframework/security/web/DefaultSecurityFilterChain.java b/web/src/main/java/org/springframework/security/web/DefaultSecurityFilterChain.java index 466d1254ef..2f1f49849a 100644 --- a/web/src/main/java/org/springframework/security/web/DefaultSecurityFilterChain.java +++ b/web/src/main/java/org/springframework/security/web/DefaultSecurityFilterChain.java @@ -2,7 +2,7 @@ package org.springframework.security.web; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import javax.servlet.Filter; import javax.servlet.http.HttpServletRequest; diff --git a/web/src/main/java/org/springframework/security/web/FilterChainProxy.java b/web/src/main/java/org/springframework/security/web/FilterChainProxy.java index 34b7497ae7..5944f810cd 100644 --- a/web/src/main/java/org/springframework/security/web/FilterChainProxy.java +++ b/web/src/main/java/org/springframework/security/web/FilterChainProxy.java @@ -21,7 +21,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.firewall.DefaultHttpFirewall; import org.springframework.security.web.firewall.FirewalledRequest; import org.springframework.security.web.firewall.HttpFirewall; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.UrlUtils; import org.springframework.web.filter.DelegatingFilterProxy; import org.springframework.web.filter.GenericFilterBean; diff --git a/web/src/main/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSource.java b/web/src/main/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSource.java index d2bbc693e6..e3b683752e 100644 --- a/web/src/main/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSource.java +++ b/web/src/main/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSource.java @@ -13,7 +13,7 @@ import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.expression.SecurityExpressionHandler; import org.springframework.security.web.FilterInvocation; import org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionRoot.java b/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionRoot.java index 9972d1d8fd..19b0abd7d7 100644 --- a/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionRoot.java +++ b/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionRoot.java @@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.security.access.expression.SecurityExpressionRoot; import org.springframework.security.core.Authentication; import org.springframework.security.web.FilterInvocation; -import org.springframework.security.web.util.matchers.IpAddressMatcher; +import org.springframework.security.web.util.matcher.IpAddressMatcher; /** * diff --git a/web/src/main/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSource.java b/web/src/main/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSource.java index 9854cc274b..3d0ae034a7 100644 --- a/web/src/main/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSource.java +++ b/web/src/main/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSource.java @@ -27,7 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.access.ConfigAttribute; import org.springframework.security.web.FilterInvocation; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** diff --git a/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java b/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java index 8405736e98..02a44562ce 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java +++ b/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java @@ -40,7 +40,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.WebAttributes; import org.springframework.security.web.authentication.session.NullAuthenticatedSessionStrategy; import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.UrlUtils; import org.springframework.util.Assert; import org.springframework.web.filter.GenericFilterBean; diff --git a/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPoint.java b/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPoint.java index c3598bb22a..39a7a633d1 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPoint.java +++ b/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPoint.java @@ -27,9 +27,9 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.security.web.util.matchers.ELRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; -import org.springframework.security.web.util.RequestMatcherEditor; +import org.springframework.security.web.util.matcher.ELRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcherEditor; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/authentication/logout/LogoutFilter.java b/web/src/main/java/org/springframework/security/web/authentication/logout/LogoutFilter.java index d4f583aaec..8f0dca912a 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/logout/LogoutFilter.java +++ b/web/src/main/java/org/springframework/security/web/authentication/logout/LogoutFilter.java @@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.UrlUtils; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/web/src/main/java/org/springframework/security/web/csrf/CsrfFilter.java b/web/src/main/java/org/springframework/security/web/csrf/CsrfFilter.java index 13d7ca2bae..6c5d74517a 100644 --- a/web/src/main/java/org/springframework/security/web/csrf/CsrfFilter.java +++ b/web/src/main/java/org/springframework/security/web/csrf/CsrfFilter.java @@ -28,7 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.access.AccessDeniedHandlerImpl; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.UrlUtils; import org.springframework.util.Assert; import org.springframework.web.filter.OncePerRequestFilter; @@ -218,7 +218,7 @@ public final class CsrfFilter extends OncePerRequestFilter { private Pattern allowedMethods = Pattern.compile("^(GET|HEAD|TRACE|OPTIONS)$"); /* (non-Javadoc) - * @see org.springframework.security.web.util.RequestMatcher#matches(javax.servlet.http.HttpServletRequest) + * @see org.springframework.security.web.util.matcher.RequestMatcher#matches(javax.servlet.http.HttpServletRequest) */ public boolean matches(HttpServletRequest request) { return !allowedMethods.matcher(request.getMethod()).matches(); diff --git a/web/src/main/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriter.java b/web/src/main/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriter.java index 2cf42084f0..a5c90d9f61 100644 --- a/web/src/main/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriter.java +++ b/web/src/main/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriter.java @@ -19,7 +19,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.web.header.HeaderWriter; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/header/writers/HstsHeaderWriter.java b/web/src/main/java/org/springframework/security/web/header/writers/HstsHeaderWriter.java index d91478f12a..67c7451884 100644 --- a/web/src/main/java/org/springframework/security/web/header/writers/HstsHeaderWriter.java +++ b/web/src/main/java/org/springframework/security/web/header/writers/HstsHeaderWriter.java @@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.web.header.HeaderWriter; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/savedrequest/HttpSessionRequestCache.java b/web/src/main/java/org/springframework/security/web/savedrequest/HttpSessionRequestCache.java index faa235ea06..37b1a39f13 100644 --- a/web/src/main/java/org/springframework/security/web/savedrequest/HttpSessionRequestCache.java +++ b/web/src/main/java/org/springframework/security/web/savedrequest/HttpSessionRequestCache.java @@ -8,8 +8,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.web.PortResolver; import org.springframework.security.web.PortResolverImpl; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * {@code RequestCache} which stores the {@code SavedRequest} in the HttpSession. diff --git a/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java index fd4082624c..370241526a 100644 --- a/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java @@ -40,7 +40,7 @@ import org.springframework.util.StringUtils; * @author Luke Taylor * @author Rob Winch * @since 3.1 - * @deprecated use {@link org.springframework.security.web.util.matchers.AntPathRequestMatcher} + * @deprecated use {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher} * @see org.springframework.util.AntPathMatcher */ public final class AntPathRequestMatcher implements RequestMatcher { diff --git a/web/src/main/java/org/springframework/security/web/util/AnyRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/AnyRequestMatcher.java index b136b4db48..da5d93129f 100644 --- a/web/src/main/java/org/springframework/security/web/util/AnyRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/AnyRequestMatcher.java @@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest; * * @author Luke Taylor * @since 3.1 - * @deprecated use org.springframework.security.web.util.matchers.AnyRequestMatcher.INSTANCE instead + * @deprecated use org.springframework.security.web.util.matcher.AnyRequestMatcher.INSTANCE instead */ public final class AnyRequestMatcher implements RequestMatcher { diff --git a/web/src/main/java/org/springframework/security/web/util/ELRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/ELRequestMatcher.java index a126e767c4..432da20822 100644 --- a/web/src/main/java/org/springframework/security/web/util/ELRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/ELRequestMatcher.java @@ -35,7 +35,7 @@ import org.springframework.security.web.authentication.DelegatingAuthenticationE * * @author Mike Wiesner * @since 3.0.2 - * @deprecated Use org.springframework.security.web.util.matchers.ELRequestMatcher + * @deprecated Use org.springframework.security.web.util.matcher.ELRequestMatcher */ public class ELRequestMatcher implements RequestMatcher { diff --git a/web/src/main/java/org/springframework/security/web/util/IpAddressMatcher.java b/web/src/main/java/org/springframework/security/web/util/IpAddressMatcher.java index f56af291f2..770ccf9396 100644 --- a/web/src/main/java/org/springframework/security/web/util/IpAddressMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/IpAddressMatcher.java @@ -14,7 +14,7 @@ import org.springframework.util.StringUtils; * Both IPv6 and IPv4 addresses are supported, but a matcher which is configured with an IPv4 address will * never match a request which returns an IPv6 address, and vice-versa. * - * @deprecated use {@link org.springframework.security.web.util.matchers.IpAddressMatcher} + * @deprecated use {@link org.springframework.security.web.util.matcher.IpAddressMatcher} * @author Luke Taylor * @since 3.0.2 */ diff --git a/web/src/main/java/org/springframework/security/web/util/RegexRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/RegexRequestMatcher.java index 2145c1d797..5e6425ae26 100644 --- a/web/src/main/java/org/springframework/security/web/util/RegexRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/RegexRequestMatcher.java @@ -30,7 +30,7 @@ import org.springframework.util.StringUtils; * by default. Case-insensitive matching can be used by using the constructor which takes the {@code caseInsensitive} * argument. * - * @deprecated use {@link org.springframework.security.web.util.matchers.RegexRequestMatcher} + * @deprecated use {@link org.springframework.security.web.util.matcher.RegexRequestMatcher} * * @author Luke Taylor * @author Rob Winch diff --git a/web/src/main/java/org/springframework/security/web/util/RequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/RequestMatcher.java index cc071de140..cbb94a74dd 100644 --- a/web/src/main/java/org/springframework/security/web/util/RequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/RequestMatcher.java @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest; * * @author Luke Taylor * @since 3.0.2 + * @deprecated use {@link org.springframework.security.web.util.matcher.RequestMatcher} */ public interface RequestMatcher { diff --git a/web/src/main/java/org/springframework/security/web/util/RequestMatcherEditor.java b/web/src/main/java/org/springframework/security/web/util/RequestMatcherEditor.java index 3afac56177..fc1050f7c7 100644 --- a/web/src/main/java/org/springframework/security/web/util/RequestMatcherEditor.java +++ b/web/src/main/java/org/springframework/security/web/util/RequestMatcherEditor.java @@ -28,12 +28,13 @@ import org.springframework.security.web.authentication.DelegatingAuthenticationE * * @author Mike Wiesner * @since 3.0.2 + * @deprecated use {@link org.springframework.security.web.util.matcher.RequestMatcherEditor} */ public class RequestMatcherEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { - setValue(new org.springframework.security.web.util.matchers.ELRequestMatcher(text)); + setValue(new ELRequestMatcher(text)); } } diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/AndRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/AndRequestMatcher.java similarity index 95% rename from web/src/main/java/org/springframework/security/web/util/matchers/AndRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/AndRequestMatcher.java index baf24023d3..35cdb659f9 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/AndRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/AndRequestMatcher.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import java.util.Arrays; import java.util.List; @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/AntPathRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/AntPathRequestMatcher.java similarity index 89% rename from web/src/main/java/org/springframework/security/web/util/matchers/AntPathRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/AntPathRequestMatcher.java index fe9aa8228e..d54a6e997f 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/AntPathRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/AntPathRequestMatcher.java @@ -10,14 +10,14 @@ * 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.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.http.HttpMethod; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.AntPathMatcher; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -166,22 +166,16 @@ public final class AntPathRequestMatcher implements RequestMatcher { return pattern; } - @SuppressWarnings("deprecation") @Override public boolean equals(Object obj) { - - if (obj instanceof org.springframework.security.web.util.AntPathRequestMatcher) { - org.springframework.security.web.util.AntPathRequestMatcher other = (org.springframework.security.web.util.AntPathRequestMatcher) obj; - return this.pattern.equals(other.getPattern()) && - this.httpMethod == other.getHttpMethod() && - this.caseSensitive == other.isCaseSensitive(); - } else if(obj instanceof AntPathRequestMatcher) { - org.springframework.security.web.util.matchers.AntPathRequestMatcher other = (AntPathRequestMatcher) obj; - return this.pattern.equals(other.pattern) && - this.httpMethod == other.httpMethod && - this.caseSensitive == other.caseSensitive; + if (!(obj instanceof AntPathRequestMatcher)) { + return false; } - return false; + + AntPathRequestMatcher other = (AntPathRequestMatcher) obj; + return this.pattern.equals(other.pattern) && + this.httpMethod == other.httpMethod && + this.caseSensitive == other.caseSensitive; } @Override diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/AnyRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/AnyRequestMatcher.java similarity index 86% rename from web/src/main/java/org/springframework/security/web/util/matchers/AnyRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/AnyRequestMatcher.java index 9b41d00049..569e30df94 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/AnyRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/AnyRequestMatcher.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * Matches any supplied request. @@ -35,7 +35,7 @@ public final class AnyRequestMatcher implements RequestMatcher { @Override @SuppressWarnings("deprecation") public boolean equals(Object obj) { - return obj instanceof AnyRequestMatcher || obj instanceof org.springframework.security.web.util.AnyRequestMatcher; + return obj instanceof AnyRequestMatcher || obj instanceof org.springframework.security.web.util.matcher.AnyRequestMatcher; } @Override diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcher.java similarity index 94% rename from web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcher.java index 8784857b81..8087c32dd5 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcher.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; @@ -23,7 +23,7 @@ import org.springframework.expression.Expression; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * A RequestMatcher implementation which uses a SpEL expression diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcherContext.java b/web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcherContext.java similarity index 95% rename from web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcherContext.java rename to web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcherContext.java index e5e67e7732..da15df2e7e 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/ELRequestMatcherContext.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/ELRequestMatcherContext.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/IpAddressMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java similarity index 95% rename from web/src/main/java/org/springframework/security/web/util/matchers/IpAddressMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java index ce94c26456..d63d229ef1 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/IpAddressMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java @@ -1,4 +1,4 @@ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import java.net.InetAddress; import java.net.UnknownHostException; @@ -6,7 +6,7 @@ import java.util.Arrays; import javax.servlet.http.HttpServletRequest; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.StringUtils; /** diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcher.java similarity index 98% rename from web/src/main/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcher.java index 69e14f806c..e77c161b06 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import java.util.Arrays; import java.util.Collection; @@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.http.MediaType; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; import org.springframework.web.HttpMediaTypeNotAcceptableException; import org.springframework.web.accept.ContentNegotiationStrategy; diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/NegatedRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/NegatedRequestMatcher.java similarity index 94% rename from web/src/main/java/org/springframework/security/web/util/matchers/NegatedRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/NegatedRequestMatcher.java index c88cca07d5..7c0fa5fa37 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/NegatedRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/NegatedRequestMatcher.java @@ -13,13 +13,13 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/OrRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/OrRequestMatcher.java similarity index 95% rename from web/src/main/java/org/springframework/security/web/util/matchers/OrRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/OrRequestMatcher.java index b7ae5cb1ff..62eefdf2c7 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/OrRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/OrRequestMatcher.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import java.util.Arrays; import java.util.List; @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/RegexRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/RegexRequestMatcher.java similarity index 96% rename from web/src/main/java/org/springframework/security/web/util/matchers/RegexRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/RegexRequestMatcher.java index f77c2a30f5..b355035d78 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/RegexRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/RegexRequestMatcher.java @@ -10,7 +10,7 @@ * 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.web.util.matchers; +package org.springframework.security.web.util.matcher; import java.util.regex.Pattern; @@ -19,7 +19,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.http.HttpMethod; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.StringUtils; /** diff --git a/web/src/main/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcher.java similarity index 96% rename from web/src/main/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcher.java rename to web/src/main/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcher.java index 1d67c7a4c5..34e3dd0cc8 100644 --- a/web/src/main/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcher.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import javax.servlet.http.HttpServletRequest; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** diff --git a/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java new file mode 100644 index 0000000000..7b6a84cb85 --- /dev/null +++ b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java @@ -0,0 +1,21 @@ +package org.springframework.security.web.util.matcher; + +import javax.servlet.http.HttpServletRequest; + +/** + * Simple strategy to match an HttpServletRequest. + * + * @author Luke Taylor + * @since 3.0.2 + */ +public interface RequestMatcher { + + /** + * Decides whether the rule implemented by the strategy matches the supplied request. + * + * @param request the request to check for a match + * @return true if the request matches, false otherwise + */ + boolean matches(HttpServletRequest request); + +} diff --git a/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcherEditor.java b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcherEditor.java new file mode 100644 index 0000000000..9c847dfa21 --- /dev/null +++ b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcherEditor.java @@ -0,0 +1,39 @@ +/* + * Copyright 2010 the original author or authors. + * + * 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.web.util.matcher; + +import java.beans.PropertyEditorSupport; + +import org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint; + +/** + * PropertyEditor which creates ELRequestMatcher instances from Strings + * + * This allows to use a String in a BeanDefinition instead of an (inner) bean + * if a RequestMatcher is required, e.g. in {@link DelegatingAuthenticationEntryPoint} + * + * @author Mike Wiesner + * @since 3.0.2 + */ +public class RequestMatcherEditor extends PropertyEditorSupport { + + @Override + public void setAsText(String text) throws IllegalArgumentException { + setValue(new ELRequestMatcher(text)); + } + +} diff --git a/web/src/test/java/org/springframework/security/web/FilterChainProxyTests.java b/web/src/test/java/org/springframework/security/web/FilterChainProxyTests.java index 71f1d91ab5..97425832f6 100644 --- a/web/src/test/java/org/springframework/security/web/FilterChainProxyTests.java +++ b/web/src/test/java/org/springframework/security/web/FilterChainProxyTests.java @@ -14,7 +14,7 @@ import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.firewall.FirewalledRequest; import org.springframework.security.web.firewall.HttpFirewall; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import javax.servlet.Filter; import javax.servlet.FilterChain; diff --git a/web/src/test/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSourceTests.java b/web/src/test/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSourceTests.java index 601eba3813..9a80069af2 100644 --- a/web/src/test/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSourceTests.java +++ b/web/src/test/java/org/springframework/security/web/access/expression/ExpressionBasedFilterInvocationSecurityMetadataSourceTests.java @@ -7,8 +7,8 @@ import org.junit.Test; import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; import org.springframework.security.web.FilterInvocation; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import java.util.Collection; import java.util.LinkedHashMap; diff --git a/web/src/test/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSourceTests.java b/web/src/test/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSourceTests.java index c9172b9d99..86c92b967f 100644 --- a/web/src/test/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSourceTests.java +++ b/web/src/test/java/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSourceTests.java @@ -29,8 +29,8 @@ import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; import org.springframework.security.web.FilterInvocation; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * Tests {@link DefaultFilterInvocationSecurityMetadataSource}. diff --git a/web/src/test/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTests.java b/web/src/test/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTests.java index 3cb8fb26de..c0f2f240e7 100644 --- a/web/src/test/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTests.java +++ b/web/src/test/java/org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTests.java @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * Test class for {@link DelegatingAuthenticationEntryPoint} diff --git a/web/src/test/java/org/springframework/security/web/csrf/CsrfFilterTests.java b/web/src/test/java/org/springframework/security/web/csrf/CsrfFilterTests.java index f15ae93df5..e2891867a4 100644 --- a/web/src/test/java/org/springframework/security/web/csrf/CsrfFilterTests.java +++ b/web/src/test/java/org/springframework/security/web/csrf/CsrfFilterTests.java @@ -41,7 +41,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.web.access.AccessDeniedHandler; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * @author Rob Winch diff --git a/web/src/test/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriterTests.java b/web/src/test/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriterTests.java index 0d186beec2..644bcfcf78 100644 --- a/web/src/test/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriterTests.java +++ b/web/src/test/java/org/springframework/security/web/header/writers/DelegatingRequestMatcherHeaderWriterTests.java @@ -27,7 +27,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.web.header.HeaderWriter; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * @author Rob Winch diff --git a/web/src/test/java/org/springframework/security/web/header/writers/HstsHeaderWriterTests.java b/web/src/test/java/org/springframework/security/web/header/writers/HstsHeaderWriterTests.java index 7c46624c26..cbe0813ac9 100644 --- a/web/src/test/java/org/springframework/security/web/header/writers/HstsHeaderWriterTests.java +++ b/web/src/test/java/org/springframework/security/web/header/writers/HstsHeaderWriterTests.java @@ -22,7 +22,7 @@ import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.web.header.writers.HstsHeaderWriter; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; /** * @author Rob Winch diff --git a/web/src/test/java/org/springframework/security/web/savedrequest/HttpSessionRequestCacheTests.java b/web/src/test/java/org/springframework/security/web/savedrequest/HttpSessionRequestCacheTests.java index 2648021a7b..eaac762f5d 100644 --- a/web/src/test/java/org/springframework/security/web/savedrequest/HttpSessionRequestCacheTests.java +++ b/web/src/test/java/org/springframework/security/web/savedrequest/HttpSessionRequestCacheTests.java @@ -17,7 +17,7 @@ import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.web.PortResolverImpl; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; /** * diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/AndRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/AndRequestMatcherTests.java similarity index 94% rename from web/src/test/java/org/springframework/security/web/util/matchers/AndRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/AndRequestMatcherTests.java index f8a1f7a631..ba0b7869cd 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/AndRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/AndRequestMatcherTests.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -28,8 +28,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.security.web.util.RequestMatcher; -import org.springframework.security.web.util.matchers.AndRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.security.web.util.matcher.AndRequestMatcher; /** * diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/AntPathRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/AntPathRequestMatcherTests.java similarity index 97% rename from web/src/test/java/org/springframework/security/web/util/matchers/AntPathRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/AntPathRequestMatcherTests.java index a492a20055..427e93d504 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/AntPathRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/AntPathRequestMatcherTests.java @@ -10,7 +10,7 @@ * 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.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -25,8 +25,8 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.AntPathRequestMatcher; -import org.springframework.security.web.util.matchers.AnyRequestMatcher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.AnyRequestMatcher; /** * @author Luke Taylor diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/ELRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/ELRequestMatcherTests.java similarity index 95% rename from web/src/test/java/org/springframework/security/web/util/matchers/ELRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/ELRequestMatcherTests.java index b30cf11eba..7e63cae362 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/ELRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/ELRequestMatcherTests.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.junit.Assert.*; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.ELRequestMatcher; +import org.springframework.security.web.util.matcher.ELRequestMatcher; /** * @author Mike Wiesner diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/IpAddressMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/IpAddressMatcherTests.java similarity index 94% rename from web/src/test/java/org/springframework/security/web/util/matchers/IpAddressMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/IpAddressMatcherTests.java index 1a668e5e6a..833d3f9f19 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/IpAddressMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/IpAddressMatcherTests.java @@ -1,4 +1,4 @@ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.junit.Assert.*; @@ -6,7 +6,7 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.IpAddressMatcher; +import org.springframework.security.web.util.matcher.IpAddressMatcher; /** diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherRequestHCNSTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherRequestHCNSTests.java similarity index 97% rename from web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherRequestHCNSTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherRequestHCNSTests.java index 9228d2ddd8..5a32c0d962 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherRequestHCNSTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherRequestHCNSTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; @@ -23,7 +23,7 @@ import org.junit.Before; import org.junit.Test; import org.springframework.http.MediaType; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.MediaTypeRequestMatcher; +import org.springframework.security.web.util.matcher.MediaTypeRequestMatcher; import org.springframework.web.accept.ContentNegotiationStrategy; import org.springframework.web.accept.HeaderContentNegotiationStrategy; diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherTests.java similarity index 98% rename from web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherTests.java index fdebfac0dc..e6b16872c0 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/MediaTypeRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/MediaTypeRequestMatcherTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Matchers.any; @@ -30,7 +30,7 @@ import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.http.MediaType; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.MediaTypeRequestMatcher; +import org.springframework.security.web.util.matcher.MediaTypeRequestMatcher; import org.springframework.web.HttpMediaTypeNotAcceptableException; import org.springframework.web.accept.ContentNegotiationStrategy; import org.springframework.web.context.request.NativeWebRequest; diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/NegatedRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/NegatedRequestMatcherTests.java similarity index 89% rename from web/src/test/java/org/springframework/security/web/util/matchers/NegatedRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/NegatedRequestMatcherTests.java index e49bee8f4b..7f189504ff 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/NegatedRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/NegatedRequestMatcherTests.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -24,8 +24,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.security.web.util.RequestMatcher; -import org.springframework.security.web.util.matchers.NegatedRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.security.web.util.matcher.NegatedRequestMatcher; /** * diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/OrRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/OrRequestMatcherTests.java similarity index 94% rename from web/src/test/java/org/springframework/security/web/util/matchers/OrRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/OrRequestMatcherTests.java index ea4aacb686..ccf5a4291a 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/OrRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/OrRequestMatcherTests.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -28,8 +28,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.security.web.util.RequestMatcher; -import org.springframework.security.web.util.matchers.OrRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.security.web.util.matcher.OrRequestMatcher; /** * diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/RegexRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/RegexRequestMatcherTests.java similarity index 96% rename from web/src/test/java/org/springframework/security/web/util/matchers/RegexRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/RegexRequestMatcherTests.java index 263789c906..a0f760ece8 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/RegexRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/RegexRequestMatcherTests.java @@ -10,7 +10,7 @@ * 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.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -23,7 +23,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.RegexRequestMatcher; +import org.springframework.security.web.util.matcher.RegexRequestMatcher; /** * @author Luke Taylor diff --git a/web/src/test/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcherTests.java b/web/src/test/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcherTests.java similarity index 95% rename from web/src/test/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcherTests.java rename to web/src/test/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcherTests.java index c05a2c3886..22077eb012 100644 --- a/web/src/test/java/org/springframework/security/web/util/matchers/RequestHeaderRequestMatcherTests.java +++ b/web/src/test/java/org/springframework/security/web/util/matcher/RequestHeaderRequestMatcherTests.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.util.matchers; +package org.springframework.security.web.util.matcher; import static org.fest.assertions.Assertions.assertThat; import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.security.web.util.matchers.RequestHeaderRequestMatcher; +import org.springframework.security.web.util.matcher.RequestHeaderRequestMatcher; /** *