File tree Expand file tree Collapse file tree
src/main/java/com/semosan/api/common/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .semosan .api .common .config ;
2+
3+ import org .springframework .boot .actuate .autoconfigure .security .servlet .EndpointRequest ;
4+ import org .springframework .context .annotation .Bean ;
5+ import org .springframework .context .annotation .Configuration ;
6+ import org .springframework .core .annotation .Order ;
7+ import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
8+ import org .springframework .security .config .annotation .web .configurers .AbstractHttpConfigurer ;
9+ import org .springframework .security .web .SecurityFilterChain ;
10+
11+ @ Configuration
12+ public class ManagementSecurityConfig {
13+
14+ @ Bean
15+ @ Order (0 )
16+ public SecurityFilterChain managementSecurityFilterChain (HttpSecurity http ) throws Exception {
17+ http
18+ .securityMatcher (EndpointRequest .toAnyEndpoint ())
19+ .authorizeHttpRequests (auth -> auth .anyRequest ().permitAll ())
20+ .csrf (AbstractHttpConfigurer ::disable );
21+ return http .build ();
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments