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
ccdf5a93
Commit
ccdf5a93
authored
Dec 23, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24604 from izeye
* pr/24604: Polish Closes gh-24604
parents
e3d7ab0e
5e3f618f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
howto.adoc
...oot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
+3
-3
production-ready-features.adoc
...oot-docs/src/docs/asciidoc/production-ready-features.adoc
+11
-11
ProfilesTests.java
...rg/springframework/boot/context/config/ProfilesTests.java
+1
-1
CorsSampleActuatorApplicationTests.java
...or/customsecurity/CorsSampleActuatorApplicationTests.java
+2
-2
CorsSampleActuatorApplicationTests.java
...moketest/actuator/CorsSampleActuatorApplicationTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
View file @
ccdf5a93
...
@@ -2439,10 +2439,10 @@ To configure Spring Security to require a secure channel for all (or some) reque
...
@@ -2439,10 +2439,10 @@ To configure Spring Security to require a secure channel for all (or some) reque
[source,java,indent=0,subs="verbatim,quotes,attributes"]
[source,java,indent=0,subs="verbatim,quotes,attributes"]
----
----
@Bean
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
// Customize the application security
// Customize the application security
http.requiresChannel().anyRequest().requiresSecure();
http.requiresChannel().anyRequest().requiresSecure();
return http.build();
return http.build();
}
}
----
----
...
...
spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc
View file @
ccdf5a93
...
@@ -359,12 +359,12 @@ A typical Spring Security configuration might look something like the following
...
@@ -359,12 +359,12 @@ A typical Spring Security configuration might look something like the following
[source,java,indent=0]
[source,java,indent=0]
----
----
@Bean
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
http.httpBasic();
http.httpBasic();
return http.build();
return http.build();
}
}
----
----
...
@@ -388,12 +388,12 @@ Additionally, if Spring Security is present, you would need to add custom securi
...
@@ -388,12 +388,12 @@ Additionally, if Spring Security is present, you would need to add custom securi
[source,java,indent=0]
[source,java,indent=0]
----
----
@Bean
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
requests.anyRequest().permitAll());
requests.anyRequest().permitAll());
return http.build();
return http.build();
}
}
----
----
NOTE: In both the examples above, the configuration applies only to the actuator endpoints.
NOTE: In both the examples above, the configuration applies only to the actuator endpoints.
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ProfilesTests.java
View file @
ccdf5a93
...
@@ -360,7 +360,7 @@ class ProfilesTests {
...
@@ -360,7 +360,7 @@ class ProfilesTests {
}
}
@Test
@Test
void
simpleRecursiveReferenceInProfileGroup
ThrowsException
()
{
void
simpleRecursiveReferenceInProfileGroup
IgnoresDuplicates
()
{
MockEnvironment
environment
=
new
MockEnvironment
();
MockEnvironment
environment
=
new
MockEnvironment
();
environment
.
setProperty
(
"spring.profiles.active"
,
"a,b,c"
);
environment
.
setProperty
(
"spring.profiles.active"
,
"a,b,c"
);
environment
.
setProperty
(
"spring.profiles.group.a"
,
"a,e,f"
);
environment
.
setProperty
(
"spring.profiles.group.a"
,
"a,e,f"
);
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/CorsSampleActuatorApplicationTests.java
View file @
ccdf5a93
...
@@ -66,9 +66,9 @@ class CorsSampleActuatorApplicationTests {
...
@@ -66,9 +66,9 @@ class CorsSampleActuatorApplicationTests {
@Test
@Test
void
preflightRequestToEndpointShouldReturnOk
()
throws
Exception
{
void
preflightRequestToEndpointShouldReturnOk
()
throws
Exception
{
RequestEntity
<?>
health
Request
=
RequestEntity
.
options
(
new
URI
(
"/actuator/env"
))
RequestEntity
<?>
env
Request
=
RequestEntity
.
options
(
new
URI
(
"/actuator/env"
))
.
header
(
"Origin"
,
"http://localhost:8080"
).
header
(
"Access-Control-Request-Method"
,
"GET"
).
build
();
.
header
(
"Origin"
,
"http://localhost:8080"
).
header
(
"Access-Control-Request-Method"
,
"GET"
).
build
();
ResponseEntity
<?>
exchange
=
this
.
testRestTemplate
.
exchange
(
health
Request
,
Map
.
class
);
ResponseEntity
<?>
exchange
=
this
.
testRestTemplate
.
exchange
(
env
Request
,
Map
.
class
);
assertThat
(
exchange
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
exchange
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
}
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/test/java/smoketest/actuator/CorsSampleActuatorApplicationTests.java
View file @
ccdf5a93
...
@@ -66,9 +66,9 @@ class CorsSampleActuatorApplicationTests {
...
@@ -66,9 +66,9 @@ class CorsSampleActuatorApplicationTests {
@Test
@Test
void
preflightRequestToEndpointShouldReturnOk
()
throws
Exception
{
void
preflightRequestToEndpointShouldReturnOk
()
throws
Exception
{
RequestEntity
<?>
health
Request
=
RequestEntity
.
options
(
new
URI
(
"/actuator/env"
))
RequestEntity
<?>
env
Request
=
RequestEntity
.
options
(
new
URI
(
"/actuator/env"
))
.
header
(
"Origin"
,
"http://localhost:8080"
).
header
(
"Access-Control-Request-Method"
,
"GET"
).
build
();
.
header
(
"Origin"
,
"http://localhost:8080"
).
header
(
"Access-Control-Request-Method"
,
"GET"
).
build
();
ResponseEntity
<?>
exchange
=
this
.
testRestTemplate
.
exchange
(
health
Request
,
Map
.
class
);
ResponseEntity
<?>
exchange
=
this
.
testRestTemplate
.
exchange
(
env
Request
,
Map
.
class
);
assertThat
(
exchange
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
exchange
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
}
...
...
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