File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/main/java/back/kalender/global/security Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1313
1414/**
1515 * Spring Security 설정
16- * 개발 단계에서 모든 경로 허용 (추후 인증/인가 추가 예정)
1716 */
1817@ Configuration
1918@ EnableWebSecurity
@@ -32,10 +31,28 @@ public JwtAuthFilter jwtAuthFilter(JwtTokenProvider jwtTokenProvider) {
3231 @ Bean
3332 public SecurityFilterChain securityFilterChain (HttpSecurity http , JwtAuthFilter jwtAuthFilter ) throws Exception {
3433 http
35- .csrf (csrf -> csrf .disable ()) // CSRF 비활성화
34+ .csrf (csrf -> csrf .disable ())
3635 .addFilterBefore (jwtAuthFilter , UsernamePasswordAuthenticationFilter .class )
3736 .authorizeHttpRequests (auth -> auth
38- .anyRequest ().permitAll () // 모든 요청 허용 (개발용)
37+ // 공개 엔드포인트 (인증 불필요)
38+ .requestMatchers (
39+ "/api/v1/auth/login" ,
40+ "/api/v1/auth/refresh" ,
41+ "/api/v1/auth/password/send" ,
42+ "/api/v1/auth/password/reset" ,
43+ "/api/v1/auth/email/send" ,
44+ "/api/v1/auth/email/verify" ,
45+ "/api/v1/user" ,
46+ "/api/v1/schedule/public/**" ,
47+ "/api/v1/artist/**" ,
48+ "/h2-console/**" ,
49+ "/favicon.ico" ,
50+ "/swagger-ui/**" ,
51+ "/v3/api-docs/**" ,
52+ "/swagger-resources/**"
53+ ).permitAll ()
54+ // 그 외 모든 요청은 인증 필요
55+ .anyRequest ().authenticated ()
3956 );
4057
4158 return http .build ();
You can’t perform that action at this time.
0 commit comments