Skip to content

Commit 5e3f618

Browse files
izeyesnicoll
authored andcommitted
Polish
See gh-24604
1 parent e3d7ab0 commit 5e3f618

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,10 +2439,10 @@ To configure Spring Security to require a secure channel for all (or some) reque
24392439
[source,java,indent=0,subs="verbatim,quotes,attributes"]
24402440
----
24412441
@Bean
2442-
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
2443-
// Customize the application security
2442+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
2443+
// Customize the application security
24442444
http.requiresChannel().anyRequest().requiresSecure();
2445-
return http.build();
2445+
return http.build();
24462446
}
24472447
----
24482448

spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ A typical Spring Security configuration might look something like the following
359359

360360
[source,java,indent=0]
361361
----
362-
@Bean
363-
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
364-
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
365-
requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
366-
http.httpBasic();
367-
return http.build();
362+
@Bean
363+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
364+
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
365+
requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
366+
http.httpBasic();
367+
return http.build();
368368
}
369369
----
370370

@@ -388,12 +388,12 @@ Additionally, if Spring Security is present, you would need to add custom securi
388388

389389
[source,java,indent=0]
390390
----
391-
@Bean
392-
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
393-
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
391+
@Bean
392+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
393+
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
394394
requests.anyRequest().permitAll());
395-
return http.build();
396-
}
395+
return http.build();
396+
}
397397
----
398398

399399
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void isAcceptedWhenNoActiveAndDefaultWithGroupsContainsProfileReturnsTrue() {
360360
}
361361

362362
@Test
363-
void simpleRecursiveReferenceInProfileGroupThrowsException() {
363+
void simpleRecursiveReferenceInProfileGroupIgnoresDuplicates() {
364364
MockEnvironment environment = new MockEnvironment();
365365
environment.setProperty("spring.profiles.active", "a,b,c");
366366
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ void endpointShouldReturnUnauthorized() {
6666

6767
@Test
6868
void preflightRequestToEndpointShouldReturnOk() throws Exception {
69-
RequestEntity<?> healthRequest = RequestEntity.options(new URI("/actuator/env"))
69+
RequestEntity<?> envRequest = RequestEntity.options(new URI("/actuator/env"))
7070
.header("Origin", "http://localhost:8080").header("Access-Control-Request-Method", "GET").build();
71-
ResponseEntity<?> exchange = this.testRestTemplate.exchange(healthRequest, Map.class);
71+
ResponseEntity<?> exchange = this.testRestTemplate.exchange(envRequest, Map.class);
7272
assertThat(exchange.getStatusCode()).isEqualTo(HttpStatus.OK);
7373
}
7474

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/test/java/smoketest/actuator/CorsSampleActuatorApplicationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ void endpointShouldReturnUnauthorized() {
6666

6767
@Test
6868
void preflightRequestToEndpointShouldReturnOk() throws Exception {
69-
RequestEntity<?> healthRequest = RequestEntity.options(new URI("/actuator/env"))
69+
RequestEntity<?> envRequest = RequestEntity.options(new URI("/actuator/env"))
7070
.header("Origin", "http://localhost:8080").header("Access-Control-Request-Method", "GET").build();
71-
ResponseEntity<?> exchange = this.testRestTemplate.exchange(healthRequest, Map.class);
71+
ResponseEntity<?> exchange = this.testRestTemplate.exchange(envRequest, Map.class);
7272
assertThat(exchange.getStatusCode()).isEqualTo(HttpStatus.OK);
7373
}
7474

0 commit comments

Comments
 (0)