-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 인증 중앙화로 인한 베이스 코드 변경사항 (#556) #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
geniusYoo
wants to merge
16
commits into
auth-integration
Choose a base branch
from
feat/#556
base: auth-integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
공개키 조회를 위한 헤더 세팅
jwt 인증 관련 커스텀 Authentication 객체와 이를 핸들링하는 서비스 클래스
data 부분만을 파싱해서 가져와야 하므로 wrapper 클래스도 추가
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue 🛠
Work Description ✏️
인증 중앙화로 인해 변경되는 코드들, 노가다 작업 전 베이스 코드를 회의에서 같이 작업했어요.
initial setting
1. 가이드라인 프로젝트 코드 추가
기존 플랫폼 팀에서 제공해주신 가이드라인 코드를 추가했어요.
한 가지 수정 사항이 있다면, jwt를 파싱할 때
Bearer
를 substring 하지않고 그대로 사용하도록 변경했어요. (앱팀 클라이언트와 협의 완료)2. 에러 코드 및 커스텀 예외 추가
커스텀 예외로는
ClientException
,JwkException
,JwtException
에러 코드는 아래와 같이 추가했어요.
3. 응답 dto 추가
플랫폼 internal API로 받아오는 유저 정보 응답 dto와 wrapper를 추가했어요.
wrapper에는 같이 응답으로 오는 status, message를 무시하기 위해
@JsonIgnoreProperties
를 사용했어요.4. internal API 엔드포인트
internal API 요청을 위한 FeignClient 엔드포인트를 작성했어요.
플랫폼 팀의 유저 정보 조회 API 명세에 따라, 동적 쿼리 파라미터로 유저 아이디를 추가해 요청할 수 있도록
@QueryMap
을 사용했어요.key changes
1. api changes
@AuthenticationPrincipal
로userId
를 파싱하도록 했어요.userId
만을SecurityContextHolder
에 저장하기 때문에, 이름을 얻기 위해 Internal API를 사용하는 코드를 추가해 이름을 받아왔어요.2. internal API Service
createQueryParams
로 동적으로 파라미터를 생성해 요청하도록 했어요.getFirst
로 첫번째 것을 가져오도록 했어요.x-api-key
와x-service-name
을 시크릿에서 주입받아 헤더로 세팅하도록 했어요.Trouble Shooting ⚽️
Related ScreenShot 📷
Uncompleted Tasks 😅
To Reviewers 📢