[Developer] #617 apply DDS MCP end-user authorization
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cloudhandson.ddsbackoffice.config;
|
||||
|
||||
import com.cloudhandson.vpdbackoffice.config.BackofficeProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
@@ -23,11 +24,13 @@ public class SecurityConfig {
|
||||
}
|
||||
|
||||
return http
|
||||
.csrf(csrf -> csrf.ignoringRequestMatchers("/dds/mcp/messages"))
|
||||
.headers(headers -> headers.httpStrictTransportSecurity(hsts -> hsts
|
||||
.includeSubDomains(true)
|
||||
.maxAgeInSeconds(31_536_000)))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers("/css/**", "/js/**", "/health", "/login").permitAll()
|
||||
.requestMatchers("/css/**", "/js/**", "/health", "/login",
|
||||
"/dds/mcp/sse", "/dds/mcp/messages").permitAll()
|
||||
.anyRequest().authenticated())
|
||||
.httpBasic(basic -> {
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user