Skip to content

Commit

Permalink
Remove open endpoint /actuator/health (#426)
Browse files Browse the repository at this point in the history
By default, CAP Java provides the open endpoints
`actuator/health/liveness` and `actuator/health/readiness`. Both can be
used by Cf or K8s for application health checks.
There is no need for a public `actuator/health` anymore.

See also in mta.yaml:
https://github.com/SAP-samples/cloud-cap-samples-java/blob/228e05f940b4d22acc7d88c862fcb6e8c085ff40/mta-multi-tenant.yaml#L18
  • Loading branch information
mofterdinger authored Jan 9, 2025
1 parent 228e05f commit 1cc0602
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class WebSecurityConfig {

@Bean
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
return http.securityMatchers(s -> s.requestMatchers(antMatcher("/actuator/health"), antMatcher("/swagger/**"))) //
return http.securityMatchers(s -> s.requestMatchers(antMatcher("/swagger/**"))) //
.csrf(c -> c.disable()).authorizeHttpRequests(a -> a.anyRequest().permitAll())
.build();
}
Expand Down

0 comments on commit 1cc0602

Please sign in to comment.