Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
474da80b
Commit
474da80b
authored
Oct 17, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Restructure of security packages"
See gh-14412
parent
ea42fb44
Changes
81
Hide whitespace changes
Inline
Side-by-side
Showing
81 changed files
with
380 additions
and
383 deletions
+380
-383
EndpointRequest.java
...uate/autoconfigure/security/reactive/EndpointRequest.java
+2
-2
ReactiveManagementWebSecurityAutoConfiguration.java
...ctive/ReactiveManagementWebSecurityAutoConfiguration.java
+4
-4
package-info.java
...actuate/autoconfigure/security/reactive/package-info.java
+1
-1
EndpointRequest.java
...tuate/autoconfigure/security/servlet/EndpointRequest.java
+3
-3
ManagementWebSecurityAutoConfiguration.java
...urity/servlet/ManagementWebSecurityAutoConfiguration.java
+6
-6
ManagementWebSecurityConfigurerAdapter.java
...urity/servlet/ManagementWebSecurityConfigurerAdapter.java
+8
-7
package-info.java
.../actuate/autoconfigure/security/servlet/package-info.java
+1
-1
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+2
-2
CloudFoundryReactiveHealthEndpointWebExtensionTests.java
.../CloudFoundryReactiveHealthEndpointWebExtensionTests.java
+3
-3
ReactiveCloudFoundryActuatorAutoConfigurationTests.java
...e/ReactiveCloudFoundryActuatorAutoConfigurationTests.java
+3
-3
CloudFoundryActuatorAutoConfigurationTests.java
...y/servlet/CloudFoundryActuatorAutoConfigurationTests.java
+1
-3
CloudFoundryHealthEndpointWebExtensionTests.java
.../servlet/CloudFoundryHealthEndpointWebExtensionTests.java
+1
-1
ControllerEndpointWebMvcIntegrationTests.java
...grationtest/ControllerEndpointWebMvcIntegrationTests.java
+2
-4
WebMvcEndpointIntegrationTests.java
...igure/integrationtest/WebMvcEndpointIntegrationTests.java
+2
-4
EndpointRequestTests.java
...autoconfigure/security/reactive/EndpointRequestTests.java
+0
-1
ReactiveManagementWebSecurityAutoConfigurationTests.java
.../ReactiveManagementWebSecurityAutoConfigurationTests.java
+3
-4
AbstractEndpointRequestIntegrationTests.java
...rity/servlet/AbstractEndpointRequestIntegrationTests.java
+0
-1
EndpointRequestTests.java
.../autoconfigure/security/servlet/EndpointRequestTests.java
+1
-2
JerseyEndpointRequestIntegrationTests.java
...curity/servlet/JerseyEndpointRequestIntegrationTests.java
+3
-6
ManagementWebSecurityAutoConfigurationTests.java
.../servlet/ManagementWebSecurityAutoConfigurationTests.java
+1
-4
MvcEndpointRequestIntegrationTests.java
.../security/servlet/MvcEndpointRequestIntegrationTests.java
+3
-6
SecurityDataConfiguration.java
...oot/autoconfigure/security/SecurityDataConfiguration.java
+41
-0
ReactiveOAuth2ClientAutoConfiguration.java
...lient/reactive/ReactiveOAuth2ClientAutoConfiguration.java
+6
-3
package-info.java
...nfigure/security/oauth2/client/reactive/package-info.java
+20
-0
OAuth2ClientAutoConfiguration.java
.../oauth2/client/servlet/OAuth2ClientAutoConfiguration.java
+3
-3
OAuth2ClientRegistrationRepositoryConfiguration.java
...vlet/OAuth2ClientRegistrationRepositoryConfiguration.java
+1
-1
OAuth2WebSecurityConfiguration.java
...oauth2/client/servlet/OAuth2WebSecurityConfiguration.java
+2
-2
package-info.java
...onfigure/security/oauth2/client/servlet/package-info.java
+20
-0
ReactiveOAuth2ResourceServerAutoConfiguration.java
...active/ReactiveOAuth2ResourceServerAutoConfiguration.java
+4
-3
ReactiveOAuth2ResourceServerJwkConfiguration.java
...eactive/ReactiveOAuth2ResourceServerJwkConfiguration.java
+3
-1
ReactiveOAuth2ResourceServerWebSecurityConfiguration.java
...ReactiveOAuth2ResourceServerWebSecurityConfiguration.java
+1
-1
package-info.java
...igure/security/oauth2/resource/reactive/package-info.java
+20
-0
OAuth2ResourceServerAutoConfiguration.java
...source/servlet/OAuth2ResourceServerAutoConfiguration.java
+3
-2
OAuth2ResourceServerJwkConfiguration.java
...esource/servlet/OAuth2ResourceServerJwkConfiguration.java
+3
-1
OAuth2ResourceServerWebSecurityConfiguration.java
...servlet/OAuth2ResourceServerWebSecurityConfiguration.java
+1
-1
package-info.java
...figure/security/oauth2/resource/servlet/package-info.java
+20
-0
PathRequest.java
...ork/boot/autoconfigure/security/reactive/PathRequest.java
+1
-1
ReactiveSecurityAutoConfiguration.java
.../security/reactive/ReactiveSecurityAutoConfiguration.java
+2
-5
ReactiveUserDetailsServiceAutoConfiguration.java
...reactive/ReactiveUserDetailsServiceAutoConfiguration.java
+3
-7
StaticResourceRequest.java
...utoconfigure/security/reactive/StaticResourceRequest.java
+1
-1
package-info.java
...rk/boot/autoconfigure/security/reactive/package-info.java
+1
-1
MvcRequestMatcherProvider.java
...configure/security/servlet/MvcRequestMatcherProvider.java
+2
-2
PathRequest.java
...work/boot/autoconfigure/security/servlet/PathRequest.java
+2
-2
RequestMatcherProvider.java
...utoconfigure/security/servlet/RequestMatcherProvider.java
+2
-2
SecurityAutoConfiguration.java
...configure/security/servlet/SecurityAutoConfiguration.java
+6
-16
SecurityFilterAutoConfiguration.java
...ure/security/servlet/SecurityFilterAutoConfiguration.java
+3
-6
SecurityRequestMatcherProviderAutoConfiguration.java
...vlet/SecurityRequestMatcherProviderAutoConfiguration.java
+2
-2
SpringBootWebSecurityConfiguration.java
.../security/servlet/SpringBootWebSecurityConfiguration.java
+2
-2
StaticResourceRequest.java
...autoconfigure/security/servlet/StaticResourceRequest.java
+2
-2
UserDetailsServiceAutoConfiguration.java
...security/servlet/UserDetailsServiceAutoConfiguration.java
+2
-2
WebSecurityEnablerConfiguration.java
...ure/security/servlet/WebSecurityEnablerConfiguration.java
+3
-3
package-info.java
...ork/boot/autoconfigure/security/servlet/package-info.java
+1
-1
ServletWebSecurityAutoConfiguration.java
...rity/web/servlet/ServletWebSecurityAutoConfiguration.java
+0
-47
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+10
-11
JpaUserDetailsTests.java
.../boot/autoconfigure/security/jpa/JpaUserDetailsTests.java
+1
-1
ReactiveOAuth2ClientAutoConfigurationTests.java
.../reactive/ReactiveOAuth2ClientAutoConfigurationTests.java
+1
-1
OAuth2ClientRegistrationRepositoryConfigurationTests.java
...OAuth2ClientRegistrationRepositoryConfigurationTests.java
+1
-1
OAuth2WebSecurityConfigurationTests.java
...2/client/servlet/OAuth2WebSecurityConfigurationTests.java
+1
-1
ReactiveOAuth2ResourceServerAutoConfigurationTests.java
...e/ReactiveOAuth2ResourceServerAutoConfigurationTests.java
+1
-1
OAuth2ResourceServerAutoConfigurationTests.java
...e/servlet/OAuth2ResourceServerAutoConfigurationTests.java
+1
-1
PathRequestTests.java
...oot/autoconfigure/security/reactive/PathRequestTests.java
+1
-1
ReactiveSecurityAutoConfigurationTests.java
...rity/reactive/ReactiveSecurityAutoConfigurationTests.java
+5
-6
ReactiveUserDetailsServiceAutoConfigurationTests.java
...ive/ReactiveUserDetailsServiceAutoConfigurationTests.java
+4
-1
StaticResourceRequestTests.java
...nfigure/security/reactive/StaticResourceRequestTests.java
+1
-1
PathRequestTests.java
...boot/autoconfigure/security/servlet/PathRequestTests.java
+1
-1
SecurityAutoConfigurationTests.java
...gure/security/servlet/SecurityAutoConfigurationTests.java
+91
-2
SecurityFilterAutoConfigurationEarlyInitializationTests.java
...urityFilterAutoConfigurationEarlyInitializationTests.java
+1
-4
SecurityFilterAutoConfigurationTests.java
...ecurity/servlet/SecurityFilterAutoConfigurationTests.java
+6
-7
SecurityRequestMatcherProviderAutoConfigurationTests.java
...SecurityRequestMatcherProviderAutoConfigurationTests.java
+1
-1
StaticResourceRequestTests.java
...onfigure/security/servlet/StaticResourceRequestTests.java
+1
-1
UserDetailsServiceAutoConfigurationTests.java
...ity/servlet/UserDetailsServiceAutoConfigurationTests.java
+2
-1
ServletWebSecurityAutoConfigurationTests.java
...web/servlet/ServletWebSecurityAutoConfigurationTests.java
+0
-131
FilterOrderingIntegrationTests.java
...configure/web/servlet/FilterOrderingIntegrationTests.java
+2
-3
CustomWebFluxSecurityExample.java
.../boot/docs/web/security/CustomWebFluxSecurityExample.java
+1
-1
MockMvcSecurityAutoConfiguration.java
...nfigure/web/servlet/MockMvcSecurityAutoConfiguration.java
+4
-5
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+2
-2
RestDocsTestApplication.java
.../test/autoconfigure/restdocs/RestDocsTestApplication.java
+2
-4
SecurityConfiguration.java
...sample/actuator/customsecurity/SecurityConfiguration.java
+2
-2
SampleSecureWebFluxCustomSecurityTests.java
...ecure/webflux/SampleSecureWebFluxCustomSecurityTests.java
+2
-2
SampleMethodSecurityApplication.java
...mple/security/method/SampleMethodSecurityApplication.java
+1
-1
SampleWebSecureApplication.java
...in/java/sample/web/secure/SampleWebSecureApplication.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
reactive/EndpointRequest.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
reactive
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -49,7 +49,7 @@ import org.springframework.web.server.ServerWebExchange;
...
@@ -49,7 +49,7 @@ import org.springframework.web.server.ServerWebExchange;
* endpoint locations.
* endpoint locations.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
public
final
class
EndpointRequest
{
public
final
class
EndpointRequest
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
reactive/ReactiveManagementWebSecurityAutoConfiguration.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
reactive
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
...
@@ -27,8 +27,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
...
@@ -27,8 +27,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.ReactiveOAuth2ClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.
reactive.
ReactiveOAuth2ClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
web.reactive.ReactiveWeb
SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.Reactive
SecurityAutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
;
import
org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
;
...
@@ -48,7 +48,7 @@ import org.springframework.security.web.server.WebFilterChainProxy;
...
@@ -48,7 +48,7 @@ import org.springframework.security.web.server.WebFilterChainProxy;
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
WebFilterChainProxy
.
class
})
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
WebFilterChainProxy
.
class
})
@ConditionalOnMissingBean
({
SecurityWebFilterChain
.
class
,
WebFilterChainProxy
.
class
})
@ConditionalOnMissingBean
({
SecurityWebFilterChain
.
class
,
WebFilterChainProxy
.
class
})
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
@AutoConfigureBefore
(
Reactive
Web
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
ReactiveSecurityAutoConfiguration
.
class
)
@AutoConfigureAfter
({
HealthEndpointAutoConfiguration
.
class
,
@AutoConfigureAfter
({
HealthEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
ReactiveOAuth2ClientAutoConfiguration
.
class
})
ReactiveOAuth2ClientAutoConfiguration
.
class
})
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
reactive/package-info.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/package-info.java
View file @
474da80b
...
@@ -17,4 +17,4 @@
...
@@ -17,4 +17,4 @@
/**
/**
* Auto-configuration for actuator security using WebFlux.
* Auto-configuration for actuator security using WebFlux.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
reactive
;
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
servlet/EndpointRequest.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
servlet
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -34,7 +34,7 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointPr
...
@@ -34,7 +34,7 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointPr
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.annotation.Endpoint
;
import
org.springframework.boot.actuate.endpoint.annotation.Endpoint
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.autoconfigure.security.
web.
servlet.RequestMatcherProvider
;
import
org.springframework.boot.autoconfigure.security.servlet.RequestMatcherProvider
;
import
org.springframework.boot.security.servlet.ApplicationContextRequestMatcher
;
import
org.springframework.boot.security.servlet.ApplicationContextRequestMatcher
;
import
org.springframework.core.annotation.AnnotatedElementUtils
;
import
org.springframework.core.annotation.AnnotatedElementUtils
;
import
org.springframework.security.web.util.matcher.AntPathRequestMatcher
;
import
org.springframework.security.web.util.matcher.AntPathRequestMatcher
;
...
@@ -50,7 +50,7 @@ import org.springframework.web.context.WebApplicationContext;
...
@@ -50,7 +50,7 @@ import org.springframework.web.context.WebApplicationContext;
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
public
final
class
EndpointRequest
{
public
final
class
EndpointRequest
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
servlet/ManagementWebSecurityAutoConfiguration.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
...
@@ -25,9 +25,9 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
...
@@ -25,9 +25,9 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.
web
.OAuth2ClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.
servlet
.OAuth2ClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
web.servlet.EnableWebSecurity
Configuration
;
import
org.springframework.boot.autoconfigure.security.
servlet.SecurityAuto
Configuration
;
import
org.springframework.boot.autoconfigure.security.
web.servlet.ServletWebSecurityAuto
Configuration
;
import
org.springframework.boot.autoconfigure.security.
servlet.WebSecurityEnabler
Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
...
@@ -44,12 +44,12 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
...
@@ -44,12 +44,12 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
@ConditionalOnClass
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnClass
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnMissingBean
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnMissingBean
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
SERVLET
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
SERVLET
)
@AutoConfigureBefore
(
Se
rvletWebSe
curityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
SecurityAutoConfiguration
.
class
)
@AutoConfigureAfter
({
HealthEndpointAutoConfiguration
.
class
,
@AutoConfigureAfter
({
HealthEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
OAuth2ClientAutoConfiguration
.
class
})
OAuth2ClientAutoConfiguration
.
class
})
@Import
({
ManagementWebSecurityConfigurerAdapter
.
class
,
@Import
({
ManagementWebSecurityConfigurerAdapter
.
class
,
EnableWebSecurity
Configuration
.
class
})
WebSecurityEnabler
Configuration
.
class
})
public
class
ManagementWebSecurityAutoConfiguration
{
public
class
ManagementWebSecurityAutoConfiguration
{
}
}
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
servlet/ManagementWebSecurityConfigurerAdapter.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityConfigurerAdapter.java
View file @
474da80b
...
@@ -14,22 +14,23 @@
...
@@ -14,22 +14,23 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.actuate.health.HealthEndpoint
;
import
org.springframework.boot.actuate.health.HealthEndpoint
;
import
org.springframework.boot.actuate.info.InfoEndpoint
;
import
org.springframework.boot.actuate.info.InfoEndpoint
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SpringBootWebSecurityConfiguration
;
import
org.springframework.context.annotation.Configuration
;
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.WebSecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
/**
/**
* The default configuration for web security when the actuator dependency is on the
* The default configuration for web security when the actuator dependency is on the
* classpath. It is different from {@link SpringBootWebSecurityConfiguration} in that it
* classpath. It is different from
* allows unauthenticated access to the {@link HealthEndpoint} and {@link InfoEndpoint}.
* {@link org.springframework.boot.autoconfigure.security.servlet.SpringBootWebSecurityConfiguration}
* If the user specifies their own {@link WebSecurityConfigurerAdapter}, this will
* in that it allows unauthenticated access to the {@link HealthEndpoint} and
* back-off completely and the user should specify all the bits that they want to
* {@link InfoEndpoint}. If the user specifies their own
* configure as part of the custom security configuration.
* {@link WebSecurityConfigurerAdapter}, this will back-off completely and the user should
* specify all the bits that they want to configure as part of the custom security
* configuration.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
*/
*/
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/
web/
servlet/package-info.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/package-info.java
View file @
474da80b
...
@@ -17,4 +17,4 @@
...
@@ -17,4 +17,4 @@
/**
/**
* Auto-configuration for actuator security using Spring MVC.
* Auto-configuration for actuator security using Spring MVC.
*/
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
security
.
servlet
;
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
474da80b
...
@@ -77,8 +77,8 @@ org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthIndicatorAutoCon
...
@@ -77,8 +77,8 @@ org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthIndicatorAutoCon
org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.
web.
reactive.ReactiveManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.
web.
servlet.ManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.session.SessionsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.session.SessionsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.solr.SolrHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.solr.SolrHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthIndicatorAutoConfiguration,\
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java
View file @
474da80b
...
@@ -27,8 +27,8 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
...
@@ -27,8 +27,8 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
web.reactive.ReactiveWebSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
...
@@ -45,7 +45,7 @@ public class CloudFoundryReactiveHealthEndpointWebExtensionTests {
...
@@ -45,7 +45,7 @@ public class CloudFoundryReactiveHealthEndpointWebExtensionTests {
private
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
()
private
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
()
.
withPropertyValues
(
"VCAP_APPLICATION={}"
)
.
withPropertyValues
(
"VCAP_APPLICATION={}"
)
.
withConfiguration
(
AutoConfigurations
.
of
(
.
withConfiguration
(
AutoConfigurations
.
of
(
Reactive
Web
SecurityAutoConfiguration
.
class
,
ReactiveSecurityAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfigurationTests.java
View file @
474da80b
...
@@ -44,8 +44,8 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
...
@@ -44,8 +44,8 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
web.reactive.ReactiveWebSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
...
@@ -76,7 +76,7 @@ public class ReactiveCloudFoundryActuatorAutoConfigurationTests {
...
@@ -76,7 +76,7 @@ public class ReactiveCloudFoundryActuatorAutoConfigurationTests {
private
final
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
()
private
final
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
()
.
withConfiguration
(
AutoConfigurations
.
of
(
.
withConfiguration
(
AutoConfigurations
.
of
(
Reactive
Web
SecurityAutoConfiguration
.
class
,
ReactiveSecurityAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java
View file @
474da80b
...
@@ -38,8 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
...
@@ -38,8 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
...
@@ -71,7 +70,6 @@ public class CloudFoundryActuatorAutoConfigurationTests {
...
@@ -71,7 +70,6 @@ public class CloudFoundryActuatorAutoConfigurationTests {
private
final
WebApplicationContextRunner
contextRunner
=
new
WebApplicationContextRunner
()
private
final
WebApplicationContextRunner
contextRunner
=
new
WebApplicationContextRunner
()
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityAutoConfiguration
.
class
,
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java
View file @
474da80b
...
@@ -28,7 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
...
@@ -28,7 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
servlet.
SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java
View file @
474da80b
...
@@ -31,8 +31,7 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
...
@@ -31,8 +31,7 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.test.util.TestPropertyValues
;
...
@@ -119,8 +118,7 @@ public class ControllerEndpointWebMvcIntegrationTests {
...
@@ -119,8 +118,7 @@ public class ControllerEndpointWebMvcIntegrationTests {
}
}
@Import
(
DefaultConfiguration
.
class
)
@Import
(
DefaultConfiguration
.
class
)
@ImportAutoConfiguration
({
SecurityAutoConfiguration
.
class
,
@ImportAutoConfiguration
({
SecurityAutoConfiguration
.
class
})
ServletWebSecurityAutoConfiguration
.
class
})
static
class
SecureConfiguration
{
static
class
SecureConfiguration
{
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java
View file @
474da80b
...
@@ -39,8 +39,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoCon
...
@@ -39,8 +39,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoCon
import
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.test.util.TestPropertyValues
;
...
@@ -165,8 +164,7 @@ public class WebMvcEndpointIntegrationTests {
...
@@ -165,8 +164,7 @@ public class WebMvcEndpointIntegrationTests {
}
}
@Import
(
DefaultConfiguration
.
class
)
@Import
(
DefaultConfiguration
.
class
)
@ImportAutoConfiguration
({
SecurityAutoConfiguration
.
class
,
@ImportAutoConfiguration
({
SecurityAutoConfiguration
.
class
})
ServletWebSecurityAutoConfiguration
.
class
})
static
class
SecureConfiguration
{
static
class
SecureConfiguration
{
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java
View file @
474da80b
...
@@ -23,7 +23,6 @@ import org.assertj.core.api.AssertDelegateTarget;
...
@@ -23,7 +23,6 @@ import org.assertj.core.api.AssertDelegateTarget;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.security.web.reactive.EndpointRequest
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.Operation
;
import
org.springframework.boot.actuate.endpoint.Operation
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java
View file @
474da80b
...
@@ -30,10 +30,9 @@ import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAut
...
@@ -30,10 +30,9 @@ import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAut
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.security.web.reactive.ReactiveManagementWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.
ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
web.reactive.ReactiveWebSecurity
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
reactive.ReactiveUserDetailsService
AutoConfiguration
;
import
org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext
;
import
org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
...
@@ -70,7 +69,7 @@ public class ReactiveManagementWebSecurityAutoConfigurationTests {
...
@@ -70,7 +69,7 @@ public class ReactiveManagementWebSecurityAutoConfigurationTests {
InfoEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
EnvironmentEndpointAutoConfiguration
.
class
,
EnvironmentEndpointAutoConfiguration
.
class
,
EndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
EndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
Reactive
Web
SecurityAutoConfiguration
.
class
,
ReactiveSecurityAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
,
ReactiveManagementWebSecurityAutoConfiguration
.
class
));
ReactiveManagementWebSecurityAutoConfiguration
.
class
));
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java
View file @
474da80b
...
@@ -21,7 +21,6 @@ import java.util.List;
...
@@ -21,7 +21,6 @@ import java.util.List;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.autoconfigure.security.web.servlet.EndpointRequest
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.Operation
;
import
org.springframework.boot.actuate.endpoint.Operation
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java
View file @
474da80b
...
@@ -25,7 +25,6 @@ import org.assertj.core.api.AssertDelegateTarget;
...
@@ -25,7 +25,6 @@ import org.assertj.core.api.AssertDelegateTarget;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.security.web.servlet.EndpointRequest
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.actuate.endpoint.Operation
;
import
org.springframework.boot.actuate.endpoint.Operation
;
...
@@ -33,7 +32,7 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
...
@@ -33,7 +32,7 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint
;
import
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint
;
import
org.springframework.boot.autoconfigure.security.
web.
servlet.RequestMatcherProvider
;
import
org.springframework.boot.autoconfigure.security.servlet.RequestMatcherProvider
;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java
View file @
474da80b
...
@@ -25,7 +25,6 @@ import org.glassfish.jersey.server.ResourceConfig;
...
@@ -25,7 +25,6 @@ import org.glassfish.jersey.server.ResourceConfig;
import
org.glassfish.jersey.server.model.Resource
;
import
org.glassfish.jersey.server.model.Resource
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.security.web.servlet.EndpointRequest
;
import
org.springframework.boot.actuate.endpoint.http.ActuatorMediaType
;
import
org.springframework.boot.actuate.endpoint.http.ActuatorMediaType
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver
;
import
org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver
;
...
@@ -37,10 +36,9 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
...
@@ -37,10 +36,9 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer
;
import
org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityRequestMatcherProviderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityRequestMatcherProviderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
...
@@ -65,7 +63,6 @@ public class JerseyEndpointRequestIntegrationTests
...
@@ -65,7 +63,6 @@ public class JerseyEndpointRequestIntegrationTests
SecurityConfiguration
.
class
,
BaseConfiguration
.
class
)
SecurityConfiguration
.
class
,
BaseConfiguration
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
SecurityRequestMatcherProviderAutoConfiguration
.
class
,
SecurityRequestMatcherProviderAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java
View file @
474da80b
...
@@ -27,10 +27,8 @@ import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAut
...
@@ -27,10 +27,8 @@ import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAut
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.security.web.servlet.ManagementWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.test.context.assertj.AssertableWebApplicationContext
;
import
org.springframework.boot.test.context.assertj.AssertableWebApplicationContext
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -60,7 +58,6 @@ public class ManagementWebSecurityAutoConfigurationTests {
...
@@ -60,7 +58,6 @@ public class ManagementWebSecurityAutoConfigurationTests {
EnvironmentEndpointAutoConfiguration
.
class
,
EnvironmentEndpointAutoConfiguration
.
class
,
EndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
EndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
ManagementWebSecurityAutoConfiguration
.
class
));
ManagementWebSecurityAutoConfiguration
.
class
));
@Test
@Test
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java
View file @
474da80b
...
@@ -22,7 +22,6 @@ import java.util.List;
...
@@ -22,7 +22,6 @@ import java.util.List;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.security.web.servlet.EndpointRequest
;
import
org.springframework.boot.actuate.endpoint.http.ActuatorMediaType
;
import
org.springframework.boot.actuate.endpoint.http.ActuatorMediaType
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver
;
import
org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver
;
...
@@ -33,10 +32,9 @@ import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandl
...
@@ -33,10 +32,9 @@ import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandl
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityRequestMatcherProviderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityRequestMatcherProviderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
...
@@ -101,7 +99,6 @@ public class MvcEndpointRequestIntegrationTests
...
@@ -101,7 +99,6 @@ public class MvcEndpointRequestIntegrationTests
SecurityConfiguration
.
class
,
BaseConfiguration
.
class
)
SecurityConfiguration
.
class
,
BaseConfiguration
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
SecurityRequestMatcherProviderAutoConfiguration
.
class
,
SecurityRequestMatcherProviderAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityDataConfiguration.java
0 → 100644
View file @
474da80b
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.data.repository.query.SecurityEvaluationContextExtension
;
/**
* Automatically adds Spring Security's integration with Spring Data.
*
* @author Rob Winch
* @since 1.3
*/
@Configuration
@ConditionalOnClass
(
SecurityEvaluationContextExtension
.
class
)
public
class
SecurityDataConfiguration
{
@Bean
@ConditionalOnMissingBean
public
SecurityEvaluationContextExtension
securityEvaluationContextExtension
()
{
return
new
SecurityEvaluationContextExtension
();
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ReactiveOAuth2ClientAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
reactive/
ReactiveOAuth2ClientAutoConfiguration.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
reactive
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -27,7 +27,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
...
@@ -27,7 +27,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.NoneNestedConditions
;
import
org.springframework.boot.autoconfigure.condition.NoneNestedConditions
;
import
org.springframework.boot.autoconfigure.security.web.reactive.ReactiveWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.ClientsConfiguredCondition
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientPropertiesRegistrationAdapter
;
import
org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Conditional
;
...
@@ -49,7 +52,7 @@ import org.springframework.security.oauth2.client.web.server.ServerOAuth2Authori
...
@@ -49,7 +52,7 @@ import org.springframework.security.oauth2.client.web.server.ServerOAuth2Authori
* @since 2.1.0
* @since 2.1.0
*/
*/
@Configuration
@Configuration
@AutoConfigureBefore
(
Reactive
Web
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
ReactiveSecurityAutoConfiguration
.
class
)
@EnableConfigurationProperties
(
OAuth2ClientProperties
.
class
)
@EnableConfigurationProperties
(
OAuth2ClientProperties
.
class
)
@Conditional
(
ReactiveOAuth2ClientAutoConfiguration
.
NonServletApplicationCondition
.
class
)
@Conditional
(
ReactiveOAuth2ClientAutoConfiguration
.
NonServletApplicationCondition
.
class
)
@ConditionalOnClass
({
Flux
.
class
,
EnableWebFluxSecurity
.
class
,
ClientRegistration
.
class
})
@ConditionalOnClass
({
Flux
.
class
,
EnableWebFluxSecurity
.
class
,
ClientRegistration
.
class
})
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/reactive/package-info.java
0 → 100644
View file @
474da80b
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for Spring Security's Reactive OAuth 2 client.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
reactive
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
web
/OAuth2ClientAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
servlet
/OAuth2ClientAutoConfiguration.java
View file @
474da80b
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
web
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
servlet.
SecurityAutoConfiguration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
...
@@ -31,7 +31,7 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio
...
@@ -31,7 +31,7 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
@Configuration
@Configuration
@AutoConfigureBefore
(
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
SecurityAutoConfiguration
.
class
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
web
/OAuth2ClientRegistrationRepositoryConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
servlet
/OAuth2ClientRegistrationRepositoryConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
web
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
web
/OAuth2WebSecurityConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/
servlet
/OAuth2WebSecurityConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
web
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
@@ -33,7 +33,7 @@ import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepo
...
@@ -33,7 +33,7 @@ import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepo
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
@Configuration
@Configuration
@ConditionalOnBean
(
ClientRegistrationRepository
.
class
)
@ConditionalOnBean
(
ClientRegistrationRepository
.
class
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/package-info.java
0 → 100644
View file @
474da80b
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for Spring Security's OAuth 2 client.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ReactiveOAuth2ResourceServerAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
reactive/
ReactiveOAuth2ResourceServerAutoConfiguration.java
View file @
474da80b
...
@@ -13,13 +13,14 @@
...
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
reactive
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.web.reactive.ReactiveWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties
;
import
org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
...
@@ -34,7 +35,7 @@ import org.springframework.security.oauth2.server.resource.BearerTokenAuthentica
...
@@ -34,7 +35,7 @@ import org.springframework.security.oauth2.server.resource.BearerTokenAuthentica
* @since 2.1.0
* @since 2.1.0
*/
*/
@Configuration
@Configuration
@AutoConfigureBefore
(
Reactive
Web
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
ReactiveSecurityAutoConfiguration
.
class
)
@EnableConfigurationProperties
(
OAuth2ResourceServerProperties
.
class
)
@EnableConfigurationProperties
(
OAuth2ResourceServerProperties
.
class
)
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
BearerTokenAuthenticationToken
.
class
})
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
BearerTokenAuthenticationToken
.
class
})
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ReactiveOAuth2ResourceServerJwkConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
reactive/
ReactiveOAuth2ResourceServerJwkConfiguration.java
View file @
474da80b
...
@@ -13,10 +13,12 @@
...
@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
reactive
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.IssuerUriCondition
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
reactive/
ReactiveOAuth2ResourceServerWebSecurityConfiguration.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
reactive
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/package-info.java
0 → 100644
View file @
474da80b
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for Spring Security's Reactive OAuth2 resource server.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
reactive
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
servlet/
OAuth2ResourceServerAutoConfiguration.java
View file @
474da80b
...
@@ -13,13 +13,14 @@
...
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
servlet
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerJwkConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
servlet/
OAuth2ResourceServerJwkConfiguration.java
View file @
474da80b
...
@@ -13,10 +13,12 @@
...
@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.IssuerUriCondition
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerWebSecurityConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
servlet/
OAuth2ResourceServerWebSecurityConfiguration.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/package-info.java
0 → 100644
View file @
474da80b
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for Spring Security's OAuth2 resource server.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
servlet
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
reactive/PathRequest.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
org.springframework.boot.autoconfigure.security.StaticResourceLocation
;
import
org.springframework.boot.autoconfigure.security.StaticResourceLocation
;
import
org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher
;
import
org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/reactive/ReactiveWeb
SecurityAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
reactive/Reactive
SecurityAutoConfiguration.java
View file @
474da80b
...
@@ -14,16 +14,14 @@
...
@@ -14,16 +14,14 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Flux
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -44,8 +42,7 @@ import org.springframework.security.web.server.WebFilterChainProxy;
...
@@ -44,8 +42,7 @@ import org.springframework.security.web.server.WebFilterChainProxy;
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@ConditionalOnClass
({
Flux
.
class
,
EnableWebFluxSecurity
.
class
,
@ConditionalOnClass
({
Flux
.
class
,
EnableWebFluxSecurity
.
class
,
WebFilterChainProxy
.
class
})
WebFilterChainProxy
.
class
})
@AutoConfigureAfter
(
SecurityAutoConfiguration
.
class
)
public
class
ReactiveSecurityAutoConfiguration
{
public
class
ReactiveWebSecurityAutoConfiguration
{
@Configuration
@Configuration
@ConditionalOnMissingBean
(
WebFilterChainProxy
.
class
)
@ConditionalOnMissingBean
(
WebFilterChainProxy
.
class
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/ReactiveUserDetailsServiceAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
reactive/
ReactiveUserDetailsServiceAutoConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.ObjectProvider;
...
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.ObjectProvider;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.authentication.ReactiveAuthenticationManager
;
import
org.springframework.security.authentication.ReactiveAuthenticationManager
;
...
@@ -37,17 +38,12 @@ import org.springframework.security.crypto.password.PasswordEncoder;
...
@@ -37,17 +38,12 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
/**
/**
* Default user {@link Configuration} for a reactive application. Configures a
* Default user {@link Configuration} for a reactive
web
application. Configures a
* {@link ReactiveUserDetailsService} with a default user and generated password. This
* {@link ReactiveUserDetailsService} with a default user and generated password. This
* backs-off completely if there is a bean of type {@link ReactiveUserDetailsService} or
* backs-off completely if there is a bean of type {@link ReactiveUserDetailsService} or
* {@link ReactiveAuthenticationManager}.
* {@link ReactiveAuthenticationManager}.
* <p>
* Note that the current reactive application detection mechanism is limited to web
* applications only. If you're writing a non-web application you will currently need to
* configure reactive security yourself.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.1.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
({
ReactiveAuthenticationManager
.
class
})
@ConditionalOnClass
({
ReactiveAuthenticationManager
.
class
})
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
reactive/StaticResourceRequest.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
java.util.EnumSet
;
import
java.util.EnumSet
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedHashSet
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
reactive/package-info.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/package-info.java
View file @
474da80b
...
@@ -17,4 +17,4 @@
...
@@ -17,4 +17,4 @@
/**
/**
* Auto-configuration for reactive Spring Security.
* Auto-configuration for reactive Spring Security.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/MvcRequestMatcherProvider.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/MvcRequestMatcherProvider.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher
;
import
org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
...
@@ -24,7 +24,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
...
@@ -24,7 +24,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
* used for Spring MVC applications.
* used for Spring MVC applications.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1.0
* @since 2.
0.5
*/
*/
public
class
MvcRequestMatcherProvider
implements
RequestMatcherProvider
{
public
class
MvcRequestMatcherProvider
implements
RequestMatcherProvider
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/PathRequest.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.function.Supplier
;
import
java.util.function.Supplier
;
...
@@ -31,7 +31,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
...
@@ -31,7 +31,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
public
final
class
PathRequest
{
public
final
class
PathRequest
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/RequestMatcherProvider.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/RequestMatcherProvider.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
...
@@ -22,7 +22,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
...
@@ -22,7 +22,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
* Spring Security.
* Spring Security.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1.0
* @since 2.
0.5
*/
*/
@FunctionalInterface
@FunctionalInterface
public
interface
RequestMatcherProvider
{
public
interface
RequestMatcherProvider
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
servlet/
SecurityAutoConfiguration.java
View file @
474da80b
...
@@ -14,18 +14,20 @@
...
@@ -14,18 +14,20 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.security.SecurityDataConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.security.authentication.AuthenticationEventPublisher
;
import
org.springframework.security.authentication.AuthenticationEventPublisher
;
import
org.springframework.security.authentication.DefaultAuthenticationEventPublisher
;
import
org.springframework.security.authentication.DefaultAuthenticationEventPublisher
;
import
org.springframework.security.data.repository.query.SecurityEvaluationContextExtension
;
/**
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Security.
* {@link EnableAutoConfiguration Auto-configuration} for Spring Security.
...
@@ -33,12 +35,12 @@ import org.springframework.security.data.repository.query.SecurityEvaluationCont
...
@@ -33,12 +35,12 @@ import org.springframework.security.data.repository.query.SecurityEvaluationCont
* @author Dave Syer
* @author Dave Syer
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Madhura Bhave
* @author Madhura Bhave
* @author Rob Winch
* @since 2.1.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
DefaultAuthenticationEventPublisher
.
class
)
@ConditionalOnClass
(
DefaultAuthenticationEventPublisher
.
class
)
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@Import
({
SpringBootWebSecurityConfiguration
.
class
,
WebSecurityEnablerConfiguration
.
class
,
SecurityDataConfiguration
.
class
})
public
class
SecurityAutoConfiguration
{
public
class
SecurityAutoConfiguration
{
@Bean
@Bean
...
@@ -48,16 +50,4 @@ public class SecurityAutoConfiguration {
...
@@ -48,16 +50,4 @@ public class SecurityAutoConfiguration {
return
new
DefaultAuthenticationEventPublisher
(
publisher
);
return
new
DefaultAuthenticationEventPublisher
(
publisher
);
}
}
@Configuration
@ConditionalOnClass
(
SecurityEvaluationContextExtension
.
class
)
static
class
SecurityDataConfiguration
{
@Bean
@ConditionalOnMissingBean
public
SecurityEvaluationContextExtension
securityEvaluationContextExtension
()
{
return
new
SecurityEvaluationContextExtension
();
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SecurityFilterAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.EnumSet
;
import
java.util.EnumSet
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -22,14 +22,12 @@ import java.util.stream.Collectors;
...
@@ -22,14 +22,12 @@ import java.util.stream.Collectors;
import
javax.servlet.DispatcherType
;
import
javax.servlet.DispatcherType
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean
;
import
org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -47,15 +45,14 @@ import org.springframework.security.web.context.AbstractSecurityWebApplicationIn
...
@@ -47,15 +45,14 @@ import org.springframework.security.web.context.AbstractSecurityWebApplicationIn
* @author Rob Winch
* @author Rob Winch
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
* @since
2.1.0
* @since
1.3
*/
*/
@Configuration
@Configuration
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@ConditionalOnClass
({
AbstractSecurityWebApplicationInitializer
.
class
,
@ConditionalOnClass
({
AbstractSecurityWebApplicationInitializer
.
class
,
SessionCreationPolicy
.
class
})
SessionCreationPolicy
.
class
})
@AutoConfigureAfter
(
ServletWebSecurityAutoConfiguration
.
class
)
@AutoConfigureAfter
(
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
UserDetailsServiceAutoConfiguration
.
class
)
public
class
SecurityFilterAutoConfiguration
{
public
class
SecurityFilterAutoConfiguration
{
private
static
final
String
DEFAULT_FILTER_NAME
=
AbstractSecurityWebApplicationInitializer
.
DEFAULT_FILTER_NAME
;
private
static
final
String
DEFAULT_FILTER_NAME
=
AbstractSecurityWebApplicationInitializer
.
DEFAULT_FILTER_NAME
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SecurityRequestMatcherProviderAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfiguration.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
...
@@ -28,7 +28,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
...
@@ -28,7 +28,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
* Auto-configuration for {@link RequestMatcherProvider}.
* Auto-configuration for {@link RequestMatcherProvider}.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1.0
* @since 2.
0.5
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
({
RequestMatcher
.
class
,
DispatcherServlet
.
class
})
@ConditionalOnClass
({
RequestMatcher
.
class
,
DispatcherServlet
.
class
})
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SpringBootWebSecurityConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SpringBootWebSecurityConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
@@ -33,7 +33,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
...
@@ -33,7 +33,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
* part of the custom security configuration.
* part of the custom security configuration.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnClass
(
WebSecurityConfigurerAdapter
.
class
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/StaticResourceRequest.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.EnumSet
;
import
java.util.EnumSet
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedHashSet
;
...
@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
...
@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @since 2.
1
.0
* @since 2.
0
.0
* @see PathRequest
* @see PathRequest
*/
*/
public
final
class
StaticResourceRequest
{
public
final
class
StaticResourceRequest
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/UserDetailsServiceAutoConfiguration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
servlet/
UserDetailsServiceAutoConfiguration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
...
@@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
...
@@ -49,7 +50,6 @@ import org.springframework.util.StringUtils;
...
@@ -49,7 +50,6 @@ import org.springframework.util.StringUtils;
* @author Dave Syer
* @author Dave Syer
* @author Rob Winch
* @author Rob Winch
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.1.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
AuthenticationManager
.
class
)
@ConditionalOnClass
(
AuthenticationManager
.
class
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/servlet/EnableWebSecurity
Configuration.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
servlet/WebSecurityEnabler
Configuration.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
@@ -33,13 +33,13 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
...
@@ -33,13 +33,13 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
* been configured by the user, this will back-off.
* been configured by the user, this will back-off.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.
1
.0
* @since 2.
0
.0
*/
*/
@Configuration
@Configuration
@ConditionalOnBean
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnBean
(
WebSecurityConfigurerAdapter
.
class
)
@ConditionalOnMissingBean
(
name
=
BeanIds
.
SPRING_SECURITY_FILTER_CHAIN
)
@ConditionalOnMissingBean
(
name
=
BeanIds
.
SPRING_SECURITY_FILTER_CHAIN
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
SERVLET
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
SERVLET
)
@EnableWebSecurity
@EnableWebSecurity
public
class
EnableWebSecurity
Configuration
{
public
class
WebSecurityEnabler
Configuration
{
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/
web/
servlet/package-info.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/package-info.java
View file @
474da80b
...
@@ -17,4 +17,4 @@
...
@@ -17,4 +17,4 @@
/**
/**
* Auto-configuration for Servlet-based Spring Security.
* Auto-configuration for Servlet-based Spring Security.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/web/servlet/ServletWebSecurityAutoConfiguration.java
deleted
100644 → 0
View file @
ea42fb44
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.security.authentication.DefaultAuthenticationEventPublisher
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Security in a servlet web
* application.
*
* @author Madhura Bhave
* @since 2.1.0
*/
@Configuration
@EnableConfigurationProperties
(
SecurityProperties
.
class
)
@ConditionalOnClass
(
DefaultAuthenticationEventPublisher
.
class
)
@AutoConfigureAfter
(
SecurityAutoConfiguration
.
class
)
@AutoConfigureBefore
(
UserDetailsServiceAutoConfiguration
.
class
)
@Import
({
SpringBootWebSecurityConfiguration
.
class
,
EnableWebSecurityConfiguration
.
class
})
public
class
ServletWebSecurityAutoConfiguration
{
}
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
474da80b
...
@@ -99,19 +99,18 @@ org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
...
@@ -99,19 +99,18 @@ org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration,\
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration,\
org.springframework.boot.autoconfigure.reactor.core.ReactorCoreAutoConfiguration,\
org.springframework.boot.autoconfigure.reactor.core.ReactorCoreAutoConfiguration,\
org.springframework.boot.autoconfigure.security.ReactiveUserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.SecurityRequestMatcherProviderAutoConfiguration,\
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.web.reactive.ReactiveWebSecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration,\
org.springframework.boot.autoconfigure.security.web.servlet.SecurityRequestMatcherProviderAutoConfiguration,\
org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfiguration,\
org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration,\
org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration,\
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,\
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.client.
web
.OAuth2ClientAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.client.
servlet
.OAuth2ClientAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.client.ReactiveOAuth2ClientAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.client.
reactive.
ReactiveOAuth2ClientAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.resource.
servlet.
OAuth2ResourceServerAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.resource.ReactiveOAuth2ResourceServerAutoConfiguration,\
org.springframework.boot.autoconfigure.security.oauth2.resource.
reactive.
ReactiveOAuth2ResourceServerAutoConfiguration,\
org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration,\
org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration,\
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/jpa/JpaUserDetailsTests.java
View file @
474da80b
...
@@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
...
@@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.
servlet.
SecurityAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootContextLoader
;
import
org.springframework.boot.test.context.SpringBootContextLoader
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.annotation.DirtiesContext
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/ReactiveOAuth2ClientAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/
reactive/
ReactiveOAuth2ClientAutoConfigurationTests.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
reactive
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/
web
/OAuth2ClientRegistrationRepositoryConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/
servlet
/OAuth2ClientRegistrationRepositoryConfigurationTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
web
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/
web
/OAuth2WebSecurityConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/
servlet
/OAuth2WebSecurityConfigurationTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
web
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
client
.
servlet
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ReactiveOAuth2ResourceServerAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
reactive/
ReactiveOAuth2ResourceServerAutoConfigurationTests.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
reactive
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Collections
;
import
java.util.Collections
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/
servlet/
OAuth2ResourceServerAutoConfigurationTests.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
oauth2
.
resource
.
servlet
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
reactive/PathRequestTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/reactive/ReactiveWeb
SecurityAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
reactive/Reactive
SecurityAutoConfigurationTests.java
View file @
474da80b
...
@@ -14,12 +14,11 @@
...
@@ -14,12 +14,11 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.ReactiveUserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -29,11 +28,11 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -29,11 +28,11 @@ import static org.assertj.core.api.Assertions.assertThat;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
* Tests for {@link Reactive
Web
SecurityAutoConfiguration}.
* Tests for {@link ReactiveSecurityAutoConfiguration}.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
*/
*/
public
class
Reactive
Web
SecurityAutoConfigurationTests
{
public
class
ReactiveSecurityAutoConfigurationTests
{
private
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
();
private
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
();
...
@@ -41,7 +40,7 @@ public class ReactiveWebSecurityAutoConfigurationTests {
...
@@ -41,7 +40,7 @@ public class ReactiveWebSecurityAutoConfigurationTests {
public
void
backsOffWhenWebFilterChainProxyBeanPresent
()
{
public
void
backsOffWhenWebFilterChainProxyBeanPresent
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
.
withConfiguration
(
AutoConfigurations
.
of
(
Reactive
Web
SecurityAutoConfiguration
.
class
))
AutoConfigurations
.
of
(
ReactiveSecurityAutoConfiguration
.
class
))
.
withUserConfiguration
(
WebFilterChainProxyConfiguration
.
class
)
.
withUserConfiguration
(
WebFilterChainProxyConfiguration
.
class
)
.
run
((
context
)
->
assertThat
(
context
)
.
run
((
context
)
->
assertThat
(
context
)
.
hasSingleBean
(
WebFilterChainProxy
.
class
));
.
hasSingleBean
(
WebFilterChainProxy
.
class
));
...
@@ -51,7 +50,7 @@ public class ReactiveWebSecurityAutoConfigurationTests {
...
@@ -51,7 +50,7 @@ public class ReactiveWebSecurityAutoConfigurationTests {
public
void
enablesWebFluxSecurity
()
{
public
void
enablesWebFluxSecurity
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
.
withConfiguration
(
AutoConfigurations
.
of
(
Reactive
Web
SecurityAutoConfiguration
.
class
,
AutoConfigurations
.
of
(
ReactiveSecurityAutoConfiguration
.
class
,
ReactiveUserDetailsServiceAutoConfiguration
.
class
))
ReactiveUserDetailsServiceAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
).
getBean
(
WebFilterChainProxy
.
class
)
.
run
((
context
)
->
assertThat
(
context
).
getBean
(
WebFilterChainProxy
.
class
)
.
isNotNull
());
.
isNotNull
());
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/ReactiveUserDetailsServiceAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
reactive/
ReactiveUserDetailsServiceAutoConfigurationTests.java
View file @
474da80b
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
org.junit.Test
;
import
org.junit.Test
;
import
reactor.core.publisher.Mono
;
import
reactor.core.publisher.Mono
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -80,6 +81,8 @@ public class ReactiveUserDetailsServiceAutoConfigurationTests {
...
@@ -80,6 +81,8 @@ public class ReactiveUserDetailsServiceAutoConfigurationTests {
this
.
contextRunner
this
.
contextRunner
.
withUserConfiguration
(
AuthenticationManagerConfig
.
class
,
.
withUserConfiguration
(
AuthenticationManagerConfig
.
class
,
TestSecurityConfiguration
.
class
)
TestSecurityConfiguration
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
ReactiveSecurityAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
)
.
run
((
context
)
->
assertThat
(
context
)
.
getBean
(
ReactiveUserDetailsService
.
class
).
isNull
());
.
getBean
(
ReactiveUserDetailsService
.
class
).
isNull
());
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
reactive/StaticResourceRequestTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
reactive
;
import
org.assertj.core.api.AssertDelegateTarget
;
import
org.assertj.core.api.AssertDelegateTarget
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
servlet/PathRequestTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
servlet/
SecurityAutoConfigurationTests.java
View file @
474da80b
...
@@ -14,7 +14,11 @@
...
@@ -14,7 +14,11 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.EnumSet
;
import
javax.servlet.DispatcherType
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -25,20 +29,24 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
...
@@ -25,20 +29,24 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.test.City
;
import
org.springframework.boot.autoconfigure.orm.jpa.test.City
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfiguration
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean
;
import
org.springframework.boot.web.servlet.filter.OrderedFilter
;
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.Configuration
;
import
org.springframework.orm.jpa.JpaTransactionManager
;
import
org.springframework.orm.jpa.JpaTransactionManager
;
import
org.springframework.security.authentication.AuthenticationEventPublisher
;
import
org.springframework.security.authentication.AuthenticationEventPublisher
;
import
org.springframework.security.authentication.DefaultAuthenticationEventPublisher
;
import
org.springframework.security.authentication.DefaultAuthenticationEventPublisher
;
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
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.data.repository.query.SecurityEvaluationContextExtension
;
import
org.springframework.security.data.repository.query.SecurityEvaluationContextExtension
;
import
org.springframework.security.web.FilterChainProxy
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -59,6 +67,27 @@ public class SecurityAutoConfigurationTests {
...
@@ -59,6 +67,27 @@ public class SecurityAutoConfigurationTests {
@Rule
@Rule
public
OutputCapture
outputCapture
=
new
OutputCapture
();
public
OutputCapture
outputCapture
=
new
OutputCapture
();
@Test
public
void
testWebConfiguration
()
{
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
AuthenticationManagerBuilder
.
class
)).
isNotNull
();
assertThat
(
context
.
getBean
(
FilterChainProxy
.
class
).
getFilterChains
())
.
hasSize
(
1
);
});
}
@Test
public
void
testDefaultFilterOrderWithSecurityAdapter
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
WebSecurity
.
class
,
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
OrderedFilter
.
REQUEST_WRAPPER_FILTER_MAX_ORDER
-
100
));
}
@Test
@Test
public
void
testFilterIsNotRegisteredInNonWeb
()
{
public
void
testFilterIsNotRegisteredInNonWeb
()
{
try
(
AnnotationConfigApplicationContext
customContext
=
new
AnnotationConfigApplicationContext
())
{
try
(
AnnotationConfigApplicationContext
customContext
=
new
AnnotationConfigApplicationContext
())
{
...
@@ -87,6 +116,30 @@ public class SecurityAutoConfigurationTests {
...
@@ -87,6 +116,30 @@ public class SecurityAutoConfigurationTests {
AuthenticationEventPublisherConfiguration
.
TestAuthenticationEventPublisher
.
class
));
AuthenticationEventPublisherConfiguration
.
TestAuthenticationEventPublisher
.
class
));
}
}
@Test
public
void
testDefaultFilterOrder
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
OrderedFilter
.
REQUEST_WRAPPER_FILTER_MAX_ORDER
-
100
));
}
@Test
public
void
testCustomFilterOrder
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
withPropertyValues
(
"spring.security.filter.order:12345"
).
run
(
(
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
12345
));
}
@Test
@Test
public
void
testJpaCoexistsHappily
()
{
public
void
testJpaCoexistsHappily
()
{
this
.
contextRunner
this
.
contextRunner
...
@@ -108,6 +161,42 @@ public class SecurityAutoConfigurationTests {
...
@@ -108,6 +161,42 @@ public class SecurityAutoConfigurationTests {
.
getBean
(
SecurityEvaluationContextExtension
.
class
).
isNotNull
());
.
getBean
(
SecurityEvaluationContextExtension
.
class
).
isNotNull
());
}
}
@Test
public
void
defaultFilterDispatcherTypes
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
{
DelegatingFilterProxyRegistrationBean
bean
=
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
);
@SuppressWarnings
(
"unchecked"
)
EnumSet
<
DispatcherType
>
dispatcherTypes
=
(
EnumSet
<
DispatcherType
>)
ReflectionTestUtils
.
getField
(
bean
,
"dispatcherTypes"
);
assertThat
(
dispatcherTypes
).
containsOnly
(
DispatcherType
.
ASYNC
,
DispatcherType
.
ERROR
,
DispatcherType
.
REQUEST
);
});
}
@Test
public
void
customFilterDispatcherTypes
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.security.filter.dispatcher-types:INCLUDE,ERROR"
)
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
{
DelegatingFilterProxyRegistrationBean
bean
=
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
);
@SuppressWarnings
(
"unchecked"
)
EnumSet
<
DispatcherType
>
dispatcherTypes
=
(
EnumSet
<
DispatcherType
>)
ReflectionTestUtils
.
getField
(
bean
,
"dispatcherTypes"
);
assertThat
(
dispatcherTypes
).
containsOnly
(
DispatcherType
.
INCLUDE
,
DispatcherType
.
ERROR
);
});
}
@Configuration
@Configuration
@TestAutoConfigurationPackage
(
City
.
class
)
@TestAutoConfigurationPackage
(
City
.
class
)
protected
static
class
EntityConfiguration
{
protected
static
class
EntityConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
com.fasterxml.jackson.core.JsonParser
;
import
com.fasterxml.jackson.core.JsonParser
;
import
com.fasterxml.jackson.databind.DeserializationContext
;
import
com.fasterxml.jackson.databind.DeserializationContext
;
...
@@ -28,8 +28,6 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
...
@@ -28,8 +28,6 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
...
@@ -82,7 +80,6 @@ public class SecurityFilterAutoConfigurationEarlyInitializationTests {
...
@@ -82,7 +80,6 @@ public class SecurityFilterAutoConfigurationEarlyInitializationTests {
DispatcherServletAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
SecurityFilterAutoConfiguration
.
class
,
SecurityFilterAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
PropertyPlaceholderAutoConfiguration
.
class
})
static
class
Config
{
static
class
Config
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SecurityFilterAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -22,16 +22,16 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
...
@@ -22,16 +22,16 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ConverterBean
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfigurationTests.WebSecurity
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.DeserializerBean
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ConverterBean
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ExampleController
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.DeserializerBean
;
import
org.springframework.boot.autoconfigure.security.web.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.JacksonModuleBean
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ExampleController
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.JacksonModuleBean
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.security.config.annotation.web.builders.WebSecurity
;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
/**
/**
...
@@ -56,7 +56,6 @@ public class SecurityFilterAutoConfigurationTests {
...
@@ -56,7 +56,6 @@ public class SecurityFilterAutoConfigurationTests {
@ImportAutoConfiguration
({
WebMvcAutoConfiguration
.
class
,
@ImportAutoConfiguration
({
WebMvcAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
WebSecurity
.
class
,
DispatcherServletAutoConfiguration
.
class
,
WebSecurity
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
SecurityFilterAutoConfiguration
.
class
,
SecurityFilterAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
PropertyPlaceholderAutoConfiguration
.
class
})
static
class
Config
{
static
class
Config
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java
View file @
474da80b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
web/
servlet/StaticResourceRequestTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/UserDetailsServiceAutoConfigurationTests.java
→
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/
servlet/
UserDetailsServiceAutoConfigurationTests.java
View file @
474da80b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -22,6 +22,7 @@ import org.junit.Rule;
...
@@ -22,6 +22,7 @@ import org.junit.Rule;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/web/servlet/ServletWebSecurityAutoConfigurationTests.java
deleted
100644 → 0
View file @
ea42fb44
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
security
.
web
.
servlet
;
import
java.util.EnumSet
;
import
javax.servlet.DispatcherType
;
import
org.junit.Test
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean
;
import
org.springframework.boot.web.servlet.filter.OrderedFilter
;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.web.builders.WebSecurity
;
import
org.springframework.security.web.FilterChainProxy
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link ServletWebSecurityAutoConfiguration}.
*
* @author Phillip Webb
*/
public
class
ServletWebSecurityAutoConfigurationTests
{
private
WebApplicationContextRunner
contextRunner
=
new
WebApplicationContextRunner
()
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityAutoConfiguration
.
class
,
ServletWebSecurityAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
));
@Test
public
void
testWebConfiguration
()
{
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
AuthenticationManagerBuilder
.
class
)).
isNotNull
();
assertThat
(
context
.
getBean
(
FilterChainProxy
.
class
).
getFilterChains
())
.
hasSize
(
1
);
});
}
@Test
public
void
testDefaultFilterOrderWithSecurityAdapter
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
WebSecurity
.
class
,
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
OrderedFilter
.
REQUEST_WRAPPER_FILTER_MAX_ORDER
-
100
));
}
@Test
public
void
testDefaultFilterOrder
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
OrderedFilter
.
REQUEST_WRAPPER_FILTER_MAX_ORDER
-
100
));
}
@Test
public
void
testCustomFilterOrder
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
withPropertyValues
(
"spring.security.filter.order:12345"
).
run
(
(
context
)
->
assertThat
(
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
)
.
getOrder
()).
isEqualTo
(
12345
));
}
@Test
public
void
defaultFilterDispatcherTypes
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
{
DelegatingFilterProxyRegistrationBean
bean
=
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
);
@SuppressWarnings
(
"unchecked"
)
EnumSet
<
DispatcherType
>
dispatcherTypes
=
(
EnumSet
<
DispatcherType
>)
ReflectionTestUtils
.
getField
(
bean
,
"dispatcherTypes"
);
assertThat
(
dispatcherTypes
).
containsOnly
(
DispatcherType
.
ASYNC
,
DispatcherType
.
ERROR
,
DispatcherType
.
REQUEST
);
});
}
@Test
public
void
customFilterDispatcherTypes
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.security.filter.dispatcher-types:INCLUDE,ERROR"
)
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
))
.
run
((
context
)
->
{
DelegatingFilterProxyRegistrationBean
bean
=
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
);
@SuppressWarnings
(
"unchecked"
)
EnumSet
<
DispatcherType
>
dispatcherTypes
=
(
EnumSet
<
DispatcherType
>)
ReflectionTestUtils
.
getField
(
bean
,
"dispatcherTypes"
);
assertThat
(
dispatcherTypes
).
containsOnly
(
DispatcherType
.
INCLUDE
,
DispatcherType
.
ERROR
);
});
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java
View file @
474da80b
...
@@ -28,8 +28,7 @@ import org.junit.Test;
...
@@ -28,8 +28,7 @@ import org.junit.Test;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
;
import
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
;
import
org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter
;
import
org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor
;
...
@@ -90,7 +89,7 @@ public class FilterOrderingIntegrationTests {
...
@@ -90,7 +89,7 @@ public class FilterOrderingIntegrationTests {
this
.
context
.
register
(
MockWebServerConfiguration
.
class
,
this
.
context
.
register
(
MockWebServerConfiguration
.
class
,
TestSessionConfiguration
.
class
,
TestRedisConfiguration
.
class
,
TestSessionConfiguration
.
class
,
TestRedisConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
SecurityAutoConfiguration
.
class
,
Se
rvletWebSecurityAutoConfiguration
.
class
,
Se
ssionAutoConfiguration
.
class
,
SessionAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
,
HttpEncodingAutoConfiguration
.
class
);
HttpEncodingAutoConfiguration
.
class
);
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java
View file @
474da80b
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
package
org
.
springframework
.
boot
.
docs
.
web
.
security
;
package
org
.
springframework
.
boot
.
docs
.
web
.
security
;
import
org.springframework.boot.autoconfigure.security.
web.
reactive.PathRequest
;
import
org.springframework.boot.autoconfigure.security.reactive.PathRequest
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.security.config.web.server.ServerHttpSecurity
;
import
org.springframework.security.config.web.server.ServerHttpSecurity
;
import
org.springframework.security.web.server.SecurityWebFilterChain
;
import
org.springframework.security.web.server.SecurityWebFilterChain
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcSecurityAutoConfiguration.java
View file @
474da80b
...
@@ -17,9 +17,8 @@
...
@@ -17,9 +17,8 @@
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
web
.
servlet
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
...
@@ -31,8 +30,8 @@ import org.springframework.context.annotation.Import;
...
@@ -31,8 +30,8 @@ import org.springframework.context.annotation.Import;
*/
*/
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"spring.test.mockmvc"
,
name
=
"secure"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
prefix
=
"spring.test.mockmvc"
,
name
=
"secure"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@Import
({
SecurityAutoConfiguration
.
class
,
ServletWebSecurity
AutoConfiguration
.
class
,
@Import
({
SecurityAutoConfiguration
.
class
,
UserDetailsService
AutoConfiguration
.
class
,
UserDetailsServiceAutoConfiguration
.
class
,
MockMvcSecurityConfiguration
.
class
})
MockMvcSecurityConfiguration
.
class
})
public
class
MockMvcSecurityAutoConfiguration
{
public
class
MockMvcSecurityAutoConfiguration
{
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
474da80b
...
@@ -88,8 +88,8 @@ org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
...
@@ -88,8 +88,8 @@ org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
# AutoConfigureWebClient auto-configuration imports
# AutoConfigureWebClient auto-configuration imports
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient=\
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient=\
org.springframework.boot.autoconfigure.security.
ReactiveUserDetailsService
AutoConfiguration,\
org.springframework.boot.autoconfigure.security.
reactive.ReactiveSecurity
AutoConfiguration,\
org.springframework.boot.autoconfigure.security.
web.reactive.ReactiveWebSecurity
AutoConfiguration,\
org.springframework.boot.autoconfigure.security.
reactive.ReactiveUserDetailsService
AutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration
# AutoConfigureWebFlux auto-configuration imports
# AutoConfigureWebFlux auto-configuration imports
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestApplication.java
View file @
474da80b
...
@@ -17,16 +17,14 @@
...
@@ -17,16 +17,14 @@
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
restdocs
;
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
restdocs
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.web.servlet.ServletWebSecurityAutoConfiguration
;
/**
/**
* Test application used with {@link AutoConfigureRestDocs} tests.
* Test application used with {@link AutoConfigureRestDocs} tests.
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@SpringBootApplication
(
exclude
=
{
SecurityAutoConfiguration
.
class
,
@SpringBootApplication
(
exclude
=
SecurityAutoConfiguration
.
class
)
ServletWebSecurityAutoConfiguration
.
class
})
public
class
RestDocsTestApplication
{
public
class
RestDocsTestApplication
{
}
}
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/main/java/sample/actuator/customsecurity/SecurityConfiguration.java
View file @
474da80b
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
package
sample
.
actuator
.
customsecurity
;
package
sample
.
actuator
.
customsecurity
;
import
org.springframework.boot.actuate.autoconfigure.security.
web.
servlet.EndpointRequest
;
import
org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest
;
import
org.springframework.boot.actuate.web.mappings.MappingsEndpoint
;
import
org.springframework.boot.actuate.web.mappings.MappingsEndpoint
;
import
org.springframework.boot.autoconfigure.security.
web.
servlet.PathRequest
;
import
org.springframework.boot.autoconfigure.security.servlet.PathRequest
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
...
...
spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java
View file @
474da80b
...
@@ -22,9 +22,9 @@ import org.junit.Test;
...
@@ -22,9 +22,9 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.actuate.autoconfigure.security.
web.
reactive.EndpointRequest
;
import
org.springframework.boot.actuate.autoconfigure.security.reactive.EndpointRequest
;
import
org.springframework.boot.actuate.web.mappings.MappingsEndpoint
;
import
org.springframework.boot.actuate.web.mappings.MappingsEndpoint
;
import
org.springframework.boot.autoconfigure.security.
web.
reactive.PathRequest
;
import
org.springframework.boot.autoconfigure.security.reactive.PathRequest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java
View file @
474da80b
...
@@ -19,7 +19,7 @@ package sample.security.method;
...
@@ -19,7 +19,7 @@ package sample.security.method;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.boot.actuate.autoconfigure.security.
web.
servlet.EndpointRequest
;
import
org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
...
spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java
View file @
474da80b
...
@@ -20,7 +20,7 @@ import java.util.Date;
...
@@ -20,7 +20,7 @@ import java.util.Date;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.security.
web.
servlet.PathRequest
;
import
org.springframework.boot.autoconfigure.security.servlet.PathRequest
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment