package company.specialsource.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.web.SecurityFilterChain; @Configuration @EnableWebSecurity public class WebMvcConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http // 1. 🟒 μ™ΈλΆ€ 맀크둜의 POST μš”μ²­μ΄ 톡과할 수 μžˆλ„λ‘ CSRF 보호 λŒ€μƒμ—μ„œ μ—…λ‘œλ“œ APIλ₯Ό μ œμ™Έν•©λ‹ˆλ‹€. .csrf(csrf -> csrf .ignoringRequestMatchers("/api/sync/upload") ) // 2. 🟒 λ‘œκ·ΈμΈμ΄λ‚˜ λ³„λ„μ˜ 인증 토큰 없이도 μ ‘κ·Όν•  수 μžˆλ„λ‘ ν—ˆμš©ν•©λ‹ˆλ‹€. .authorizeHttpRequests(auth -> auth .requestMatchers("/api/sync/upload").permitAll() .anyRequest().authenticated() ); return http.build(); } }