Skip to content

Commit 54e5936

Browse files
committed
refactor(auth) : securityConfig 정리
1 parent d0fb52c commit 54e5936

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/main/java/back/kalender/global/security/SecurityConfig.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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();

0 commit comments

Comments
 (0)