Remove @Configuration from @Enable* Annotations

This removes `@Configuration` from all `@Enable` Annotations and explicitly
adds `@Configuration` to wherever the `@Enable*` Annotations are used.

Closes gh-11653
This commit is contained in:
Rob Winch 2022-08-09 17:00:24 -05:00
commit 425b3501b7
243 changed files with 1379 additions and 20 deletions

View File

@ -28,6 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.ldap.core.support.BaseLdapPathContextSource; import org.springframework.ldap.core.support.BaseLdapPathContextSource;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
@ -155,6 +156,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
return port; return port;
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLdapConfig extends BaseLdapProviderConfig { static class DefaultLdapConfig extends BaseLdapProviderConfig {
@ -170,6 +172,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class GroupRolesConfig extends BaseLdapProviderConfig { static class GroupRolesConfig extends BaseLdapProviderConfig {
@ -186,6 +189,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class GroupSearchConfig extends BaseLdapProviderConfig { static class GroupSearchConfig extends BaseLdapProviderConfig {
@ -202,6 +206,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig { static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig {
@ -219,6 +224,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RolePrefixConfig extends BaseLdapProviderConfig { static class RolePrefixConfig extends BaseLdapProviderConfig {
@ -235,6 +241,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BindAuthenticationConfig extends BaseLdapServerConfig { static class BindAuthenticationConfig extends BaseLdapServerConfig {
@ -252,6 +259,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderConfig extends BaseLdapServerConfig { static class PasswordEncoderConfig extends BaseLdapServerConfig {
@ -270,6 +278,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
abstract static class BaseLdapServerConfig extends BaseLdapProviderConfig { abstract static class BaseLdapServerConfig extends BaseLdapProviderConfig {
@ -283,6 +292,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Import(ObjectPostProcessorConfiguration.class) @Import(ObjectPostProcessorConfiguration.class)

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.authentication.ldap.LdapAuthenticationProviderBuilderSecurityBuilderTests.BaseLdapProviderConfig; import org.springframework.security.config.annotation.authentication.ldap.LdapAuthenticationProviderBuilderSecurityBuilderTests.BaseLdapProviderConfig;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@ -114,6 +115,7 @@ public class LdapAuthenticationProviderConfigurerTests {
this.mockMvc.perform(request).andExpect(expectedUser); this.mockMvc.perform(request).andExpect(expectedUser);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MultiLdapAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter { static class MultiLdapAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter {
@ -135,6 +137,7 @@ public class LdapAuthenticationProviderConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MultiLdapWithCustomRolePrefixAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter { static class MultiLdapWithCustomRolePrefixAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter {
@ -158,6 +161,7 @@ public class LdapAuthenticationProviderConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class LdapWithRandomPortConfig extends WebSecurityConfigurerAdapter { static class LdapWithRandomPortConfig extends WebSecurityConfigurerAdapter {
@ -176,6 +180,7 @@ public class LdapAuthenticationProviderConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig { static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig {

View File

@ -16,6 +16,7 @@
package org.springframework.security.config.annotation.authentication.ldap; package org.springframework.security.config.annotation.authentication.ldap;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -29,6 +30,7 @@ import org.springframework.security.ldap.userdetails.PersonContextMapper;
*/ */
public class NamespaceLdapAuthenticationProviderTestsConfigs { public class NamespaceLdapAuthenticationProviderTestsConfigs {
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class LdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter { static class LdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter {
@ -44,6 +46,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomLdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter { static class CustomLdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter {
@ -73,6 +76,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthoritiesPopulatorConfig extends WebSecurityConfigurerAdapter { static class CustomAuthoritiesPopulatorConfig extends WebSecurityConfigurerAdapter {
@ -90,6 +94,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordCompareLdapConfig extends WebSecurityConfigurerAdapter { static class PasswordCompareLdapConfig extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.UnsatisfiedDependencyException; import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.ldap.core.support.LdapContextSource; import org.springframework.ldap.core.support.LdapContextSource;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@ -81,6 +82,7 @@ public class EmbeddedLdapServerContextSourceFactoryBeanITests {
.withMessageContaining("managerPassword is required if managerDn is supplied"); .withMessageContaining("managerPassword is required if managerDn is supplied");
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FromEmbeddedLdapServerConfig { static class FromEmbeddedLdapServerConfig {
@ -98,6 +100,7 @@ public class EmbeddedLdapServerContextSourceFactoryBeanITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PortZeroConfig { static class PortZeroConfig {
@ -118,6 +121,7 @@ public class EmbeddedLdapServerContextSourceFactoryBeanITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomLdifAndRootConfig { static class CustomLdifAndRootConfig {
@ -139,6 +143,7 @@ public class EmbeddedLdapServerContextSourceFactoryBeanITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomManagerDnConfig { static class CustomManagerDnConfig {
@ -161,6 +166,7 @@ public class EmbeddedLdapServerContextSourceFactoryBeanITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomManagerDnNoPasswordConfig { static class CustomManagerDnNoPasswordConfig {

View File

@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations; import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.support.BaseLdapPathContextSource; import org.springframework.ldap.core.support.BaseLdapPathContextSource;
@ -131,6 +132,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
.andExpect(authenticated().withUsername("bob")); .andExpect(authenticated().withUsername("bob"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FromContextSourceConfig extends BaseLdapServerConfig { static class FromContextSourceConfig extends BaseLdapServerConfig {
@ -143,6 +145,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthoritiesMapperConfig extends BaseLdapServerConfig { static class CustomAuthoritiesMapperConfig extends BaseLdapServerConfig {
@ -158,6 +161,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthoritiesPopulatorConfig extends BaseLdapServerConfig { static class CustomAuthoritiesPopulatorConfig extends BaseLdapServerConfig {
@ -173,6 +177,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomUserDetailsContextMapperConfig extends BaseLdapServerConfig { static class CustomUserDetailsContextMapperConfig extends BaseLdapServerConfig {
@ -188,6 +193,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomUserDnPatternsConfig extends BaseLdapServerConfig { static class CustomUserDnPatternsConfig extends BaseLdapServerConfig {
@ -200,6 +206,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomUserSearchConfig extends BaseLdapServerConfig { static class CustomUserSearchConfig extends BaseLdapServerConfig {
@ -213,6 +220,7 @@ public class LdapBindAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
abstract static class BaseLdapServerConfig implements DisposableBean { abstract static class BaseLdapServerConfig implements DisposableBean {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.ldap.core.support.BaseLdapPathContextSource; import org.springframework.ldap.core.support.BaseLdapPathContextSource;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@ -59,6 +60,7 @@ public class LdapPasswordComparisonAuthenticationManagerFactoryITests {
this.mockMvc.perform(formLogin().user("bob").password("bob")).andExpect(authenticated().withUsername("bob")); this.mockMvc.perform(formLogin().user("bob").password("bob")).andExpect(authenticated().withUsername("bob"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomPasswordEncoderConfig extends BaseLdapServerConfig { static class CustomPasswordEncoderConfig extends BaseLdapServerConfig {
@ -72,6 +74,7 @@ public class LdapPasswordComparisonAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomPasswordAttributeConfig extends BaseLdapServerConfig { static class CustomPasswordAttributeConfig extends BaseLdapServerConfig {
@ -86,6 +89,7 @@ public class LdapPasswordComparisonAuthenticationManagerFactoryITests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
abstract static class BaseLdapServerConfig implements DisposableBean { abstract static class BaseLdapServerConfig implements DisposableBean {

View File

@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@ -106,7 +105,6 @@ import org.springframework.security.config.annotation.web.servlet.configuration.
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
@Import(AuthenticationConfiguration.class) @Import(AuthenticationConfiguration.class)
@Configuration
public @interface EnableGlobalAuthentication { public @interface EnableGlobalAuthentication {
} }

View File

@ -23,7 +23,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.AdviceMode; import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.security.access.annotation.Secured; import org.springframework.security.access.annotation.Secured;
@ -49,7 +48,6 @@ import org.springframework.security.config.annotation.authentication.configurati
@Documented @Documented
@Import({ GlobalMethodSecuritySelector.class }) @Import({ GlobalMethodSecuritySelector.class })
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Configuration
public @interface EnableGlobalMethodSecurity { public @interface EnableGlobalMethodSecurity {
/** /**

View File

@ -23,7 +23,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.AdviceMode; import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.access.annotation.Secured; import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PostAuthorize; import org.springframework.security.access.prepost.PostAuthorize;
@ -41,7 +40,6 @@ import org.springframework.security.access.prepost.PreFilter;
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
@Import(MethodSecuritySelector.class) @Import(MethodSecuritySelector.class)
@Configuration
public @interface EnableMethodSecurity { public @interface EnableMethodSecurity {
/** /**

View File

@ -23,7 +23,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.AdviceMode; import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
@ -36,7 +35,6 @@ import org.springframework.core.Ordered;
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
@Import(ReactiveMethodSecuritySelector.class) @Import(ReactiveMethodSecuritySelector.class)
@Configuration
public @interface EnableReactiveMethodSecurity { public @interface EnableReactiveMethodSecurity {
/** /**

View File

@ -55,6 +55,7 @@ import org.springframework.security.rsocket.util.matcher.RoutePayloadExchangeMat
* A minimal example can be found below: * A minimal example can be found below:
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableRSocketSecurity * &#064;EnableRSocketSecurity
* public class SecurityConfig { * public class SecurityConfig {
* &#064;Bean * &#064;Bean
@ -82,6 +83,7 @@ import org.springframework.security.rsocket.util.matcher.RoutePayloadExchangeMat
* A more advanced configuration can be seen below: * A more advanced configuration can be seen below:
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableRSocketSecurity * &#064;EnableRSocketSecurity
* public class SecurityConfig { * public class SecurityConfig {
* &#064;Bean * &#064;Bean

View File

@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.authentication.configuration.EnableGlobalAuthentication; import org.springframework.security.config.annotation.authentication.configuration.EnableGlobalAuthentication;
import org.springframework.security.config.annotation.web.WebSecurityConfigurer; import org.springframework.security.config.annotation.web.WebSecurityConfigurer;
@ -86,7 +85,6 @@ import org.springframework.security.web.SecurityFilterChain;
@Import({ WebSecurityConfiguration.class, SpringWebMvcImportSelector.class, OAuth2ImportSelector.class, @Import({ WebSecurityConfiguration.class, SpringWebMvcImportSelector.class, OAuth2ImportSelector.class,
HttpSecurityConfiguration.class }) HttpSecurityConfiguration.class })
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Configuration
public @interface EnableWebSecurity { public @interface EnableWebSecurity {
/** /**

View File

@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity;
@ -34,6 +33,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity;
* A minimal configuration can be found below: * A minimal configuration can be found below:
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableWebFluxSecurity * &#064;EnableWebFluxSecurity
* public class MyMinimalSecurityConfiguration { * public class MyMinimalSecurityConfiguration {
* *
@ -53,6 +53,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity;
* {@code ServerHttpSecurity}. * {@code ServerHttpSecurity}.
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableWebFluxSecurity * &#064;EnableWebFluxSecurity
* public class MyExplicitSecurityConfiguration { * public class MyExplicitSecurityConfiguration {
* &#064;Bean * &#064;Bean
@ -86,7 +87,6 @@ import org.springframework.security.config.web.server.ServerHttpSecurity;
@Documented @Documented
@Import({ ServerHttpSecurityConfiguration.class, WebFluxSecurityConfiguration.class, @Import({ ServerHttpSecurityConfiguration.class, WebFluxSecurityConfiguration.class,
ReactiveOAuth2ClientImportSelector.class }) ReactiveOAuth2ClientImportSelector.class })
@Configuration
public @interface EnableWebFluxSecurity { public @interface EnableWebFluxSecurity {
} }

View File

@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.authentication.configuration.EnableGlobalAuthentication; import org.springframework.security.config.annotation.authentication.configuration.EnableGlobalAuthentication;
@ -39,7 +38,6 @@ import org.springframework.security.config.annotation.authentication.configurati
@Documented @Documented
@Import(WebMvcSecurityConfiguration.class) @Import(WebMvcSecurityConfiguration.class)
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Configuration
@Deprecated @Deprecated
public @interface EnableWebMvcSecurity { public @interface EnableWebMvcSecurity {

View File

@ -200,6 +200,7 @@ import org.springframework.web.server.WebFilterChain;
* A minimal configuration can be found below: * A minimal configuration can be found below:
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableWebFluxSecurity * &#064;EnableWebFluxSecurity
* public class MyMinimalSecurityConfiguration { * public class MyMinimalSecurityConfiguration {
* *
@ -219,6 +220,7 @@ import org.springframework.web.server.WebFilterChain;
* {@code ServerHttpSecurity}. * {@code ServerHttpSecurity}.
* *
* <pre class="code"> * <pre class="code">
* &#064;Configuration
* &#064;EnableWebFluxSecurity * &#064;EnableWebFluxSecurity
* public class MyExplicitSecurityConfiguration { * public class MyExplicitSecurityConfiguration {
* *

View File

@ -32,6 +32,7 @@ import jakarta.servlet.http.HttpServletRequest
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -82,6 +83,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -122,6 +124,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -151,6 +154,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -179,6 +183,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -208,6 +213,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -240,6 +246,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -268,6 +275,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -297,6 +305,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -327,6 +336,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -355,6 +365,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -386,6 +397,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -414,6 +426,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -443,6 +456,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -470,6 +484,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -496,6 +511,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -524,6 +540,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -549,6 +566,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -579,6 +597,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -607,6 +626,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -637,6 +657,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -665,6 +686,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -691,6 +713,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -719,6 +742,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -746,6 +770,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -773,6 +798,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -799,6 +825,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -826,6 +853,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -852,6 +880,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -879,6 +908,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -913,6 +943,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *

View File

@ -64,6 +64,7 @@ class OAuth2ClientDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *

View File

@ -95,6 +95,7 @@ class OAuth2LoginDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -124,6 +125,7 @@ class OAuth2LoginDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -153,6 +155,7 @@ class OAuth2LoginDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -182,6 +185,7 @@ class OAuth2LoginDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *

View File

@ -55,6 +55,7 @@ class OAuth2ResourceServerDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -83,6 +84,7 @@ class OAuth2ResourceServerDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *

View File

@ -50,6 +50,7 @@ class SessionManagementDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *
@ -77,6 +78,7 @@ class SessionManagementDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebSecurity * @EnableWebSecurity
* class SecurityConfig : WebSecurityConfigurerAdapter() { * class SecurityConfig : WebSecurityConfigurerAdapter() {
* *

View File

@ -29,6 +29,7 @@ import org.springframework.web.server.WebFilter
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -72,6 +73,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -100,6 +102,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -125,6 +128,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -150,6 +154,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -175,6 +180,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -204,6 +210,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -234,6 +241,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -261,6 +269,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -291,6 +300,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -325,6 +335,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -354,6 +365,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -385,6 +397,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -414,6 +427,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -441,6 +455,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -467,6 +482,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -493,6 +509,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -521,6 +538,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -551,6 +569,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -579,6 +598,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -607,6 +627,7 @@ class ServerHttpSecurityDsl(private val http: ServerHttpSecurity, private val in
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *

View File

@ -51,6 +51,7 @@ class ServerOAuth2ResourceServerDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *
@ -80,6 +81,7 @@ class ServerOAuth2ResourceServerDsl {
* Example: * Example:
* *
* ``` * ```
* @Configuration
* @EnableWebFluxSecurity * @EnableWebFluxSecurity
* class SecurityConfig { * class SecurityConfig {
* *

View File

@ -165,6 +165,7 @@ public class AuthenticationManagerBuilderTests {
.andExpect(authenticated().withUsername("joe").withRoles("USER")); .andExpect(authenticated().withUsername("joe").withRoles("USER"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MultiAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter { static class MultiAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter {
@ -182,6 +183,7 @@ public class AuthenticationManagerBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderGlobalConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderGlobalConfig extends WebSecurityConfigurerAdapter {
@ -201,6 +203,7 @@ public class AuthenticationManagerBuilderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -73,6 +74,7 @@ public class NamespaceAuthenticationManagerTests {
this.mockMvc.perform(formLogin()).andExpect(notNullCredentials); this.mockMvc.perform(formLogin()).andExpect(notNullCredentials);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EraseCredentialsTrueDefaultConfig extends WebSecurityConfigurerAdapter { static class EraseCredentialsTrueDefaultConfig extends WebSecurityConfigurerAdapter {
@ -87,6 +89,7 @@ public class NamespaceAuthenticationManagerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EraseCredentialsFalseConfig extends WebSecurityConfigurerAdapter { static class EraseCredentialsFalseConfig extends WebSecurityConfigurerAdapter {
@ -102,6 +105,7 @@ public class NamespaceAuthenticationManagerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class GlobalEraseCredentialsFalseConfig extends WebSecurityConfigurerAdapter { static class GlobalEraseCredentialsFalseConfig extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@ -60,6 +61,7 @@ public class NamespaceAuthenticationProviderTests {
this.mockMvc.perform(formLogin()).andExpect(authenticated().withUsername("user")); this.mockMvc.perform(formLogin()).andExpect(authenticated().withUsername("user"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationProviderRefConfig extends WebSecurityConfigurerAdapter { static class AuthenticationProviderRefConfig extends WebSecurityConfigurerAdapter {
@ -80,6 +82,7 @@ public class NamespaceAuthenticationProviderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UserServiceRefConfig extends WebSecurityConfigurerAdapter { static class UserServiceRefConfig extends WebSecurityConfigurerAdapter {

View File

@ -70,6 +70,7 @@ public class NamespaceJdbcUserServiceTests {
this.mockMvc.perform(formLogin()).andExpect(dba); this.mockMvc.perform(formLogin()).andExpect(dba);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class JdbcUserServiceConfig extends WebSecurityConfigurerAdapter { static class JdbcUserServiceConfig extends WebSecurityConfigurerAdapter {
@ -100,6 +101,7 @@ public class NamespaceJdbcUserServiceTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomJdbcUserServiceSampleConfig extends WebSecurityConfigurerAdapter { static class CustomJdbcUserServiceSampleConfig extends WebSecurityConfigurerAdapter {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -68,6 +69,7 @@ public class NamespacePasswordEncoderTests {
this.mockMvc.perform(formLogin()).andExpect(authenticated()); this.mockMvc.perform(formLogin()).andExpect(authenticated());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderWithInMemoryConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderWithInMemoryConfig extends WebSecurityConfigurerAdapter {
@ -84,6 +86,7 @@ public class NamespacePasswordEncoderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderWithJdbcConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderWithJdbcConfig extends WebSecurityConfigurerAdapter {
@ -108,6 +111,7 @@ public class NamespacePasswordEncoderTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderWithUserDetailsServiceConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderWithUserDetailsServiceConfig extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -55,6 +56,7 @@ public class PasswordEncoderConfigurerTests {
this.mockMvc.perform(formLogin()).andExpect(authenticated()); this.mockMvc.perform(formLogin()).andExpect(authenticated());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderConfig extends WebSecurityConfigurerAdapter {
@ -80,6 +82,7 @@ public class PasswordEncoderConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordEncoderNoAuthManagerLoadsConfig extends WebSecurityConfigurerAdapter { static class PasswordEncoderNoAuthManagerLoadsConfig extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationEventPublisher; import org.springframework.security.authentication.AuthenticationEventPublisher;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
@ -57,6 +58,7 @@ public class AuthenticationConfigurationPublishTests {
this.authenticationManager = authenticationConfiguration.getAuthenticationManager(); this.authenticationManager = authenticationConfiguration.getAuthenticationManager();
} }
@Configuration
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class Config { static class Config {

View File

@ -296,16 +296,19 @@ public class AuthenticationConfigurationTests {
assertThatExceptionOfType(AlreadyBuiltException.class).isThrownBy(ap::build); assertThatExceptionOfType(AlreadyBuiltException.class).isThrownBy(ap::build);
} }
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true) @EnableGlobalMethodSecurity(securedEnabled = true)
static class GlobalMethodSecurityAutowiredConfig { static class GlobalMethodSecurityAutowiredConfig {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityConfig { static class WebSecurityConfig {
} }
@Configuration
@EnableWebMvcSecurity @EnableWebMvcSecurity
static class WebMvcSecurityConfig { static class WebMvcSecurityConfig {

View File

@ -72,6 +72,7 @@ public class EnableGlobalAuthenticationTests {
} }
@Configuration
@EnableGlobalAuthentication @EnableGlobalAuthentication
static class BeanProxyEnabledByDefaultConfig { static class BeanProxyEnabledByDefaultConfig {

View File

@ -39,9 +39,9 @@ import org.springframework.util.Assert;
* @author Rob Winch * @author Rob Winch
* *
*/ */
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter { public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired

View File

@ -28,6 +28,7 @@ import reactor.util.context.Context;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.context.ReactiveSecurityContextHolder;
@ -402,6 +403,7 @@ public class EnableReactiveMethodSecurityTests {
return publisher(Flux.just(data)); return publisher(Flux.just(data));
} }
@Configuration
@EnableReactiveMethodSecurity @EnableReactiveMethodSecurity
static class Config { static class Config {

View File

@ -277,11 +277,13 @@ public class GlobalMethodSecurityConfigurationTests {
assertThat(methodInterceptor.getSecurityMetadataSource()).isSameAs(methodSecurityMetadataSource); assertThat(methodInterceptor.getSecurityMetadataSource()).isSameAs(methodSecurityMetadataSource);
} }
@Configuration
@EnableGlobalMethodSecurity @EnableGlobalMethodSecurity
public static class IllegalStateGlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration { public static class IllegalStateGlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration {
} }
@Configuration
@EnableGlobalMethodSecurity @EnableGlobalMethodSecurity
public static class CustomMetadataSourceConfig extends GlobalMethodSecurityConfiguration { public static class CustomMetadataSourceConfig extends GlobalMethodSecurityConfiguration {
@ -293,6 +295,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class InMemoryAuthWithGlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration { public static class InMemoryAuthWithGlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration {
@ -312,6 +315,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class CustomTrustResolverConfig { static class CustomTrustResolverConfig {
@ -327,6 +331,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, proxyTargetClass = true) @EnableGlobalMethodSecurity(prePostEnabled = true, proxyTargetClass = true)
static class ExpressionHandlerHasBeanResolverSetConfig { static class ExpressionHandlerHasBeanResolverSetConfig {
@ -342,6 +347,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class MethodSecurityServiceConfig { static class MethodSecurityServiceConfig {
@ -352,6 +358,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class AutowirePermissionEvaluatorConfig { public static class AutowirePermissionEvaluatorConfig {
@ -367,6 +374,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class MultiPermissionEvaluatorConfig { public static class MultiPermissionEvaluatorConfig {
@ -387,6 +395,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class ParentConfig { static class ParentConfig {
@ -407,6 +416,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class Sec2479ChildConfig { static class Sec2479ChildConfig {
@ -417,6 +427,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class Sec2815Config { static class Sec2815Config {
@ -450,6 +461,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class Sec9845Config { static class Sec9845Config {
@ -486,6 +498,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.ASPECTJ) @EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.ASPECTJ)
@EnableTransactionManagement @EnableTransactionManagement
static class Sec3005Config { static class Sec3005Config {
@ -518,8 +531,8 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public static class RoleHierarchyConfig { public static class RoleHierarchyConfig {
@Bean @Bean
@ -536,6 +549,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class CustomGrantedAuthorityConfig { static class CustomGrantedAuthorityConfig {
@ -564,6 +578,7 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true) @EnableGlobalMethodSecurity(securedEnabled = true)
static class EmptyRolePrefixGrantedAuthorityConfig { static class EmptyRolePrefixGrantedAuthorityConfig {
@ -592,8 +607,8 @@ public class GlobalMethodSecurityConfigurationTests {
} }
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public static class CustomMetadataSourceBeanProxyEnabledConfig extends GlobalMethodSecurityConfiguration { public static class CustomMetadataSourceBeanProxyEnabledConfig extends GlobalMethodSecurityConfiguration {
} }

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
@ -66,6 +67,7 @@ public class NamespaceGlobalMethodSecurityExpressionHandlerTests {
.isThrownBy(() -> this.service.postHasPermission("denied")); .isThrownBy(() -> this.service.postHasPermission("denied"));
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class CustomAccessDecisionManagerConfig extends GlobalMethodSecurityConfiguration { public static class CustomAccessDecisionManagerConfig extends GlobalMethodSecurityConfiguration {

View File

@ -234,6 +234,7 @@ public class NamespaceGlobalMethodSecurityTests {
assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(() -> this.service.preAuthorize()); assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(() -> this.service.preAuthorize());
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public static class CustomAccessDecisionManagerConfig extends GlobalMethodSecurityConfiguration { public static class CustomAccessDecisionManagerConfig extends GlobalMethodSecurityConfiguration {
@ -264,6 +265,7 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class CustomAfterInvocationManagerConfig extends GlobalMethodSecurityConfiguration { public static class CustomAfterInvocationManagerConfig extends GlobalMethodSecurityConfiguration {
@ -294,6 +296,7 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class CustomAuthenticationConfig extends GlobalMethodSecurityConfiguration { public static class CustomAuthenticationConfig extends GlobalMethodSecurityConfiguration {
@ -313,12 +316,13 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@EnableGlobalMethodSecurity(jsr250Enabled = true)
@Configuration @Configuration
@EnableGlobalMethodSecurity(jsr250Enabled = true)
public static class Jsr250Config { public static class Jsr250Config {
} }
@Configuration
@EnableGlobalMethodSecurity @EnableGlobalMethodSecurity
public static class CustomMethodSecurityMetadataSourceConfig extends GlobalMethodSecurityConfiguration { public static class CustomMethodSecurityMetadataSourceConfig extends GlobalMethodSecurityConfiguration {
@ -342,11 +346,13 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, securedEnabled = true) @EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, securedEnabled = true)
public static class AspectJModeConfig { public static class AspectJModeConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, securedEnabled = true) @EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, securedEnabled = true)
public static class AspectJModeExtendsGMSCConfig extends GlobalMethodSecurityConfiguration { public static class AspectJModeExtendsGMSCConfig extends GlobalMethodSecurityConfiguration {
@ -380,44 +386,52 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(order = -135, jsr250Enabled = true) @EnableGlobalMethodSecurity(order = -135, jsr250Enabled = true)
@Import(AdvisorOrderConfig.class) @Import(AdvisorOrderConfig.class)
public static class CustomOrderConfig { public static class CustomOrderConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(jsr250Enabled = true) @EnableGlobalMethodSecurity(jsr250Enabled = true)
@Import(AdvisorOrderConfig.class) @Import(AdvisorOrderConfig.class)
public static class DefaultOrderConfig { public static class DefaultOrderConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(jsr250Enabled = true) @EnableGlobalMethodSecurity(jsr250Enabled = true)
@Import(AdvisorOrderConfig.class) @Import(AdvisorOrderConfig.class)
public static class DefaultOrderExtendsMethodSecurityConfig extends GlobalMethodSecurityConfiguration { public static class DefaultOrderExtendsMethodSecurityConfig extends GlobalMethodSecurityConfiguration {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class PreAuthorizeConfig { public static class PreAuthorizeConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class PreAuthorizeExtendsGMSCConfig extends GlobalMethodSecurityConfiguration { public static class PreAuthorizeExtendsGMSCConfig extends GlobalMethodSecurityConfiguration {
} }
@Configuration
@EnableGlobalMethodSecurity(proxyTargetClass = true, prePostEnabled = true) @EnableGlobalMethodSecurity(proxyTargetClass = true, prePostEnabled = true)
public static class ProxyTargetClassConfig { public static class ProxyTargetClassConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class DefaultProxyConfig { public static class DefaultProxyConfig {
} }
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true) @EnableGlobalMethodSecurity(securedEnabled = true)
public static class CustomRunAsManagerConfig extends GlobalMethodSecurityConfiguration { public static class CustomRunAsManagerConfig extends GlobalMethodSecurityConfiguration {
@ -430,6 +444,7 @@ public class NamespaceGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true) @EnableGlobalMethodSecurity(securedEnabled = true)
public static class SecuredConfig { public static class SecuredConfig {

View File

@ -406,6 +406,7 @@ public class PrePostMethodSecurityConfigurationTests {
this.methodSecurityService.preAuthorizeBean(true); this.methodSecurityService.preAuthorizeBean(true);
} }
@Configuration
@EnableMethodSecurity @EnableMethodSecurity
static class MethodSecurityServiceConfig { static class MethodSecurityServiceConfig {
@ -421,6 +422,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity(jsr250Enabled = true) @EnableMethodSecurity(jsr250Enabled = true)
static class BusinessServiceConfig { static class BusinessServiceConfig {
@ -431,6 +433,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity(prePostEnabled = false, securedEnabled = true) @EnableMethodSecurity(prePostEnabled = false, securedEnabled = true)
static class SecuredConfig { static class SecuredConfig {
@ -441,6 +444,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity(prePostEnabled = false, jsr250Enabled = true) @EnableMethodSecurity(prePostEnabled = false, jsr250Enabled = true)
static class Jsr250Config { static class Jsr250Config {
@ -451,6 +455,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true) @EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true)
static class MethodSecurityServiceEnabledConfig { static class MethodSecurityServiceEnabledConfig {
@ -461,6 +466,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity @EnableMethodSecurity
static class CustomPermissionEvaluatorConfig { static class CustomPermissionEvaluatorConfig {
@ -485,6 +491,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity @EnableMethodSecurity
static class CustomGrantedAuthorityDefaultsConfig { static class CustomGrantedAuthorityDefaultsConfig {
@ -495,6 +502,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity @EnableMethodSecurity
static class CustomAuthorizationManagerBeforeAdviceConfig { static class CustomAuthorizationManagerBeforeAdviceConfig {
@ -513,6 +521,7 @@ public class PrePostMethodSecurityConfigurationTests {
} }
@Configuration
@EnableMethodSecurity @EnableMethodSecurity
static class CustomAuthorizationManagerAfterAdviceConfig { static class CustomAuthorizationManagerAfterAdviceConfig {

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
@ -75,6 +76,7 @@ public class SampleEnableGlobalMethodSecurityTests {
.isThrownBy(() -> this.methodSecurityService.hasPermission("denied")); .isThrownBy(() -> this.methodSecurityService.hasPermission("denied"));
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
static class SampleWebSecurityConfig { static class SampleWebSecurityConfig {
@ -95,6 +97,7 @@ public class SampleEnableGlobalMethodSecurityTests {
} }
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public static class CustomPermissionEvaluatorWebSecurityConfig extends GlobalMethodSecurityConfiguration { public static class CustomPermissionEvaluatorWebSecurityConfig extends GlobalMethodSecurityConfiguration {

View File

@ -24,6 +24,7 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.core.PriorityOrdered; import org.springframework.core.PriorityOrdered;
import org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource; import org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource;
@ -77,6 +78,7 @@ public class Sec2758Tests {
this.service.doPreAuthorize(); this.service.doPreAuthorize();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true)
static class SecurityConfig extends WebSecurityConfigurerAdapter { static class SecurityConfig extends WebSecurityConfigurerAdapter {

View File

@ -19,6 +19,7 @@ package org.springframework.security.config.annotation.web;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.annotation.Configuration;
import org.springframework.mock.web.MockServletContext; import org.springframework.mock.web.MockServletContext;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -73,6 +74,7 @@ public class AbstractRequestMatcherRegistryAnyMatcherTests {
context.refresh(); context.refresh();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AntMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter { static class AntMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
@ -88,6 +90,7 @@ public class AbstractRequestMatcherRegistryAnyMatcherTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MvcMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter { static class MvcMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
@ -103,6 +106,7 @@ public class AbstractRequestMatcherRegistryAnyMatcherTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RegexMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter { static class RegexMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
@ -118,6 +122,7 @@ public class AbstractRequestMatcherRegistryAnyMatcherTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnyRequestAfterItselfConfig extends WebSecurityConfigurerAdapter { static class AnyRequestAfterItselfConfig extends WebSecurityConfigurerAdapter {
@ -133,6 +138,7 @@ public class AbstractRequestMatcherRegistryAnyMatcherTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter { static class RequestMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {

View File

@ -86,6 +86,7 @@ public class HttpSecurityHeadersTests {
// @formatter:on // @formatter:on
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityConfig extends WebSecurityConfigurerAdapter { static class WebSecurityConfig extends WebSecurityConfigurerAdapter {

View File

@ -213,6 +213,7 @@ public class SampleWebSecurityConfigurerAdapterTests {
* *
* @author Rob Winch * @author Rob Winch
*/ */
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class HelloWorldWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { public static class HelloWorldWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@ -260,6 +261,7 @@ public class SampleWebSecurityConfigurerAdapterTests {
* *
* @author Rob Winch * @author Rob Winch
*/ */
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class SampleWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { public static class SampleWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@ -333,6 +335,7 @@ public class SampleWebSecurityConfigurerAdapterTests {
* *
* @author Rob Winch * @author Rob Winch
*/ */
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class SampleMultiHttpSecurityConfig { public static class SampleMultiHttpSecurityConfig {

View File

@ -27,6 +27,7 @@ import org.mockito.MockedStatic;
import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@ -110,6 +111,7 @@ public class WebSecurityConfigurerAdapterMockitoTests {
this.context = context; this.context = context;
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class Config extends WebSecurityConfigurerAdapter { static class Config extends WebSecurityConfigurerAdapter {
@ -137,6 +139,7 @@ public class WebSecurityConfigurerAdapterMockitoTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebAsyncPopulatedByDefaultConfig extends WebSecurityConfigurerAdapter { static class WebAsyncPopulatedByDefaultConfig extends WebSecurityConfigurerAdapter {

View File

@ -199,6 +199,7 @@ public class WebSecurityConfigurerAdapterTests {
any(Authentication.class)); any(Authentication.class));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersArePopulatedByDefaultConfig extends WebSecurityConfigurerAdapter { static class HeadersArePopulatedByDefaultConfig extends WebSecurityConfigurerAdapter {
@ -217,6 +218,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InMemoryAuthWithWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter static class InMemoryAuthWithWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter
implements ApplicationListener<AuthenticationSuccessEvent> { implements ApplicationListener<AuthenticationSuccessEvent> {
@ -239,6 +241,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InMemoryConfigureProtectedConfig extends WebSecurityConfigurerAdapter { static class InMemoryConfigureProtectedConfig extends WebSecurityConfigurerAdapter {
@ -259,6 +262,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InMemoryConfigureGlobalConfig extends WebSecurityConfigurerAdapter { static class InMemoryConfigureGlobalConfig extends WebSecurityConfigurerAdapter {
@ -279,6 +283,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class OverrideContentNegotiationStrategySharedObjectConfig extends WebSecurityConfigurerAdapter { static class OverrideContentNegotiationStrategySharedObjectConfig extends WebSecurityConfigurerAdapter {
@ -299,6 +304,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentNegotiationStrategyDefaultSharedObjectConfig extends WebSecurityConfigurerAdapter { static class ContentNegotiationStrategyDefaultSharedObjectConfig extends WebSecurityConfigurerAdapter {
@ -322,6 +328,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UserDetailsServiceConfig extends WebSecurityConfigurerAdapter { static class UserDetailsServiceConfig extends WebSecurityConfigurerAdapter {
@ -366,6 +373,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ApplicationContextSharedObjectConfig extends WebSecurityConfigurerAdapter { static class ApplicationContextSharedObjectConfig extends WebSecurityConfigurerAdapter {
@ -379,6 +387,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomTrustResolverConfig extends WebSecurityConfigurerAdapter { static class CustomTrustResolverConfig extends WebSecurityConfigurerAdapter {
@ -408,6 +417,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthenticationEventPublisherBean extends WebSecurityConfigurerAdapter { static class CustomAuthenticationEventPublisherBean extends WebSecurityConfigurerAdapter {
@ -424,6 +434,7 @@ public class WebSecurityConfigurerAdapterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthenticationEventPublisherDsl extends WebSecurityConfigurerAdapter { static class CustomAuthenticationEventPublisherDsl extends WebSecurityConfigurerAdapter {

View File

@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -72,6 +73,7 @@ public class HttpConfigurationTests {
this.mockMvc.perform(get("/api/b")).andExpect(status().isUnauthorized()); this.mockMvc.perform(get("/api/b")).andExpect(status().isUnauthorized());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UnregisteredFilterConfig extends WebSecurityConfigurerAdapter { static class UnregisteredFilterConfig extends WebSecurityConfigurerAdapter {
@ -104,6 +106,7 @@ public class HttpConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherRegistryConfigs extends WebSecurityConfigurerAdapter { static class RequestMatcherRegistryConfigs extends WebSecurityConfigurerAdapter {

View File

@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContext;
@ -151,6 +152,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyFilterMultipleAfterConfig extends WebSecurityConfigurerAdapter { static class MyFilterMultipleAfterConfig extends WebSecurityConfigurerAdapter {
@ -165,6 +167,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyFilterMultipleBeforeConfig extends WebSecurityConfigurerAdapter { static class MyFilterMultipleBeforeConfig extends WebSecurityConfigurerAdapter {
@ -179,6 +182,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyFilterMultipleAtConfig extends WebSecurityConfigurerAdapter { static class MyFilterMultipleAtConfig extends WebSecurityConfigurerAdapter {
@ -193,6 +197,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyOtherFilterRelativeToMyFilterAfterConfig { static class MyOtherFilterRelativeToMyFilterAfterConfig {
@ -208,6 +213,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyOtherFilterRelativeToMyFilterBeforeConfig { static class MyOtherFilterRelativeToMyFilterBeforeConfig {
@ -223,6 +229,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyOtherFilterRelativeToMyFilterAtConfig { static class MyOtherFilterRelativeToMyFilterAtConfig {
@ -238,6 +245,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyOtherFilterBeforeToMyFilterMultipleAfterConfig { static class MyOtherFilterBeforeToMyFilterMultipleAfterConfig {
@ -254,6 +262,7 @@ public class HttpSecurityAddFilterTest {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MyAnotherFilterRelativeToMyCustomFiltersMultipleConfig { static class MyAnotherFilterRelativeToMyCustomFiltersMultipleConfig {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -73,6 +74,7 @@ public class HttpSecurityAuthenticationManagerTests {
verifyNoInteractions(AuthenticationManagerBuilderConfig.USER_DETAILS_SERVICE); verifyNoInteractions(AuthenticationManagerBuilderConfig.USER_DETAILS_SERVICE);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationManagerConfig extends WebSecurityConfigurerAdapter { static class AuthenticationManagerConfig extends WebSecurityConfigurerAdapter {
@ -92,6 +94,7 @@ public class HttpSecurityAuthenticationManagerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationManagerBuilderConfig extends WebSecurityConfigurerAdapter { static class AuthenticationManagerBuilderConfig extends WebSecurityConfigurerAdapter {

View File

@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDecisionManager; import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
@ -275,6 +276,7 @@ public class NamespaceHttpTests {
.isAssignableFrom(config.filterInvocationSecurityMetadataSourceType); .isAssignableFrom(config.filterInvocationSecurityMetadataSourceType);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDecisionManagerRefConfig extends WebSecurityConfigurerAdapter { static class AccessDecisionManagerRefConfig extends WebSecurityConfigurerAdapter {
@ -292,6 +294,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedPageConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedPageConfig extends WebSecurityConfigurerAdapter {
@ -310,6 +313,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationManagerRefConfig extends WebSecurityConfigurerAdapter { static class AuthenticationManagerRefConfig extends WebSecurityConfigurerAdapter {
@ -333,6 +337,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CreateSessionAlwaysConfig extends WebSecurityConfigurerAdapter { static class CreateSessionAlwaysConfig extends WebSecurityConfigurerAdapter {
@ -350,6 +355,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CreateSessionStatelessConfig extends WebSecurityConfigurerAdapter { static class CreateSessionStatelessConfig extends WebSecurityConfigurerAdapter {
@ -367,6 +373,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IfRequiredConfig extends WebSecurityConfigurerAdapter { static class IfRequiredConfig extends WebSecurityConfigurerAdapter {
@ -387,6 +394,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CreateSessionNeverConfig extends WebSecurityConfigurerAdapter { static class CreateSessionNeverConfig extends WebSecurityConfigurerAdapter {
@ -404,6 +412,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EntryPointRefConfig extends WebSecurityConfigurerAdapter { static class EntryPointRefConfig extends WebSecurityConfigurerAdapter {
@ -423,6 +432,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class JaasApiProvisionConfig extends WebSecurityConfigurerAdapter { static class JaasApiProvisionConfig extends WebSecurityConfigurerAdapter {
@ -436,6 +446,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RealmConfig extends WebSecurityConfigurerAdapter { static class RealmConfig extends WebSecurityConfigurerAdapter {
@ -453,6 +464,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherAntConfig extends WebSecurityConfigurerAdapter { static class RequestMatcherAntConfig extends WebSecurityConfigurerAdapter {
@ -466,6 +478,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherRegexConfig extends WebSecurityConfigurerAdapter { static class RequestMatcherRegexConfig extends WebSecurityConfigurerAdapter {
@ -479,6 +492,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherRefConfig extends WebSecurityConfigurerAdapter { static class RequestMatcherRefConfig extends WebSecurityConfigurerAdapter {
@ -501,6 +515,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityNoneConfig extends WebSecurityConfigurerAdapter { static class SecurityNoneConfig extends WebSecurityConfigurerAdapter {
@ -515,6 +530,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityContextRepoConfig extends WebSecurityConfigurerAdapter { static class SecurityContextRepoConfig extends WebSecurityConfigurerAdapter {
@ -543,6 +559,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ServletApiProvisionConfig extends WebSecurityConfigurerAdapter { static class ServletApiProvisionConfig extends WebSecurityConfigurerAdapter {
@ -560,6 +577,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ServletApiProvisionDefaultsConfig extends WebSecurityConfigurerAdapter { static class ServletApiProvisionDefaultsConfig extends WebSecurityConfigurerAdapter {
@ -587,6 +605,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UseExpressionsConfig extends WebSecurityConfigurerAdapter { static class UseExpressionsConfig extends WebSecurityConfigurerAdapter {
@ -616,6 +635,7 @@ public class NamespaceHttpTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DisableUseExpressionsConfig extends WebSecurityConfigurerAdapter { static class DisableUseExpressionsConfig extends WebSecurityConfigurerAdapter {

View File

@ -237,6 +237,7 @@ public class WebSecurityTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestRejectedHandlerConfig extends WebSecurityConfigurerAdapter { static class RequestRejectedHandlerConfig extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.annotation.AuthenticationPrincipal;
@ -75,6 +76,7 @@ public class AuthenticationPrincipalArgumentResolverTests {
// @formatter:on // @formatter:on
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class Config { static class Config {

View File

@ -100,6 +100,7 @@ public class EnableWebSecurityTests {
assertThat(parentBean.getChild()).isNotSameAs(childBean); assertThat(parentBean.getChild()).isNotSameAs(childBean);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityConfig extends WebSecurityConfigurerAdapter { static class SecurityConfig extends WebSecurityConfigurerAdapter {
@ -136,11 +137,13 @@ public class EnableWebSecurityTests {
} }
@Configuration
@EnableWebSecurity(debug = true) @EnableWebSecurity(debug = true)
static class DebugSecurityConfig extends WebSecurityConfigurerAdapter { static class DebugSecurityConfig extends WebSecurityConfigurerAdapter {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class AuthenticationPrincipalConfig extends WebSecurityConfigurerAdapter { static class AuthenticationPrincipalConfig extends WebSecurityConfigurerAdapter {
@ -161,6 +164,7 @@ public class EnableWebSecurityTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class SecurityFilterChainAuthenticationPrincipalConfig { static class SecurityFilterChainAuthenticationPrincipalConfig {
@ -182,6 +186,7 @@ public class EnableWebSecurityTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BeanProxyEnabledByDefaultConfig extends WebSecurityConfigurerAdapter { static class BeanProxyEnabledByDefaultConfig extends WebSecurityConfigurerAdapter {

View File

@ -269,6 +269,7 @@ public class HttpSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultWithFilterChainConfig { static class DefaultWithFilterChainConfig {
@ -279,6 +280,7 @@ public class HttpSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthorizeRequestsConfig { static class AuthorizeRequestsConfig {
@ -295,6 +297,7 @@ public class HttpSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityEnabledConfig { static class SecurityEnabledConfig {
@ -329,6 +332,7 @@ public class HttpSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthorizeHttpRequestsBeforeAuthorizeRequestsConfig { static class AuthorizeHttpRequestsBeforeAuthorizeRequestsConfig {
@ -348,6 +352,7 @@ public class HttpSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthorizeHttpRequestsAfterAuthorizeRequestsConfig { static class AuthorizeHttpRequestsAfterAuthorizeRequestsConfig {

View File

@ -25,6 +25,7 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.NoUniqueBeanDefinitionException; import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContext;
@ -212,6 +213,7 @@ public class OAuth2ClientConfigurationTests {
verifyNoInteractions(authorizedClientRepository); verifyNoInteractions(authorizedClientRepository);
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class OAuth2AuthorizedClientArgumentResolverConfig extends WebSecurityConfigurerAdapter { static class OAuth2AuthorizedClientArgumentResolverConfig extends WebSecurityConfigurerAdapter {
@ -252,6 +254,7 @@ public class OAuth2ClientConfigurationTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class OAuth2AuthorizedClientRepositoryRegisteredTwiceConfig extends WebSecurityConfigurerAdapter { static class OAuth2AuthorizedClientRepositoryRegisteredTwiceConfig extends WebSecurityConfigurerAdapter {
@ -289,6 +292,7 @@ public class OAuth2ClientConfigurationTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class ClientRegistrationRepositoryNotRegisteredConfig extends WebSecurityConfigurerAdapter { static class ClientRegistrationRepositoryNotRegisteredConfig extends WebSecurityConfigurerAdapter {
@ -306,6 +310,7 @@ public class OAuth2ClientConfigurationTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class ClientRegistrationRepositoryRegisteredTwiceConfig extends WebSecurityConfigurerAdapter { static class ClientRegistrationRepositoryRegisteredTwiceConfig extends WebSecurityConfigurerAdapter {
@ -343,6 +348,7 @@ public class OAuth2ClientConfigurationTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class AccessTokenResponseClientRegisteredTwiceConfig extends WebSecurityConfigurerAdapter { static class AccessTokenResponseClientRegisteredTwiceConfig extends WebSecurityConfigurerAdapter {
@ -380,6 +386,7 @@ public class OAuth2ClientConfigurationTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class OAuth2AuthorizedClientManagerRegisteredConfig extends WebSecurityConfigurerAdapter { static class OAuth2AuthorizedClientManagerRegisteredConfig extends WebSecurityConfigurerAdapter {

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.FatalBeanException; import org.springframework.beans.FatalBeanException;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContext;
@ -72,6 +73,7 @@ public class Sec2515Tests {
this.spring.register(SecurityConfig.class).autowire(); this.spring.register(SecurityConfig.class).autowire();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class StackOverflowSecurityConfig extends WebSecurityConfigurerAdapter { static class StackOverflowSecurityConfig extends WebSecurityConfigurerAdapter {
@ -83,6 +85,7 @@ public class Sec2515Tests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomBeanNameStackOverflowSecurityConfig extends WebSecurityConfigurerAdapter { static class CustomBeanNameStackOverflowSecurityConfig extends WebSecurityConfigurerAdapter {
@ -94,6 +97,7 @@ public class Sec2515Tests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CanLoadWithChildConfig extends WebSecurityConfigurerAdapter { static class CanLoadWithChildConfig extends WebSecurityConfigurerAdapter {
@ -107,6 +111,7 @@ public class Sec2515Tests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityConfig extends WebSecurityConfigurerAdapter { static class SecurityConfig extends WebSecurityConfigurerAdapter {

View File

@ -104,6 +104,7 @@ public class SecurityReactorContextConfigurationResourceServerTests {
verify(strategy, atLeastOnce()).getContext(); verify(strategy, atLeastOnce()).getContext();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BearerFilterConfig extends WebSecurityConfigurerAdapter { static class BearerFilterConfig extends WebSecurityConfigurerAdapter {
@ -120,6 +121,7 @@ public class SecurityReactorContextConfigurationResourceServerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BearerFilterlessConfig extends WebSecurityConfigurerAdapter { static class BearerFilterlessConfig extends WebSecurityConfigurerAdapter {

View File

@ -33,6 +33,7 @@ import reactor.core.publisher.Operators;
import reactor.test.StepVerifier; import reactor.test.StepVerifier;
import reactor.util.context.Context; import reactor.util.context.Context;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletRequest;
@ -268,6 +269,7 @@ public class SecurityReactorContextConfigurationTests {
verify(strategy, times(2)).getContext(); verify(strategy, times(2)).getContext();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SecurityConfig extends WebSecurityConfigurerAdapter { static class SecurityConfig extends WebSecurityConfigurerAdapter {

View File

@ -439,6 +439,7 @@ public class WebSecurityConfigurationTests {
assertThat(privilegeEvaluator.isAllowed("/another", user)).isTrue(); assertThat(privilegeEvaluator.isAllowed("/another", user)).isTrue();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class SortedWebSecurityConfigurerAdaptersConfig { static class SortedWebSecurityConfigurerAdaptersConfig {
@ -512,6 +513,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class SortedSecurityFilterChainConfig { static class SortedSecurityFilterChainConfig {
@ -568,6 +570,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class OrderOnBeanDefinitionsSecurityFilterChainConfig { static class OrderOnBeanDefinitionsSecurityFilterChainConfig {
@ -607,6 +610,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class DuplicateOrderConfig { static class DuplicateOrderConfig {
@ -643,6 +647,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PrivilegeEvaluatorConfigurerAdapterConfig extends WebSecurityConfigurerAdapter { static class PrivilegeEvaluatorConfigurerAdapterConfig extends WebSecurityConfigurerAdapter {
@ -655,6 +660,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityExpressionHandlerConfig extends WebSecurityConfigurerAdapter { static class WebSecurityExpressionHandlerConfig extends WebSecurityConfigurerAdapter {
@ -677,6 +683,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullWebSecurityExpressionHandlerConfig extends WebSecurityConfigurerAdapter { static class NullWebSecurityExpressionHandlerConfig extends WebSecurityConfigurerAdapter {
@ -687,6 +694,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityExpressionHandlerDefaultsConfig extends WebSecurityConfigurerAdapter { static class WebSecurityExpressionHandlerDefaultsConfig extends WebSecurityConfigurerAdapter {
@ -701,6 +709,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityExpressionHandlerRoleHierarchyBeanConfig extends WebSecurityConfigurerAdapter { static class WebSecurityExpressionHandlerRoleHierarchyBeanConfig extends WebSecurityConfigurerAdapter {
@ -713,6 +722,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityExpressionHandlerPermissionEvaluatorBeanConfig extends WebSecurityConfigurerAdapter { static class WebSecurityExpressionHandlerPermissionEvaluatorBeanConfig extends WebSecurityConfigurerAdapter {
@ -736,6 +746,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebInvocationPrivilegeEvaluatorDefaultsConfig extends WebSecurityConfigurerAdapter { static class WebInvocationPrivilegeEvaluatorDefaultsConfig extends WebSecurityConfigurerAdapter {
@ -750,6 +761,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthorizeRequestsFilterChainConfig { static class AuthorizeRequestsFilterChainConfig {
@ -766,6 +778,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultExpressionHandlerSetsBeanResolverConfig extends WebSecurityConfigurerAdapter { static class DefaultExpressionHandlerSetsBeanResolverConfig extends WebSecurityConfigurerAdapter {
@ -807,6 +820,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ParentConfig extends WebSecurityConfigurerAdapter { static class ParentConfig extends WebSecurityConfigurerAdapter {
@ -817,6 +831,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ChildConfig extends WebSecurityConfigurerAdapter { static class ChildConfig extends WebSecurityConfigurerAdapter {
@ -827,6 +842,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
@EnableGlobalAuthentication @EnableGlobalAuthentication
static class GlobalAuthenticationWebSecurityConfigurerAdaptersConfig { static class GlobalAuthenticationWebSecurityConfigurerAdaptersConfig {
@ -868,6 +884,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class AdapterAndFilterChainConfig { static class AdapterAndFilterChainConfig {
@ -904,6 +921,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class WebSecurityCustomizerConfig { static class WebSecurityCustomizerConfig {
@ -915,6 +933,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class CustomizerAndFilterChainConfig { static class CustomizerAndFilterChainConfig {
@ -938,6 +957,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class CustomizerAndAdapterConfig { static class CustomizerAndAdapterConfig {
@ -965,6 +985,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class CustomizerAndAdapterIgnoringConfig { static class CustomizerAndAdapterIgnoringConfig {
@ -986,6 +1007,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class OrderedCustomizerConfig { static class OrderedCustomizerConfig {
@ -1004,6 +1026,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MultipleAuthenticationManagersConfig { static class MultipleAuthenticationManagersConfig {
@ -1072,6 +1095,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class TwoSecurityFilterChainConfig { static class TwoSecurityFilterChainConfig {
@ -1095,6 +1119,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity(debug = true) @EnableWebSecurity(debug = true)
static class TwoSecurityFilterChainDebugConfig { static class TwoSecurityFilterChainDebugConfig {
@ -1118,6 +1143,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class MultipleSecurityFilterChainConfig { static class MultipleSecurityFilterChainConfig {
@ -1153,6 +1179,7 @@ public class WebSecurityConfigurationTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@Import(AuthenticationTestConfiguration.class) @Import(AuthenticationTestConfiguration.class)
static class MultipleSecurityFilterChainIgnoringConfig { static class MultipleSecurityFilterChainIgnoringConfig {

View File

@ -16,9 +16,11 @@
package org.springframework.security.config.annotation.web.configuration.sec2377.a; package org.springframework.security.config.annotation.web.configuration.sec2377.a;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity @EnableWebSecurity
public class Sec2377AConfig extends WebSecurityConfigurerAdapter { public class Sec2377AConfig extends WebSecurityConfigurerAdapter {

View File

@ -16,9 +16,11 @@
package org.springframework.security.config.annotation.web.configuration.sec2377.b; package org.springframework.security.config.annotation.web.configuration.sec2377.b;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity @EnableWebSecurity
public class Sec2377BConfig extends WebSecurityConfigurerAdapter { public class Sec2377BConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig; import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -89,6 +90,7 @@ public class AnonymousConfigurerTests {
this.mockMvc.perform(get("/")).andExpect(status().isOk()); this.mockMvc.perform(get("/")).andExpect(status().isOk());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter {
@ -107,6 +109,7 @@ public class AnonymousConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class AnonymousPrincipalInLambdaConfig extends WebSecurityConfigurerAdapter { static class AnonymousPrincipalInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -124,6 +127,7 @@ public class AnonymousConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousDisabledInLambdaConfig extends WebSecurityConfigurerAdapter { static class AnonymousDisabledInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -150,6 +154,7 @@ public class AnonymousConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousWithDefaultsInLambdaConfig extends WebSecurityConfigurerAdapter { static class AnonymousWithDefaultsInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -542,6 +542,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
this.mvc.perform(requestWithUser).andExpect(status().isForbidden()); this.mvc.perform(requestWithUser).andExpect(status().isForbidden());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoRequestsConfig { static class NoRequestsConfig {
@ -556,6 +557,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoRequestsNoParameterConfig { static class NoRequestsNoParameterConfig {
@ -571,6 +573,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IncompleteMappingConfig { static class IncompleteMappingConfig {
@ -585,6 +588,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IncompleteMappingNoParameterConfig { static class IncompleteMappingNoParameterConfig {
@ -601,6 +605,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AfterAnyRequestConfig { static class AfterAnyRequestConfig {
@ -618,6 +623,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthorizationManagerConfig { static class CustomAuthorizationManagerConfig {
@ -636,6 +642,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthorizationManagerNoParameterConfig { static class CustomAuthorizationManagerNoParameterConfig {
@ -654,6 +661,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig { static class ObjectPostProcessorConfig {
@ -686,6 +694,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserAnyAuthorityConfig { static class RoleUserAnyAuthorityConfig {
@ -704,6 +713,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserAuthorityConfig { static class RoleUserAuthorityConfig {
@ -722,6 +732,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrRoleAdminAuthorityConfig { static class RoleUserOrRoleAdminAuthorityConfig {
@ -740,6 +751,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserConfig { static class RoleUserConfig {
@ -756,6 +768,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrAdminConfig { static class RoleUserOrAdminConfig {
@ -772,6 +785,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DenyAllConfig { static class DenyAllConfig {
@ -790,6 +804,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermitAllConfig { static class PermitAllConfig {
@ -806,6 +821,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotResetConfig { static class InvokeTwiceDoesNotResetConfig {
@ -825,6 +841,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class ServletPathConfig { static class ServletPathConfig {
@ -842,6 +859,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticatedConfig { static class AuthenticatedConfig {
@ -860,6 +878,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ExpressionRoleUserConfig { static class ExpressionRoleUserConfig {
@ -876,6 +895,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ExpressionRoleUserOrAdminConfig { static class ExpressionRoleUserOrAdminConfig {
@ -892,6 +912,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ExpressionIpAddressLocalhostConfig { static class ExpressionIpAddressLocalhostConfig {
@ -937,6 +958,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FullyAuthenticatedConfig { static class FullyAuthenticatedConfig {
@ -960,6 +982,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeConfig { static class RememberMeConfig {
@ -983,6 +1006,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousConfig { static class AnonymousConfig {

View File

@ -25,6 +25,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
@ -128,6 +129,7 @@ public class ChannelSecurityConfigurerTests {
this.mvc.perform(get("/test-3")).andExpect(redirectedUrl("https://localhost/test-3")); this.mvc.perform(get("/test-3")).andExpect(redirectedUrl("https://localhost/test-3"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -158,6 +160,7 @@ public class ChannelSecurityConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DuplicateInvocationsDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class DuplicateInvocationsDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -174,6 +177,7 @@ public class ChannelSecurityConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequiresChannelInLambdaConfig extends WebSecurityConfigurerAdapter { static class RequiresChannelInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -190,6 +194,7 @@ public class ChannelSecurityConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequiresChannelWithTestUrlRedirectStrategy extends WebSecurityConfigurerAdapter { static class RequiresChannelWithTestUrlRedirectStrategy extends WebSecurityConfigurerAdapter {
@ -221,6 +226,7 @@ public class ChannelSecurityConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class RequiresChannelMultiMvcMatchersConfig { static class RequiresChannelMultiMvcMatchersConfig {
@ -248,6 +254,7 @@ public class ChannelSecurityConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class RequiresChannelMultiMvcMatchersInLambdaConfig { static class RequiresChannelMultiMvcMatchersInLambdaConfig {

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -181,6 +182,7 @@ public class CorsConfigurerTests {
.andExpect(header().exists("X-Content-Type-Options")); .andExpect(header().exists("X-Content-Type-Options"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultCorsConfig extends WebSecurityConfigurerAdapter { static class DefaultCorsConfig extends WebSecurityConfigurerAdapter {
@ -197,6 +199,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class MvcCorsConfig extends WebSecurityConfigurerAdapter { static class MvcCorsConfig extends WebSecurityConfigurerAdapter {
@ -225,6 +228,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
static class MvcCorsInLambdaConfig extends WebSecurityConfigurerAdapter { static class MvcCorsInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -254,6 +258,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ConfigSourceConfig extends WebSecurityConfigurerAdapter { static class ConfigSourceConfig extends WebSecurityConfigurerAdapter {
@ -280,6 +285,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ConfigSourceInLambdaConfig extends WebSecurityConfigurerAdapter { static class ConfigSourceInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -307,6 +313,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CorsFilterConfig extends WebSecurityConfigurerAdapter { static class CorsFilterConfig extends WebSecurityConfigurerAdapter {
@ -333,6 +340,7 @@ public class CorsConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CorsFilterInLambdaConfig extends WebSecurityConfigurerAdapter { static class CorsFilterInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -79,6 +80,7 @@ public class CsrfConfigurerIgnoringRequestMatchersTests {
this.mvc.perform(put("/no-csrf")).andExpect(status().isOk()); this.mvc.perform(put("/no-csrf")).andExpect(status().isOk());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IgnoringRequestMatchers extends WebSecurityConfigurerAdapter { static class IgnoringRequestMatchers extends WebSecurityConfigurerAdapter {
@ -96,6 +98,7 @@ public class CsrfConfigurerIgnoringRequestMatchersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IgnoringRequestInLambdaMatchers extends WebSecurityConfigurerAdapter { static class IgnoringRequestInLambdaMatchers extends WebSecurityConfigurerAdapter {
@ -115,6 +118,7 @@ public class CsrfConfigurerIgnoringRequestMatchersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IgnoringPathsAndMatchers extends WebSecurityConfigurerAdapter { static class IgnoringPathsAndMatchers extends WebSecurityConfigurerAdapter {
@ -132,6 +136,7 @@ public class CsrfConfigurerIgnoringRequestMatchersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IgnoringPathsAndMatchersInLambdaConfig extends WebSecurityConfigurerAdapter { static class IgnoringPathsAndMatchersInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -73,6 +74,7 @@ public class CsrfConfigurerNoWebMvcTests {
this.context = annotationConfigApplicationContext; this.context = annotationConfigApplicationContext;
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EnableWebConfig extends WebSecurityConfigurerAdapter { static class EnableWebConfig extends WebSecurityConfigurerAdapter {
@ -82,6 +84,7 @@ public class CsrfConfigurerNoWebMvcTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EnableWebOverrideRequestDataConfig { static class EnableWebOverrideRequestDataConfig {
@ -93,6 +96,7 @@ public class CsrfConfigurerNoWebMvcTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EnableWebMvcConfig extends WebSecurityConfigurerAdapter { static class EnableWebMvcConfig extends WebSecurityConfigurerAdapter {

View File

@ -418,6 +418,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfAppliedDefaultConfig extends WebSecurityConfigurerAdapter { static class CsrfAppliedDefaultConfig extends WebSecurityConfigurerAdapter {
@ -427,6 +428,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DisableCsrfConfig extends WebSecurityConfigurerAdapter { static class DisableCsrfConfig extends WebSecurityConfigurerAdapter {
@ -441,6 +443,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DisableCsrfInLambdaConfig extends WebSecurityConfigurerAdapter { static class DisableCsrfInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -454,6 +457,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DisableCsrfEnablesRequestCacheConfig extends WebSecurityConfigurerAdapter { static class DisableCsrfEnablesRequestCacheConfig extends WebSecurityConfigurerAdapter {
@ -482,6 +486,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfDisablesPostRequestFromRequestCacheConfig extends WebSecurityConfigurerAdapter { static class CsrfDisablesPostRequestFromRequestCacheConfig extends WebSecurityConfigurerAdapter {
@ -512,6 +517,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvalidSessionUrlConfig extends WebSecurityConfigurerAdapter { static class InvalidSessionUrlConfig extends WebSecurityConfigurerAdapter {
@ -528,6 +534,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequireCsrfProtectionMatcherConfig extends WebSecurityConfigurerAdapter { static class RequireCsrfProtectionMatcherConfig extends WebSecurityConfigurerAdapter {
@ -544,6 +551,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequireCsrfProtectionMatcherInLambdaConfig extends WebSecurityConfigurerAdapter { static class RequireCsrfProtectionMatcherInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -559,6 +567,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfTokenRepositoryConfig extends WebSecurityConfigurerAdapter { static class CsrfTokenRepositoryConfig extends WebSecurityConfigurerAdapter {
@ -586,6 +595,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfTokenRepositoryInLambdaConfig extends WebSecurityConfigurerAdapter { static class CsrfTokenRepositoryInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -602,6 +612,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter {
@ -618,6 +629,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultAccessDeniedHandlerForConfig extends WebSecurityConfigurerAdapter { static class DefaultAccessDeniedHandlerForConfig extends WebSecurityConfigurerAdapter {
@ -636,6 +648,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginConfig extends WebSecurityConfigurerAdapter { static class FormLoginConfig extends WebSecurityConfigurerAdapter {
@ -649,6 +662,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class LogoutAllowsGetConfig extends WebSecurityConfigurerAdapter { static class LogoutAllowsGetConfig extends WebSecurityConfigurerAdapter {
@ -665,6 +679,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullRequireCsrfProtectionMatcherConfig extends WebSecurityConfigurerAdapter { static class NullRequireCsrfProtectionMatcherConfig extends WebSecurityConfigurerAdapter {
@ -679,6 +694,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultDoesNotCreateSession extends WebSecurityConfigurerAdapter { static class DefaultDoesNotCreateSession extends WebSecurityConfigurerAdapter {
@ -706,6 +722,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullAuthenticationStrategy extends WebSecurityConfigurerAdapter { static class NullAuthenticationStrategy extends WebSecurityConfigurerAdapter {
@ -720,6 +737,7 @@ public class CsrfConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfAuthenticationStrategyConfig extends WebSecurityConfigurerAdapter { static class CsrfAuthenticationStrategyConfig extends WebSecurityConfigurerAdapter {

View File

@ -131,6 +131,7 @@ public class DefaultFiltersTests {
assertThat(response.getRedirectedUrl()).isEqualTo("/login?logout"); assertThat(response.getRedirectedUrl()).isEqualTo("/login?logout");
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FilterChainProxyBuilderMissingConfig { static class FilterChainProxyBuilderMissingConfig {
@ -155,6 +156,7 @@ public class DefaultFiltersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullWebInvocationPrivilegeEvaluatorConfig extends WebSecurityConfigurerAdapter { static class NullWebInvocationPrivilegeEvaluatorConfig extends WebSecurityConfigurerAdapter {
@ -169,6 +171,7 @@ public class DefaultFiltersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FilterChainProxyBuilderIgnoringConfig extends WebSecurityConfigurerAdapter { static class FilterChainProxyBuilderIgnoringConfig extends WebSecurityConfigurerAdapter {
@ -192,6 +195,7 @@ public class DefaultFiltersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultFiltersConfigPermitAll extends WebSecurityConfigurerAdapter { static class DefaultFiltersConfigPermitAll extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mock.web.MockHttpSession; import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -310,6 +311,7 @@ public class DefaultLoginPageConfigurerTests {
this.mvc.perform(get("/logout").with(user("user"))).andExpect(status().isNotFound()); this.mvc.perform(get("/logout").with(user("user"))).andExpect(status().isNotFound());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLoginPageConfig extends WebSecurityConfigurerAdapter { static class DefaultLoginPageConfig extends WebSecurityConfigurerAdapter {
@ -335,6 +337,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLoginPageCustomLogoutSuccessHandlerConfig extends WebSecurityConfigurerAdapter { static class DefaultLoginPageCustomLogoutSuccessHandlerConfig extends WebSecurityConfigurerAdapter {
@ -354,6 +357,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLoginPageCustomLogoutSuccessUrlConfig extends WebSecurityConfigurerAdapter { static class DefaultLoginPageCustomLogoutSuccessUrlConfig extends WebSecurityConfigurerAdapter {
@ -373,6 +377,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLoginPageWithRememberMeConfig extends WebSecurityConfigurerAdapter { static class DefaultLoginPageWithRememberMeConfig extends WebSecurityConfigurerAdapter {
@ -391,6 +396,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLoginWithCustomAuthenticationEntryPointConfig extends WebSecurityConfigurerAdapter { static class DefaultLoginWithCustomAuthenticationEntryPointConfig extends WebSecurityConfigurerAdapter {
@ -410,6 +416,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -432,6 +439,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultLogoutPageConfig extends WebSecurityConfigurerAdapter { static class DefaultLogoutPageConfig extends WebSecurityConfigurerAdapter {
@ -448,6 +456,7 @@ public class DefaultLoginPageConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class LogoutDisabledConfig extends WebSecurityConfigurerAdapter { static class LogoutDisabledConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -74,6 +75,7 @@ public class ExceptionHandlingConfigurerAccessDeniedHandlerTests {
this.mvc.perform(get("/goodbye")).andExpect(status().isIAmATeapot()); this.mvc.perform(get("/goodbye")).andExpect(status().isIAmATeapot());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherBasedAccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter { static class RequestMatcherBasedAccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter {
@ -99,6 +101,7 @@ public class ExceptionHandlingConfigurerAccessDeniedHandlerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestMatcherBasedAccessDeniedHandlerInLambdaConfig extends WebSecurityConfigurerAdapter { static class RequestMatcherBasedAccessDeniedHandlerInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -129,6 +132,7 @@ public class ExceptionHandlingConfigurerAccessDeniedHandlerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SingleRequestMatcherAccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter { static class SingleRequestMatcherAccessDeniedHandlerConfig extends WebSecurityConfigurerAdapter {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.authentication.AnonymousAuthenticationToken;
@ -228,6 +229,7 @@ public class ExceptionHandlingConfigurerTests {
any(HttpServletResponse.class), any(AuthenticationException.class)); any(HttpServletResponse.class), any(AuthenticationException.class));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -257,6 +259,7 @@ public class ExceptionHandlingConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultSecurityConfig { static class DefaultSecurityConfig {
@ -272,6 +275,7 @@ public class ExceptionHandlingConfigurerTests {
// @formatter:off // @formatter:off
} }
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpBasicAndFormLoginEntryPointsConfig extends WebSecurityConfigurerAdapter { static class HttpBasicAndFormLoginEntryPointsConfig extends WebSecurityConfigurerAdapter {
@Override @Override
@ -295,6 +299,7 @@ public class ExceptionHandlingConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class OverrideContentNegotiationStrategySharedObjectConfig extends WebSecurityConfigurerAdapter { static class OverrideContentNegotiationStrategySharedObjectConfig extends WebSecurityConfigurerAdapter {
@ -307,11 +312,13 @@ public class ExceptionHandlingConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultHttpConfig extends WebSecurityConfigurerAdapter { static class DefaultHttpConfig extends WebSecurityConfigurerAdapter {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BasicAuthenticationEntryPointBeforeFormLoginConfig extends WebSecurityConfigurerAdapter { static class BasicAuthenticationEntryPointBeforeFormLoginConfig extends WebSecurityConfigurerAdapter {
@ -330,6 +337,7 @@ public class ExceptionHandlingConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {

View File

@ -26,6 +26,7 @@ import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDecisionManager; import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.access.event.AuthorizedEvent; import org.springframework.security.access.event.AuthorizedEvent;
@ -549,6 +550,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
this.mvc.perform(requestWithUser).andExpect(status().isForbidden()); this.mvc.perform(requestWithUser).andExpect(status().isForbidden());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HasRoleStartingWithRoleConfig extends WebSecurityConfigurerAdapter { static class HasRoleStartingWithRoleConfig extends WebSecurityConfigurerAdapter {
@ -563,6 +565,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoSpecificAccessDecisionManagerConfig extends WebSecurityConfigurerAdapter { static class NoSpecificAccessDecisionManagerConfig extends WebSecurityConfigurerAdapter {
@ -584,6 +587,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoRequestsConfig extends WebSecurityConfigurerAdapter { static class NoRequestsConfig extends WebSecurityConfigurerAdapter {
@ -597,6 +601,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class IncompleteMappingConfig extends WebSecurityConfigurerAdapter { static class IncompleteMappingConfig extends WebSecurityConfigurerAdapter {
@ -612,6 +617,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserAnyAuthorityConfig extends WebSecurityConfigurerAdapter { static class RoleUserAnyAuthorityConfig extends WebSecurityConfigurerAdapter {
@ -628,6 +634,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserAuthorityConfig extends WebSecurityConfigurerAdapter { static class RoleUserAuthorityConfig extends WebSecurityConfigurerAdapter {
@ -644,6 +651,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrRoleAdminAuthorityConfig extends WebSecurityConfigurerAdapter { static class RoleUserOrRoleAdminAuthorityConfig extends WebSecurityConfigurerAdapter {
@ -660,6 +668,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserConfig extends WebSecurityConfigurerAdapter { static class RoleUserConfig extends WebSecurityConfigurerAdapter {
@ -674,6 +683,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserWithTestRolePrefixConfig extends WebSecurityConfigurerAdapter { static class RoleUserWithTestRolePrefixConfig extends WebSecurityConfigurerAdapter {
@ -693,6 +703,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserWithEmptyRolePrefixConfig extends WebSecurityConfigurerAdapter { static class RoleUserWithEmptyRolePrefixConfig extends WebSecurityConfigurerAdapter {
@ -712,6 +723,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrAdminConfig extends WebSecurityConfigurerAdapter { static class RoleUserOrAdminConfig extends WebSecurityConfigurerAdapter {
@ -726,6 +738,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrAdminWithTestRolePrefixConfig extends WebSecurityConfigurerAdapter { static class RoleUserOrAdminWithTestRolePrefixConfig extends WebSecurityConfigurerAdapter {
@ -745,6 +758,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleUserOrAdminWithEmptyRolePrefixConfig extends WebSecurityConfigurerAdapter { static class RoleUserOrAdminWithEmptyRolePrefixConfig extends WebSecurityConfigurerAdapter {
@ -764,6 +778,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HasIpAddressConfig extends WebSecurityConfigurerAdapter { static class HasIpAddressConfig extends WebSecurityConfigurerAdapter {
@ -780,6 +795,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousConfig extends WebSecurityConfigurerAdapter { static class AnonymousConfig extends WebSecurityConfigurerAdapter {
@ -796,6 +812,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeConfig extends WebSecurityConfigurerAdapter { static class RememberMeConfig extends WebSecurityConfigurerAdapter {
@ -823,6 +840,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DenyAllConfig extends WebSecurityConfigurerAdapter { static class DenyAllConfig extends WebSecurityConfigurerAdapter {
@ -839,6 +857,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NotDenyAllConfig extends WebSecurityConfigurerAdapter { static class NotDenyAllConfig extends WebSecurityConfigurerAdapter {
@ -855,6 +874,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FullyAuthenticatedConfig extends WebSecurityConfigurerAdapter { static class FullyAuthenticatedConfig extends WebSecurityConfigurerAdapter {
@ -873,6 +893,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessConfig extends WebSecurityConfigurerAdapter { static class AccessConfig extends WebSecurityConfigurerAdapter {
@ -891,6 +912,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotResetConfig extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotResetConfig extends WebSecurityConfigurerAdapter {
@ -909,6 +931,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AllPropertiesWorkConfig extends WebSecurityConfigurerAdapter { static class AllPropertiesWorkConfig extends WebSecurityConfigurerAdapter {
@ -932,6 +955,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthorizedRequestsWithPostProcessorConfig extends WebSecurityConfigurerAdapter { static class AuthorizedRequestsWithPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -961,6 +985,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UseBeansInExpressions extends WebSecurityConfigurerAdapter { static class UseBeansInExpressions extends WebSecurityConfigurerAdapter {
@ -991,6 +1016,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomExpressionRootConfig extends WebSecurityConfigurerAdapter { static class CustomExpressionRootConfig extends WebSecurityConfigurerAdapter {
@ -1041,6 +1067,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class Sec3011Config extends WebSecurityConfigurerAdapter { static class Sec3011Config extends WebSecurityConfigurerAdapter {
@ -1070,6 +1097,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermissionEvaluatorConfig extends WebSecurityConfigurerAdapter { static class PermissionEvaluatorConfig extends WebSecurityConfigurerAdapter {
@ -1105,6 +1133,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RoleHierarchyConfig extends WebSecurityConfigurerAdapter { static class RoleHierarchyConfig extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig; import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig;
@ -375,6 +376,7 @@ public class FormLoginConfigurerTests {
verify(ObjectPostProcessorConfig.objectPostProcessor).postProcess(any(ExceptionTranslationFilter.class)); verify(ObjectPostProcessorConfig.objectPostProcessor).postProcess(any(ExceptionTranslationFilter.class));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheConfig extends WebSecurityConfigurerAdapter { static class RequestCacheConfig extends WebSecurityConfigurerAdapter {
@ -392,6 +394,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheBeanConfig { static class RequestCacheBeanConfig {
@ -402,6 +405,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginConfig extends WebSecurityConfigurerAdapter { static class FormLoginConfig extends WebSecurityConfigurerAdapter {
@ -437,6 +441,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginInLambdaConfig extends WebSecurityConfigurerAdapter { static class FormLoginInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -463,6 +468,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginConfigPermitAll extends WebSecurityConfigurerAdapter { static class FormLoginConfigPermitAll extends WebSecurityConfigurerAdapter {
@ -480,6 +486,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginDefaultsConfig extends WebSecurityConfigurerAdapter { static class FormLoginDefaultsConfig extends WebSecurityConfigurerAdapter {
@ -501,6 +508,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginDefaultsInLambdaConfig extends WebSecurityConfigurerAdapter { static class FormLoginDefaultsInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -523,6 +531,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginLoginProcessingUrlConfig extends WebSecurityConfigurerAdapter { static class FormLoginLoginProcessingUrlConfig extends WebSecurityConfigurerAdapter {
@ -559,6 +568,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginLoginProcessingUrlInLambdaConfig extends WebSecurityConfigurerAdapter { static class FormLoginLoginProcessingUrlInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -597,6 +607,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginUsesPortMapperConfig extends WebSecurityConfigurerAdapter { static class FormLoginUsesPortMapperConfig extends WebSecurityConfigurerAdapter {
@ -622,6 +633,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermitAllIgnoresFailureHandlerConfig extends WebSecurityConfigurerAdapter { static class PermitAllIgnoresFailureHandlerConfig extends WebSecurityConfigurerAdapter {
@ -642,6 +654,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DuplicateInvocationsDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class DuplicateInvocationsDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -667,6 +680,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginUserForwardAuthenticationSuccessAndFailureConfig extends WebSecurityConfigurerAdapter { static class FormLoginUserForwardAuthenticationSuccessAndFailureConfig extends WebSecurityConfigurerAdapter {
@ -697,6 +711,7 @@ public class FormLoginConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@ -58,6 +59,7 @@ public class HeadersConfigurerEagerHeadersTests {
.andExpect(header().string("X-XSS-Protection", "1; mode=block")); .andExpect(header().string("X-XSS-Protection", "1; mode=block"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class HeadersAtTheBeginningOfRequestConfig extends WebSecurityConfigurerAdapter { public static class HeadersAtTheBeginningOfRequestConfig extends WebSecurityConfigurerAdapter {

View File

@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -544,6 +545,7 @@ public class HeadersConfigurerTests {
HttpHeaders.CROSS_ORIGIN_EMBEDDER_POLICY, HttpHeaders.CROSS_ORIGIN_RESOURCE_POLICY); HttpHeaders.CROSS_ORIGIN_EMBEDDER_POLICY, HttpHeaders.CROSS_ORIGIN_RESOURCE_POLICY);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersConfig extends WebSecurityConfigurerAdapter { static class HeadersConfig extends WebSecurityConfigurerAdapter {
@ -557,6 +559,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersInLambdaConfig extends WebSecurityConfigurerAdapter { static class HeadersInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -570,6 +573,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentTypeOptionsConfig extends WebSecurityConfigurerAdapter { static class ContentTypeOptionsConfig extends WebSecurityConfigurerAdapter {
@ -585,6 +589,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentTypeOptionsInLambdaConfig extends WebSecurityConfigurerAdapter { static class ContentTypeOptionsInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -602,6 +607,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FrameOptionsConfig extends WebSecurityConfigurerAdapter { static class FrameOptionsConfig extends WebSecurityConfigurerAdapter {
@ -617,6 +623,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HstsConfig extends WebSecurityConfigurerAdapter { static class HstsConfig extends WebSecurityConfigurerAdapter {
@ -632,6 +639,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CacheControlConfig extends WebSecurityConfigurerAdapter { static class CacheControlConfig extends WebSecurityConfigurerAdapter {
@ -647,6 +655,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CacheControlInLambdaConfig extends WebSecurityConfigurerAdapter { static class CacheControlInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -664,6 +673,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class XssProtectionConfig extends WebSecurityConfigurerAdapter { static class XssProtectionConfig extends WebSecurityConfigurerAdapter {
@ -679,6 +689,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class XssProtectionInLambdaConfig extends WebSecurityConfigurerAdapter { static class XssProtectionInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -696,6 +707,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersCustomSameOriginConfig extends WebSecurityConfigurerAdapter { static class HeadersCustomSameOriginConfig extends WebSecurityConfigurerAdapter {
@ -710,6 +722,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersCustomSameOriginInLambdaConfig extends WebSecurityConfigurerAdapter { static class HeadersCustomSameOriginInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -726,6 +739,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigNoPins extends WebSecurityConfigurerAdapter { static class HpkpConfigNoPins extends WebSecurityConfigurerAdapter {
@ -741,6 +755,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfig extends WebSecurityConfigurerAdapter { static class HpkpConfig extends WebSecurityConfigurerAdapter {
@ -757,6 +772,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigWithPins extends WebSecurityConfigurerAdapter { static class HpkpConfigWithPins extends WebSecurityConfigurerAdapter {
@ -776,6 +792,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigCustomAge extends WebSecurityConfigurerAdapter { static class HpkpConfigCustomAge extends WebSecurityConfigurerAdapter {
@ -793,6 +810,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigTerminateConnection extends WebSecurityConfigurerAdapter { static class HpkpConfigTerminateConnection extends WebSecurityConfigurerAdapter {
@ -810,6 +828,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigIncludeSubDomains extends WebSecurityConfigurerAdapter { static class HpkpConfigIncludeSubDomains extends WebSecurityConfigurerAdapter {
@ -827,6 +846,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigWithReportURI extends WebSecurityConfigurerAdapter { static class HpkpConfigWithReportURI extends WebSecurityConfigurerAdapter {
@ -844,6 +864,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpConfigWithReportURIAsString extends WebSecurityConfigurerAdapter { static class HpkpConfigWithReportURIAsString extends WebSecurityConfigurerAdapter {
@ -861,6 +882,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HpkpWithReportUriInLambdaConfig extends WebSecurityConfigurerAdapter { static class HpkpWithReportUriInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -882,6 +904,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyDefaultConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyDefaultConfig extends WebSecurityConfigurerAdapter {
@ -897,6 +920,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyReportOnlyConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyReportOnlyConfig extends WebSecurityConfigurerAdapter {
@ -913,6 +937,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyReportOnlyInLambdaConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyReportOnlyInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -934,6 +959,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyInvalidConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyInvalidConfig extends WebSecurityConfigurerAdapter {
@ -949,6 +975,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyInvalidInLambdaConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyInvalidInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -968,6 +995,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentSecurityPolicyNoDirectivesInLambdaConfig extends WebSecurityConfigurerAdapter { static class ContentSecurityPolicyNoDirectivesInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -985,6 +1013,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ReferrerPolicyDefaultConfig extends WebSecurityConfigurerAdapter { static class ReferrerPolicyDefaultConfig extends WebSecurityConfigurerAdapter {
@ -1000,6 +1029,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ReferrerPolicyDefaultInLambdaConfig extends WebSecurityConfigurerAdapter { static class ReferrerPolicyDefaultInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -1017,6 +1047,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ReferrerPolicyCustomConfig extends WebSecurityConfigurerAdapter { static class ReferrerPolicyCustomConfig extends WebSecurityConfigurerAdapter {
@ -1032,6 +1063,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ReferrerPolicyCustomInLambdaConfig extends WebSecurityConfigurerAdapter { static class ReferrerPolicyCustomInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -1051,6 +1083,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FeaturePolicyConfig extends WebSecurityConfigurerAdapter { static class FeaturePolicyConfig extends WebSecurityConfigurerAdapter {
@ -1066,6 +1099,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FeaturePolicyInvalidConfig extends WebSecurityConfigurerAdapter { static class FeaturePolicyInvalidConfig extends WebSecurityConfigurerAdapter {
@ -1081,6 +1115,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermissionsPolicyConfig extends WebSecurityConfigurerAdapter { static class PermissionsPolicyConfig extends WebSecurityConfigurerAdapter {
@ -1096,6 +1131,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermissionsPolicyStringConfig extends WebSecurityConfigurerAdapter { static class PermissionsPolicyStringConfig extends WebSecurityConfigurerAdapter {
@ -1112,6 +1148,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermissionsPolicyInvalidConfig extends WebSecurityConfigurerAdapter { static class PermissionsPolicyInvalidConfig extends WebSecurityConfigurerAdapter {
@ -1127,6 +1164,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermissionsPolicyInvalidStringConfig extends WebSecurityConfigurerAdapter { static class PermissionsPolicyInvalidStringConfig extends WebSecurityConfigurerAdapter {
@ -1143,6 +1181,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HstsWithPreloadConfig extends WebSecurityConfigurerAdapter { static class HstsWithPreloadConfig extends WebSecurityConfigurerAdapter {
@ -1159,6 +1198,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HstsWithPreloadInLambdaConfig extends WebSecurityConfigurerAdapter { static class HstsWithPreloadInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -1176,6 +1216,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CrossOriginCustomPoliciesInLambdaConfig { static class CrossOriginCustomPoliciesInLambdaConfig {
@ -1200,6 +1241,7 @@ public class HeadersConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CrossOriginCustomPoliciesConfig { static class CrossOriginCustomPoliciesConfig {

View File

@ -147,6 +147,7 @@ public class HttpBasicConfigurerTests {
verify(listener).securityContextChanged(setAuthentication(UsernamePasswordAuthenticationToken.class)); verify(listener).securityContextChanged(setAuthentication(UsernamePasswordAuthenticationToken.class));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -176,6 +177,7 @@ public class HttpBasicConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultsLambdaEntryPointConfig extends WebSecurityConfigurerAdapter { static class DefaultsLambdaEntryPointConfig extends WebSecurityConfigurerAdapter {
@ -201,6 +203,7 @@ public class HttpBasicConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultsEntryPointConfig extends WebSecurityConfigurerAdapter { static class DefaultsEntryPointConfig extends WebSecurityConfigurerAdapter {
@ -225,6 +228,7 @@ public class HttpBasicConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomAuthenticationEntryPointConfig extends WebSecurityConfigurerAdapter { static class CustomAuthenticationEntryPointConfig extends WebSecurityConfigurerAdapter {
@ -252,6 +256,7 @@ public class HttpBasicConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -311,6 +316,7 @@ public class HttpBasicConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpBasic { static class HttpBasic {

View File

@ -88,6 +88,7 @@ public class Issue55Tests {
return this.spring.getContext().getBean(FilterChainProxy.class).getFilterChains().get(index); return this.spring.getContext().getBean(FilterChainProxy.class).getFilterChains().get(index);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class WebSecurityConfigurerAdapterDefaultsAuthManagerConfig { static class WebSecurityConfigurerAdapterDefaultsAuthManagerConfig {
@ -117,6 +118,7 @@ public class Issue55Tests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class MultiWebSecurityConfigurerAdapterDefaultsAuthManagerConfig { static class MultiWebSecurityConfigurerAdapterDefaultsAuthManagerConfig {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -151,6 +152,7 @@ public class JeeConfigurerTests {
this.mvc.perform(authRequest).andExpect(authenticated().withRoles("USER")); this.mvc.perform(authRequest).andExpect(authenticated().withRoles("USER"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -180,6 +182,7 @@ public class JeeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter {
@ -196,6 +199,7 @@ public class JeeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class JeeMappableRolesConfig extends WebSecurityConfigurerAdapter { public static class JeeMappableRolesConfig extends WebSecurityConfigurerAdapter {
@ -216,6 +220,7 @@ public class JeeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class JeeMappableAuthoritiesConfig extends WebSecurityConfigurerAdapter { public static class JeeMappableAuthoritiesConfig extends WebSecurityConfigurerAdapter {
@ -236,6 +241,7 @@ public class JeeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class JeeCustomAuthenticatedUserDetailsServiceConfig extends WebSecurityConfigurerAdapter { public static class JeeCustomAuthenticatedUserDetailsServiceConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -87,6 +88,7 @@ public class LogoutConfigurerClearSiteDataTests {
this.mvc.perform(logoutRequest).andExpect(header().stringValues(CLEAR_SITE_DATA_HEADER, HEADER_VALUE)); this.mvc.perform(logoutRequest).andExpect(header().stringValues(CLEAR_SITE_DATA_HEADER, HEADER_VALUE));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpLogoutConfig extends WebSecurityConfigurerAdapter { static class HttpLogoutConfig extends WebSecurityConfigurerAdapter {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.security.config.annotation.ObjectPostProcessor; import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig; import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig;
@ -321,6 +322,7 @@ public class LogoutConfigurerTests {
this.mvc.perform(post("/logout").with(csrf())).andExpect(status().isNotFound()); this.mvc.perform(post("/logout").with(csrf())).andExpect(status().isNotFound());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullLogoutSuccessHandlerConfig extends WebSecurityConfigurerAdapter { static class NullLogoutSuccessHandlerConfig extends WebSecurityConfigurerAdapter {
@ -335,6 +337,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullLogoutSuccessHandlerInLambdaConfig extends WebSecurityConfigurerAdapter { static class NullLogoutSuccessHandlerInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -350,6 +353,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullMatcherConfig extends WebSecurityConfigurerAdapter { static class NullMatcherConfig extends WebSecurityConfigurerAdapter {
@ -364,6 +368,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullMatcherInLambdaConfig extends WebSecurityConfigurerAdapter { static class NullMatcherInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -379,6 +384,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -408,6 +414,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -432,6 +439,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfDisabledConfig extends WebSecurityConfigurerAdapter { static class CsrfDisabledConfig extends WebSecurityConfigurerAdapter {
@ -447,6 +455,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfDisabledAndCustomLogoutConfig extends WebSecurityConfigurerAdapter { static class CsrfDisabledAndCustomLogoutConfig extends WebSecurityConfigurerAdapter {
@ -463,6 +472,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CsrfDisabledAndCustomLogoutInLambdaConfig extends WebSecurityConfigurerAdapter { static class CsrfDisabledAndCustomLogoutInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -478,6 +488,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullLogoutHandlerConfig extends WebSecurityConfigurerAdapter { static class NullLogoutHandlerConfig extends WebSecurityConfigurerAdapter {
@ -492,6 +503,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullLogoutHandlerInLambdaConfig extends WebSecurityConfigurerAdapter { static class NullLogoutHandlerInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -505,6 +517,7 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeNoLogoutHandler extends WebSecurityConfigurerAdapter { static class RememberMeNoLogoutHandler extends WebSecurityConfigurerAdapter {
@ -521,11 +534,13 @@ public class LogoutConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class BasicSecurityConfig extends WebSecurityConfigurerAdapter { static class BasicSecurityConfig extends WebSecurityConfigurerAdapter {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class LogoutDisabledConfig extends WebSecurityConfigurerAdapter { static class LogoutDisabledConfig extends WebSecurityConfigurerAdapter {

View File

@ -25,6 +25,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContext;
@ -84,11 +85,13 @@ public class NamespaceDebugTests {
return this.spring.getContext().getBean("springSecurityFilterChain").getClass(); return this.spring.getContext().getBean("springSecurityFilterChain").getClass();
} }
@Configuration
@EnableWebSecurity(debug = true) @EnableWebSecurity(debug = true)
static class DebugWebSecurity extends WebSecurityConfigurerAdapter { static class DebugWebSecurity extends WebSecurityConfigurerAdapter {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoDebugWebSecurity extends WebSecurityConfigurerAdapter { static class NoDebugWebSecurity extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@ -86,6 +87,7 @@ public class NamespaceHttpAnonymousTests {
this.mvc.perform(get("/principal")).andExpect(content().string("AnonymousUsernameConfig")); this.mvc.perform(get("/principal")).andExpect(content().string("AnonymousUsernameConfig"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousConfig extends WebSecurityConfigurerAdapter { static class AnonymousConfig extends WebSecurityConfigurerAdapter {
@ -101,6 +103,7 @@ public class NamespaceHttpAnonymousTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousDisabledConfig extends WebSecurityConfigurerAdapter { static class AnonymousDisabledConfig extends WebSecurityConfigurerAdapter {
@ -127,6 +130,7 @@ public class NamespaceHttpAnonymousTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousGrantedAuthorityConfig extends WebSecurityConfigurerAdapter { static class AnonymousGrantedAuthorityConfig extends WebSecurityConfigurerAdapter {
@ -145,6 +149,7 @@ public class NamespaceHttpAnonymousTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousKeyConfig extends WebSecurityConfigurerAdapter { static class AnonymousKeyConfig extends WebSecurityConfigurerAdapter {
@ -162,6 +167,7 @@ public class NamespaceHttpAnonymousTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AnonymousUsernameConfig extends WebSecurityConfigurerAdapter { static class AnonymousUsernameConfig extends WebSecurityConfigurerAdapter {

View File

@ -175,6 +175,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpBasicConfig extends WebSecurityConfigurerAdapter { static class HttpBasicConfig extends WebSecurityConfigurerAdapter {
@ -191,6 +192,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpBasicLambdaConfig extends WebSecurityConfigurerAdapter { static class HttpBasicLambdaConfig extends WebSecurityConfigurerAdapter {
@ -208,6 +210,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpBasicConfig extends WebSecurityConfigurerAdapter { static class CustomHttpBasicConfig extends WebSecurityConfigurerAdapter {
@ -224,6 +227,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter { static class CustomHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter {
@ -241,6 +245,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationDetailsSourceHttpBasicConfig extends WebSecurityConfigurerAdapter { static class AuthenticationDetailsSourceHttpBasicConfig extends WebSecurityConfigurerAdapter {
@ -263,6 +268,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AuthenticationDetailsSourceHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter { static class AuthenticationDetailsSourceHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter {
@ -285,6 +291,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EntryPointRefHttpBasicConfig extends WebSecurityConfigurerAdapter { static class EntryPointRefHttpBasicConfig extends WebSecurityConfigurerAdapter {
@ -304,6 +311,7 @@ public class NamespaceHttpBasicTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class EntryPointRefHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter { static class EntryPointRefHttpBasicLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -98,6 +98,7 @@ public class NamespaceHttpCustomFilterTests {
return assertThat(filters); return assertThat(filters);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomFilterBeforeConfig extends WebSecurityConfigurerAdapter { static class CustomFilterBeforeConfig extends WebSecurityConfigurerAdapter {
@ -112,6 +113,7 @@ public class NamespaceHttpCustomFilterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomFilterAfterConfig extends WebSecurityConfigurerAdapter { static class CustomFilterAfterConfig extends WebSecurityConfigurerAdapter {
@ -126,6 +128,7 @@ public class NamespaceHttpCustomFilterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomFilterPositionConfig extends WebSecurityConfigurerAdapter { static class CustomFilterPositionConfig extends WebSecurityConfigurerAdapter {
@ -146,6 +149,7 @@ public class NamespaceHttpCustomFilterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomFilterPositionAtConfig extends WebSecurityConfigurerAdapter { static class CustomFilterPositionAtConfig extends WebSecurityConfigurerAdapter {
@ -164,6 +168,7 @@ public class NamespaceHttpCustomFilterTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoAuthenticationManagerInHttpConfigurationConfig extends WebSecurityConfigurerAdapter { static class NoAuthenticationManagerInHttpConfigurationConfig extends WebSecurityConfigurerAdapter {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.expression.ExpressionParser; import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -74,6 +75,7 @@ public class NamespaceHttpExpressionHandlerTests {
return verify(this.spring.getContext().getBean(beanName, beanClass)); return verify(this.spring.getContext().getBean(beanName, beanClass));
} }
@Configuration
@EnableWebMvc @EnableWebMvc
@EnableWebSecurity @EnableWebSecurity
private static class ExpressionHandlerConfig extends WebSecurityConfigurerAdapter { private static class ExpressionHandlerConfig extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -69,11 +70,13 @@ public class NamespaceHttpFirewallTests {
this.mvc.perform(get("/").param("deny", "true")).andExpect(status().isBadRequest()); this.mvc.perform(get("/").param("deny", "true")).andExpect(status().isBadRequest());
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpFirewallConfig { static class HttpFirewallConfig {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpFirewallConfig extends WebSecurityConfigurerAdapter { static class CustomHttpFirewallConfig extends WebSecurityConfigurerAdapter {
@ -84,6 +87,7 @@ public class NamespaceHttpFirewallTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpFirewallBeanConfig { static class CustomHttpFirewallBeanConfig {

View File

@ -109,6 +109,7 @@ public class NamespaceHttpFormLoginTests {
return verify(this.spring.getContext().getBean(beanClass)); return verify(this.spring.getContext().getBean(beanClass));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginConfig extends WebSecurityConfigurerAdapter { static class FormLoginConfig extends WebSecurityConfigurerAdapter {
@ -130,6 +131,7 @@ public class NamespaceHttpFormLoginTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginCustomConfig extends WebSecurityConfigurerAdapter { static class FormLoginCustomConfig extends WebSecurityConfigurerAdapter {
@ -153,6 +155,7 @@ public class NamespaceHttpFormLoginTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FormLoginCustomRefsConfig extends WebSecurityConfigurerAdapter { static class FormLoginCustomRefsConfig extends WebSecurityConfigurerAdapter {

View File

@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -150,6 +151,7 @@ public class NamespaceHttpHeadersTests {
}; };
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersDefaultConfig extends WebSecurityConfigurerAdapter { static class HeadersDefaultConfig extends WebSecurityConfigurerAdapter {
@ -163,6 +165,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeadersCacheControlConfig extends WebSecurityConfigurerAdapter { static class HeadersCacheControlConfig extends WebSecurityConfigurerAdapter {
@ -178,6 +181,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HstsConfig extends WebSecurityConfigurerAdapter { static class HstsConfig extends WebSecurityConfigurerAdapter {
@ -193,6 +197,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HstsCustomConfig extends WebSecurityConfigurerAdapter { static class HstsCustomConfig extends WebSecurityConfigurerAdapter {
@ -212,6 +217,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FrameOptionsSameOriginConfig extends WebSecurityConfigurerAdapter { static class FrameOptionsSameOriginConfig extends WebSecurityConfigurerAdapter {
@ -229,6 +235,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FrameOptionsAllowFromConfig extends WebSecurityConfigurerAdapter { static class FrameOptionsAllowFromConfig extends WebSecurityConfigurerAdapter {
@ -246,6 +253,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class XssProtectionConfig extends WebSecurityConfigurerAdapter { static class XssProtectionConfig extends WebSecurityConfigurerAdapter {
@ -262,6 +270,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class XssProtectionCustomConfig extends WebSecurityConfigurerAdapter { static class XssProtectionCustomConfig extends WebSecurityConfigurerAdapter {
@ -280,6 +289,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ContentTypeOptionsConfig extends WebSecurityConfigurerAdapter { static class ContentTypeOptionsConfig extends WebSecurityConfigurerAdapter {
@ -296,6 +306,7 @@ public class NamespaceHttpHeadersTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HeaderRefConfig extends WebSecurityConfigurerAdapter { static class HeaderRefConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -104,6 +105,7 @@ public class NamespaceHttpInterceptUrlTests {
AuthorityUtils.createAuthorityList(role)); AuthorityUtils.createAuthorityList(role));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpInterceptUrlConfig extends WebSecurityConfigurerAdapter { static class HttpInterceptUrlConfig extends WebSecurityConfigurerAdapter {

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -94,6 +95,7 @@ public class NamespaceHttpJeeTests {
return verify(this.spring.getContext().getBean(beanClass)); return verify(this.spring.getContext().getBean(beanClass));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class JeeMappableRolesConfig extends WebSecurityConfigurerAdapter { public static class JeeMappableRolesConfig extends WebSecurityConfigurerAdapter {
@ -111,6 +113,7 @@ public class NamespaceHttpJeeTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class JeeUserServiceRefConfig extends WebSecurityConfigurerAdapter { public static class JeeUserServiceRefConfig extends WebSecurityConfigurerAdapter {

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -162,6 +163,7 @@ public class NamespaceHttpLogoutTests {
.is(new Condition<>(sessionPredicate, "sessionPredicate failed")); .is(new Condition<>(sessionPredicate, "sessionPredicate failed"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpLogoutConfig extends WebSecurityConfigurerAdapter { static class HttpLogoutConfig extends WebSecurityConfigurerAdapter {
@ -171,6 +173,7 @@ public class NamespaceHttpLogoutTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpLogoutDisabledInLambdaConfig extends WebSecurityConfigurerAdapter { static class HttpLogoutDisabledInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -181,6 +184,7 @@ public class NamespaceHttpLogoutTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpLogoutConfig extends WebSecurityConfigurerAdapter { static class CustomHttpLogoutConfig extends WebSecurityConfigurerAdapter {
@ -198,6 +202,7 @@ public class NamespaceHttpLogoutTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomHttpLogoutInLambdaConfig extends WebSecurityConfigurerAdapter { static class CustomHttpLogoutInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -216,6 +221,7 @@ public class NamespaceHttpLogoutTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SuccessHandlerRefHttpLogoutConfig extends WebSecurityConfigurerAdapter { static class SuccessHandlerRefHttpLogoutConfig extends WebSecurityConfigurerAdapter {
@ -232,6 +238,7 @@ public class NamespaceHttpLogoutTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SuccessHandlerRefHttpLogoutInLambdaConfig extends WebSecurityConfigurerAdapter { static class SuccessHandlerRefHttpLogoutInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -56,6 +57,7 @@ public class NamespaceHttpPortMappingsTests {
this.mvc.perform(get("https://localhost:9443/user")).andExpect(redirectedUrl("http://localhost:9080/user")); this.mvc.perform(get("https://localhost:9443/user")).andExpect(redirectedUrl("http://localhost:9080/user"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpInterceptUrlWithPortMapperConfig extends WebSecurityConfigurerAdapter { static class HttpInterceptUrlWithPortMapperConfig extends WebSecurityConfigurerAdapter {

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
@ -78,6 +79,7 @@ public class NamespaceHttpRequestCacheTests {
return verify(this.spring.getContext().getBean(beanClass)); return verify(this.spring.getContext().getBean(beanClass));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheRefConfig extends WebSecurityConfigurerAdapter { static class RequestCacheRefConfig extends WebSecurityConfigurerAdapter {
@ -110,6 +112,7 @@ public class NamespaceHttpRequestCacheTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultRequestCacheRefConfig extends WebSecurityConfigurerAdapter { static class DefaultRequestCacheRefConfig extends WebSecurityConfigurerAdapter {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@ -103,6 +104,7 @@ public class NamespaceHttpServerAccessDeniedHandlerTests {
return verify(this.spring.getContext().getBean(beanClass)); return verify(this.spring.getContext().getBean(beanClass));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedPageConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedPageConfig extends WebSecurityConfigurerAdapter {
@ -120,6 +122,7 @@ public class NamespaceHttpServerAccessDeniedHandlerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedPageInLambdaConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedPageInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -139,6 +142,7 @@ public class NamespaceHttpServerAccessDeniedHandlerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedHandlerRefConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedHandlerRefConfig extends WebSecurityConfigurerAdapter {
@ -161,6 +165,7 @@ public class NamespaceHttpServerAccessDeniedHandlerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class AccessDeniedHandlerRefInLambdaConfig extends WebSecurityConfigurerAdapter { static class AccessDeniedHandlerRefInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -31,6 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.security.authentication.AuthenticationDetailsSource; import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@ -131,6 +132,7 @@ public class NamespaceHttpX509Tests {
return verify(this.spring.getContext().getBean(beanClass)); return verify(this.spring.getContext().getBean(beanClass));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
public static class X509Config extends WebSecurityConfigurerAdapter { public static class X509Config extends WebSecurityConfigurerAdapter {
@ -157,6 +159,7 @@ public class NamespaceHttpX509Tests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableWebMvc @EnableWebMvc
static class AuthenticationDetailsSourceRefConfig extends WebSecurityConfigurerAdapter { static class AuthenticationDetailsSourceRefConfig extends WebSecurityConfigurerAdapter {
@ -190,6 +193,7 @@ public class NamespaceHttpX509Tests {
} }
@EnableWebMvc @EnableWebMvc
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class SubjectPrincipalRegexConfig extends WebSecurityConfigurerAdapter { public static class SubjectPrincipalRegexConfig extends WebSecurityConfigurerAdapter {
@ -217,6 +221,7 @@ public class NamespaceHttpX509Tests {
} }
@EnableWebMvc @EnableWebMvc
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class CustomPrincipalExtractorConfig extends WebSecurityConfigurerAdapter { public static class CustomPrincipalExtractorConfig extends WebSecurityConfigurerAdapter {
@ -249,6 +254,7 @@ public class NamespaceHttpX509Tests {
} }
@EnableWebMvc @EnableWebMvc
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class UserDetailsServiceRefConfig extends WebSecurityConfigurerAdapter { public static class UserDetailsServiceRefConfig extends WebSecurityConfigurerAdapter {
@ -276,6 +282,7 @@ public class NamespaceHttpX509Tests {
} }
@EnableWebMvc @EnableWebMvc
@Configuration
@EnableWebSecurity @EnableWebSecurity
public static class AuthenticationUserDetailsServiceConfig extends WebSecurityConfigurerAdapter { public static class AuthenticationUserDetailsServiceConfig extends WebSecurityConfigurerAdapter {

View File

@ -254,11 +254,13 @@ public class NamespaceSessionManagementTests {
return new SessionResultMatcher(); return new SessionResultMatcher();
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SessionManagementConfig extends WebSecurityConfigurerAdapter { static class SessionManagementConfig extends WebSecurityConfigurerAdapter {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomSessionManagementConfig extends WebSecurityConfigurerAdapter { static class CustomSessionManagementConfig extends WebSecurityConfigurerAdapter {
@ -290,6 +292,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvalidSessionStrategyConfig extends WebSecurityConfigurerAdapter { static class InvalidSessionStrategyConfig extends WebSecurityConfigurerAdapter {
@ -311,6 +314,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RefsSessionManagementConfig extends WebSecurityConfigurerAdapter { static class RefsSessionManagementConfig extends WebSecurityConfigurerAdapter {
@ -334,6 +338,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SFPNoneSessionManagementConfig extends WebSecurityConfigurerAdapter { static class SFPNoneSessionManagementConfig extends WebSecurityConfigurerAdapter {
@ -350,6 +355,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SFPMigrateSessionManagementConfig extends WebSecurityConfigurerAdapter { static class SFPMigrateSessionManagementConfig extends WebSecurityConfigurerAdapter {
@ -365,6 +371,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SFPPostProcessedConfig extends WebSecurityConfigurerAdapter { static class SFPPostProcessedConfig extends WebSecurityConfigurerAdapter {
@ -385,6 +392,7 @@ public class NamespaceSessionManagementTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class SFPNewSessionSessionManagementConfig extends WebSecurityConfigurerAdapter { static class SFPNewSessionSessionManagementConfig extends WebSecurityConfigurerAdapter {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContext;
@ -84,6 +85,7 @@ public class PasswordManagementConfigurerTests {
.withMessage("changePasswordPage cannot be empty"); .withMessage("changePasswordPage cannot be empty");
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordManagementWithDefaultChangePasswordPageConfig { static class PasswordManagementWithDefaultChangePasswordPageConfig {
@ -98,6 +100,7 @@ public class PasswordManagementConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PasswordManagementWithCustomChangePasswordPageConfig { static class PasswordManagementWithCustomChangePasswordPageConfig {

View File

@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -89,6 +90,7 @@ public class PermitAllSupportTests {
"permitAll only works with either HttpSecurity.authorizeRequests() or HttpSecurity.authorizeHttpRequests()"); "permitAll only works with either HttpSecurity.authorizeRequests() or HttpSecurity.authorizeHttpRequests()");
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermitAllConfig extends WebSecurityConfigurerAdapter { static class PermitAllConfig extends WebSecurityConfigurerAdapter {
@ -107,6 +109,7 @@ public class PermitAllSupportTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermitAllConfigAuthorizeHttpRequests extends WebSecurityConfigurerAdapter { static class PermitAllConfigAuthorizeHttpRequests extends WebSecurityConfigurerAdapter {
@ -125,6 +128,7 @@ public class PermitAllSupportTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class PermitAllConfigWithBothConfigs extends WebSecurityConfigurerAdapter { static class PermitAllConfigWithBothConfigs extends WebSecurityConfigurerAdapter {
@ -146,6 +150,7 @@ public class PermitAllSupportTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NoAuthorizedUrlsConfig extends WebSecurityConfigurerAdapter { static class NoAuthorizedUrlsConfig extends WebSecurityConfigurerAdapter {

View File

@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; 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.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -63,6 +64,7 @@ public class PortMapperConfigurerTests {
this.mockMvc.perform(get("http://localhost:543")).andExpect(redirectedUrl("https://localhost:123")); this.mockMvc.perform(get("http://localhost:543")).andExpect(redirectedUrl("https://localhost:123"));
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotOverride extends WebSecurityConfigurerAdapter {
@ -82,6 +84,7 @@ public class PortMapperConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class HttpMapsToInLambdaConfig extends WebSecurityConfigurerAdapter { static class HttpMapsToInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -102,6 +105,7 @@ public class PortMapperConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomPortMapperInLambdaConfig extends WebSecurityConfigurerAdapter { static class CustomPortMapperInLambdaConfig extends WebSecurityConfigurerAdapter {

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mock.web.MockHttpSession; import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.authentication.RememberMeAuthenticationToken; import org.springframework.security.authentication.RememberMeAuthenticationToken;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
@ -302,6 +303,7 @@ public class RememberMeConfigurerTests {
this.mvc.perform(requestWithRememberme).andExpect(remembermeAuthentication); this.mvc.perform(requestWithRememberme).andExpect(remembermeAuthentication);
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class NullUserDetailsConfig extends WebSecurityConfigurerAdapter { static class NullUserDetailsConfig extends WebSecurityConfigurerAdapter {
@ -331,6 +333,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -369,6 +372,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class DuplicateDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -403,6 +407,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class UserDetailsServiceBeanConfig { static class UserDetailsServiceBeanConfig {
@ -423,6 +428,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeConfig extends WebSecurityConfigurerAdapter { static class RememberMeConfig extends WebSecurityConfigurerAdapter {
@ -450,6 +456,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeInLambdaConfig extends WebSecurityConfigurerAdapter { static class RememberMeInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -477,6 +484,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeCookieDomainConfig extends WebSecurityConfigurerAdapter { static class RememberMeCookieDomainConfig extends WebSecurityConfigurerAdapter {
@ -505,6 +513,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeCookieDomainInLambdaConfig extends WebSecurityConfigurerAdapter { static class RememberMeCookieDomainInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -535,6 +544,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RememberMeCookieNameAndRememberMeServicesConfig extends WebSecurityConfigurerAdapter { static class RememberMeCookieNameAndRememberMeServicesConfig extends WebSecurityConfigurerAdapter {
@ -567,6 +577,7 @@ public class RememberMeConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class FallbackRememberMeKeyConfig extends RememberMeConfig { static class FallbackRememberMeKeyConfig extends RememberMeConfig {

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpSession; import org.springframework.mock.web.MockHttpSession;
@ -299,6 +300,7 @@ public class RequestCacheConfigurerTests {
// @formatter:on // @formatter:on
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter { static class ObjectPostProcessorConfig extends WebSecurityConfigurerAdapter {
@ -328,6 +330,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class InvokeTwiceDoesNotOverrideConfig extends WebSecurityConfigurerAdapter { static class InvokeTwiceDoesNotOverrideConfig extends WebSecurityConfigurerAdapter {
@ -346,6 +349,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheDefaultsConfig extends WebSecurityConfigurerAdapter { static class RequestCacheDefaultsConfig extends WebSecurityConfigurerAdapter {
@ -362,6 +366,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheDisabledConfig extends WebSecurityConfigurerAdapter { static class RequestCacheDisabledConfig extends WebSecurityConfigurerAdapter {
@ -373,6 +378,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheDisabledInLambdaConfig extends WebSecurityConfigurerAdapter { static class RequestCacheDisabledInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -391,6 +397,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class RequestCacheInLambdaConfig extends WebSecurityConfigurerAdapter { static class RequestCacheInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -409,6 +416,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class CustomRequestCacheInLambdaConfig extends WebSecurityConfigurerAdapter { static class CustomRequestCacheInLambdaConfig extends WebSecurityConfigurerAdapter {
@ -430,6 +438,7 @@ public class RequestCacheConfigurerTests {
} }
@Configuration
@EnableWebSecurity @EnableWebSecurity
static class DefaultSecurityConfig { static class DefaultSecurityConfig {

Some files were not shown because too many files have changed in this diff Show More