@@ -37,22 +37,49 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3737 // 인가 규칙 설정
3838 .authorizeHttpRequests (
3939 auth -> auth
40- .requestMatchers (HttpMethod .OPTIONS , "/**" ).permitAll () // CORS Preflight 요청 허용
41- .requestMatchers ("/api/auth/**" , "/oauth2/**" , "/login/oauth2/**" ).permitAll ()
42- .requestMatchers ("api/ws/**" , "/ws/**" ).permitAll ()
40+ // CORS Preflight
41+ .requestMatchers (HttpMethod .OPTIONS , "/**" ).permitAll ()
42+
43+ // 개발 및 모니터링용
44+ .requestMatchers (
45+ "/" ,
46+ "/swagger-ui/**" ,
47+ "/v3/api-docs/**"
48+ ).permitAll () // Swagger
49+ .requestMatchers ("/h2-console/**" ).permitAll () // H2 콘솔
50+ .requestMatchers ("/actuator/health" ).permitAll () // Health check
51+
52+ // 인증/인가
53+ .requestMatchers (
54+ "/api/auth/**" ,
55+ "/oauth2/**" ,
56+ "/login/oauth2/**"
57+ ).permitAll ()
58+
59+ // WebSocket
60+ .requestMatchers (
61+ "api/ws/**" ,
62+ "/ws/**"
63+ ).permitAll ()
64+
65+ // 스터디룸 관련
66+ .requestMatchers ("/api/rooms/*/messages/**" ).permitAll () // 방 내 채팅 메시지
67+ .requestMatchers (HttpMethod .GET ,
68+ "/api/rooms" , // 전체 목록 조회
69+ "/api/rooms/all" , // 전체 방 목록
70+ "/api/rooms/public" , // 공개 방 목록
71+ "/api/rooms/popular" , // 인기 방 목록
72+ "/api/rooms/*" // 방 상세 조회
73+ ).permitAll ()
74+ //.requestMatchers("/api/rooms/RoomChatApiControllerTest").permitAll() // 테스트용
75+
76+ // 커뮤니티 관련
4377 .requestMatchers (HttpMethod .GET , "/api/posts/**" ).permitAll ()
44- .requestMatchers ("/api/rooms/*/messages/**" ).permitAll () //스터디 룸 내에 잡혀있어 있는 채팅 관련 전체 허용
45- // 방 목록 조회 API 비로그인 허용
46- .requestMatchers (HttpMethod .GET , "/api/rooms" ).permitAll ()
47- .requestMatchers (HttpMethod .GET , "/api/rooms/all" ).permitAll ()
48- .requestMatchers (HttpMethod .GET , "/api/rooms/public" ).permitAll ()
49- .requestMatchers (HttpMethod .GET , "/api/rooms/popular" ).permitAll ()
50- .requestMatchers (HttpMethod .GET , "/api/rooms/*" ).permitAll () // 방 상세 조회
51- //.requestMatchers("/api/rooms/RoomChatApiControllerTest").permitAll() // 테스트용 임시 허용
52- .requestMatchers ("/" ,"/swagger-ui/**" , "/v3/api-docs/**" ).permitAll () // Swagger 허용
53- .requestMatchers ("/h2-console/**" ).permitAll () // H2 Console 허용
54- .requestMatchers ("/actuator/health" ).permitAll () // 헬스 체크 허용
55- .requestMatchers ("/file/**" ).permitAll () // 파일 관련 요청 모두 허용(테스트 완료 후, 요청제한 예정)
78+
79+ // 파일 관련 (테스트용, 추후 요청 제한 예정)
80+ .requestMatchers ("/file/**" ).permitAll ()
81+
82+ // 그 외 모든 요청은 인증 필요
5683 .anyRequest ().authenticated ()
5784 )
5885
0 commit comments