Skip to content

Commit dc68188

Browse files
authored
Merge pull request #25 from DMU-DebugVisual/fix/security_api
fix: post & comment GET 허용(게시글 및 댓글 조회 API 인증 예외 처리)
2 parents 5a43998 + 513580a commit dc68188

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/dmu/debug_visual/config/SecurityConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public SecurityFilterChain jwtFilterChain(HttpSecurity http) throws Exception {
4545
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
4646
.csrf(AbstractHttpConfigurer::disable)
4747
.authorizeHttpRequests(auth -> auth
48+
.requestMatchers(HttpMethod.GET, "/api/posts/**", "/api/comments/**").permitAll()
4849
.requestMatchers("/api/admin/**").hasRole("ADMIN")
4950
.requestMatchers("/api/posts/**").hasAnyRole("USER", "ADMIN")
5051
.requestMatchers("/api/notifications/**").hasAnyRole("USER", "ADMIN")
@@ -78,6 +79,7 @@ public SecurityFilterChain publicFilterChain(HttpSecurity http) throws Exception
7879
"/v3/api-docs/**",
7980
"/api/code/**"
8081
).permitAll()
82+
.requestMatchers(HttpMethod.GET, "/api/posts/**", "/api/comments/**").permitAll()
8183
.anyRequest().permitAll()
8284
);
8385

0 commit comments

Comments
 (0)