-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 모임 삭제 기능 구현 (#102) * refactor: 기획 변경에 따른 회원 카드 등록 API 리팩토링 (#105) * refactor: sql 변경 (#104) * refactor: User 클래스 필드명 변경 (#104) * refactor: API 변경에 따른 코드 리팩토링 (#104) * refactor: 불필요한 getId() 제거 ( 피드백 반영 ) (#104) * feat: 유효성 검증 관련 에러 일괄 처리을 위한 메소드 추가 (#104) * test: API 변경에 따른 통합 테스트 수정 및 단위 테스트 구현 (#104) * refactor: UserMeGetResponse 필드 변경 (#104) * fix: CI 에러 수정 (#104) * refactor: 피드백 반영 (#104) * fix: CI 에러 수정 (#104) * refactor: JWT 에러 응답 리팩토링 및 인가 인증 예최 처리 코드 수정 (#103) * refactor: 기타 코드 리팩토링( 피드백 반영 ) (#101) * chore: JWT 관련 의존성 변경 (#101) * refactor: JWT 및 인증 관련 로직 리팩토링 (#101) * test: 테스트 코드 및 설정 관련 변경(#101) * refactor: ObjectMapper Autowired 로 주입 (#101) * refactor: AuthService 반환 타입 Optional<User> -> User 변경 (#101) * fix: V6_create_users_interests.sql 추가 (#109) (#110) * refactor: 회원 카드 등록시 JWT 정보도 함께 반환하도록 수정 (#114) * chore : application.properties 에 jwt 관련 설정 값 추가 (#113) * refactor : userService 회원 카드 등록 로직 수정 (#113) * feat : UserRegisterResponse 필드 추가(#113) * test: API 변경에 따른 테스트 관련 코드 수정 (#113) * fix: 소셜 로그인 관련 500 에러 수정 및 OAuth 로직 일부 개선 (#112) * fix: OAuthLoginController @RestController 어노테이션 추가(나는 바보..) 및 favicon 관련 임시 컨트롤러 생성 (#111) * refactor : 설정 yml 리팩토링 (#111) * refactor : SecurityConfig 리팩토링 (#111) * refactor : 기타 OAuth 관련 로직 리팩토링(#111) * refactor : Cors 허용 주소 임시 전부 허용 (#111) * fix : SonarCloud 오류 수정 (#111) * fix : SonarCloud 오류 수정 (#111) * feat: 위치 기반 API 구현 및 테스트 (#108) * refactor: 기타 코드 리팩토링( 피드백 반영 ) (#101) * chore: JWT 관련 의존성 변경 (#101) * refactor: JWT 및 인증 관련 로직 리팩토링 (#101) * test: 테스트 코드 및 설정 관련 변경(#101) * refactor: ObjectMapper Autowired 로 주입 (#101) * refactor: AuthService 반환 타입 Optional<User> -> User 변경 (#101) * refactor: application.properties redis.port 변경 (#91) * refactor: 기존 Redis 설정 리팩토링 및 추가 구현 (#91) * feat: 유저 위치 기반 관련 DTO 및 VO 구현 (#91) * feat: 유저 위치 기반 API 구현 (#91) * test: 유저 위치 기반 통합 테스트 관련 클래스 구현 및 테스트 (#91) * test: redis port 변경에 따른 테스트 수정 (#91) * fix: CI 에러 수정 (#91) * fix: sonarCloud 에러 수정 (#91) * refactor: 리뷰 반영 (#108) --------- Co-authored-by: ddingmin <[email protected]>
- Loading branch information
1 parent
b370f46
commit 6d9d376
Showing
56 changed files
with
1,355 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 19 additions & 10 deletions
29
src/main/java/net/teumteum/core/security/filter/JwtAccessDeniedHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
package net.teumteum.core.security.filter; | ||
|
||
import jakarta.servlet.ServletException; | ||
import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import net.teumteum.core.error.ErrorResponse; | ||
import org.springframework.security.access.AccessDeniedException; | ||
import org.springframework.security.web.access.AccessDeniedHandler; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.io.IOException; | ||
|
||
import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; | ||
|
||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class JwtAccessDeniedHandler implements AccessDeniedHandler { | ||
|
||
private final ObjectMapper objectMapper; | ||
|
||
@Override | ||
public void handle(HttpServletRequest request, | ||
HttpServletResponse response, | ||
AccessDeniedException accessDeniedException | ||
) throws IOException, ServletException { | ||
HttpServletResponse response, | ||
AccessDeniedException accessDeniedException | ||
) throws IOException { | ||
this.sendUnAuthorizedError(response, accessDeniedException); | ||
} | ||
|
||
private void sendUnAuthorizedError(HttpServletResponse response, | ||
Exception exception) throws IOException { | ||
Exception exception) throws IOException { | ||
response.setStatus(SC_FORBIDDEN); | ||
OutputStream os = response.getOutputStream(); | ||
log.error("Responding with unauthorized error. Message - {}", exception.getMessage()); | ||
response.sendError(SC_FORBIDDEN, exception.getMessage()); | ||
objectMapper.writeValue(os, ErrorResponse.of("인가 과정에서 오류가 발생했습니다.")); | ||
os.flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.