Skip to content

Commit d92bbdc

Browse files
Brutus5000claude
andcommitted
Permit unauthenticated access to health/info/prometheus actuator endpoints
Spring Boot 4 applies the application's SecurityFilterChain to the management port, so the existing anyRequest().authenticated() rule caused /actuator/health to return 401 and broke prod healthchecks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d28d5db commit d92bbdc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/com/faforever/api/config/security/WebSecurityConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.faforever.api.config.security;
22

33
import com.faforever.api.security.FafAuthenticationConverter;
4+
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
45
import org.springframework.context.annotation.Bean;
56
import org.springframework.context.annotation.Configuration;
67
import org.springframework.http.HttpMethod;
@@ -37,6 +38,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
3738
});
3839
http.authorizeHttpRequests(authorizeConfig -> {
3940
authorizeConfig.requestMatchers(HttpMethod.OPTIONS).permitAll();
41+
authorizeConfig.requestMatchers(EndpointRequest.to("health", "info", "prometheus")).permitAll();
4042
// Swagger UI
4143
authorizeConfig.requestMatchers(
4244
"/swagger-ui/**",

0 commit comments

Comments
 (0)