Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,21 @@ class HttpSecurityConfiguration {
@Bean
@ConditionalOnProperty(name = "http.security.enabled", havingValue = "true", matchIfMissing = true)
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http
// ⬇️ Open every request on the server
.authorizeHttpRequests(auth -> {
auth.requestMatchers("/actuator").permitAll();
auth.requestMatchers("/actuator/*").permitAll();
auth.requestMatchers("/mcp").permitAll();
auth.anyRequest().authenticated();
})
return http.authorizeHttpRequests(auth -> {
// Liveness/readiness probes need anonymous access for load
// balancers and orchestrators. All other actuator endpoints
// (loggers, sbom, metrics, prometheus, info) require auth so
// that an unauthenticated caller cannot read the dependency
// tree, scrape metrics that map the tool surface, or — if
// path-matcher semantics ever shift — change log levels.
auth.requestMatchers("/actuator/health").permitAll();
auth.requestMatchers("/actuator", "/actuator/**").authenticated();
// /mcp is gated by @PreAuthorize on individual @McpTool
// methods, matching the spring-ai-community/mcp-security
// "secured tools" sample pattern.
auth.requestMatchers("/mcp").permitAll();
auth.anyRequest().authenticated();
})
// Configure OAuth2 on the MCP server.
//
// resourcePath: declares "/mcp" as the canonical resource indicator
Expand Down
Loading