diff --git a/src/main/java/com/earseo/gateway/common/config/WebSecurityConfig.java b/src/main/java/com/earseo/gateway/common/config/WebSecurityConfig.java index cb8292e..f2a8639 100644 --- a/src/main/java/com/earseo/gateway/common/config/WebSecurityConfig.java +++ b/src/main/java/com/earseo/gateway/common/config/WebSecurityConfig.java @@ -41,6 +41,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti .requestMatchers("/api/user/**").hasAnyAuthority("USER", "ADMIN") .requestMatchers("/api/admin/**").hasAuthority("ADMIN") .requestMatchers("/api/**").permitAll() + .requestMatchers("/actuator/**").permitAll() .anyRequest().authenticated()) .exceptionHandling(exceptionHandler -> exceptionHandler .authenticationEntryPoint(customAuthenticationEntryPoint) diff --git a/src/main/java/com/earseo/gateway/common/exception/GlobalExceptionHandler.java b/src/main/java/com/earseo/gateway/common/exception/GlobalExceptionHandler.java index 37e9a0e..95a7e1e 100644 --- a/src/main/java/com/earseo/gateway/common/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/earseo/gateway/common/exception/GlobalExceptionHandler.java @@ -48,7 +48,7 @@ public ResponseEntity> handleValidationException(MethodArgu @ExceptionHandler(AuthenticationException.class) public ResponseEntity> handleAuthenticationException(AuthenticationException e) { - log.warn("리소스 없음: ", e); + log.warn("UNAUTHORIZED: ", e); return ResponseEntity .status(HttpStatus.UNAUTHORIZED) .body(BaseResponse.onFailure("UNAUTHORIZED", "401", null)); @@ -56,7 +56,7 @@ public ResponseEntity> handleAuthenticationException(Authen @ExceptionHandler(AccessDeniedException.class) public ResponseEntity> handleAccessDeniedException(AccessDeniedException e) { - log.warn("리소스 없음: ", e); + log.warn("FORBIDDEN: ", e); return ResponseEntity .status(HttpStatus.FORBIDDEN) .body(BaseResponse.onFailure("FORBIDDEN", "403", null));