Skip to content

Commit 0ba9656

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: fix indentation
1 parent a8bb798 commit 0ba9656

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
@Configuration(proxyBeanMethods = false)
22
public class CustomSecurityConfiguration {
33

4-
@Bean
5-
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
6-
// BAD: Unauthenticated access to Spring Boot actuator endpoints is allowed
7-
http.securityMatcher(EndpointRequest.toAnyEndpoint());
8-
http.authorizeHttpRequests((requests) -> requests.anyRequest().permitAll());
9-
return http.build();
10-
}
4+
@Bean
5+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
6+
// BAD: Unauthenticated access to Spring Boot actuator endpoints is allowed
7+
http.securityMatcher(EndpointRequest.toAnyEndpoint());
8+
http.authorizeHttpRequests((requests) -> requests.anyRequest().permitAll());
9+
return http.build();
10+
}
1111

1212
}
1313

1414
@Configuration(proxyBeanMethods = false)
1515
public class CustomSecurityConfiguration {
1616

17-
@Bean
18-
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
19-
// GOOD: only users with ENDPOINT_ADMIN role are allowed to access the actuator endpoints
20-
http.securityMatcher(EndpointRequest.toAnyEndpoint());
21-
http.authorizeHttpRequests((requests) -> requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
22-
return http.build();
23-
}
17+
@Bean
18+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
19+
// GOOD: only users with ENDPOINT_ADMIN role are allowed to access the actuator endpoints
20+
http.securityMatcher(EndpointRequest.toAnyEndpoint());
21+
http.authorizeHttpRequests((requests) -> requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
22+
return http.build();
23+
}
2424

2525
}

0 commit comments

Comments
 (0)