Skip to content

Commit

Permalink
[HOTFIX] swagger 설정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
EunbeenDev committed Sep 27, 2024
1 parent 7ca446a commit 2ed0ad4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
Expand All @@ -24,12 +25,12 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.csrf(csrfConfig -> csrfConfig.disable())
.csrf(AbstractHttpConfigurer::disable)
.headers(headerConfig -> headerConfig.frameOptions(frameOptionsConfig -> frameOptionsConfig.disable()))
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
// Swagger 경로 허용
.requestMatchers(URL_TO_PERMIT).permitAll()
.requestMatchers("/swagger/**", "/swagger-ui/**", "/v3/api-docs/**").permitAll() // Swagger 경로 추가
.requestMatchers("/swagger", "/swagger-ui.html", "/swagger-ui/**", "/api-docs", "/api-docs/**", "/v3/api-docs/**").permitAll() // Swagger 경로 추가
.anyRequest().authenticated()
)
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
Expand Down

0 comments on commit 2ed0ad4

Please sign in to comment.