forked from TaskSprints/auction
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge #4
Merged
Merged
Merge #4
Conversation
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
- auth 디렉토리를 도메인에 추가합니다. - common/jwt/dto를 auth 도메인에 포함되도록합니다.
- 이름은 변경한다 - header와 prefix는 클래스에서 지정하도록 한다.
- jwtResponse -> UserTokens 변경한다. - Data 대신 Getter을 대신해서 필요한 기능만 사용하게 한다. - NoArgsConstructor을 삭제해서, 필요한 어노테이션만 있게하도록 한다.
- 토큰 검증 과정이 겹친다. 따라서 parseToken에서 토큰을 검증하는 기능을 맡게한다. - getSubject는 파싱한 토큰에서 정보를 빼는 메서드의 역할을 부여한다.
- common/config에 포함되도록 합니다.
- 리프레시 토큰 모델을 생성합니다. - id로 refreshtoken 값을 갖습니다. - 유저의 id를 열로 갖습니다.
- 리프레시 토큰 레파지토리를 생성합니다. - refreshToken 레파지토리에 refreshToken을 저장하고, findById와 existById가 실행되는지 확인합니다.
- 사용자의 권한을 다양하게 부여하기 위해, role enum을 추가합니다.
- 사용자의 권한 부여에 대한 것을 auth 도메인에서 관리합니다.
- 사용자가 접속했을 때, 권한을 부여해 줄 모델을 생성합니다.
- 인증인가를 필요로 하는 엔드포인트를 식별하기 위한 어노테이션을 생성합니다.
- 인증인가시 발생하는 예외를 처리하기 위한 클래스를 생성합니다.
- 토큰을 추출하는 인터페이스를 생성합니다. - accessToken을 추출하는 클래스를, 인터페이스를 통해 구현합니다.
- 토큰을 추출하는 인터페이스의 매개변수를 HttpServletRequest로 변경합니다.
- 쿠키에서 토큰을 추출하고 반환합니다.
- Auth 어노테이션을 가진 파라미터 대상으로 resolver가 작동합니다 - RefreshToken 관련 오류가 발생하지 않는경우 member 권한으로 접근합니다 - 그렇지 않는 경우 guest 권한으로 접근합니다 - 컨트롤러에서 의존성 문제로 발생하는 오류를 목킹을 해결합니다
- 레파지토리에서 user를 email로 찾는다
- UserService와 UserServiceImpl에 메서드를 추가하고 테스트 코드를 작성한다 - 유저를 찾을 경우 유저의 상세 정보를 return 한다 - 유저를 찾지 못하는 경우, 예외를 반환한다
- 로그인 정보가 올바를 경우 토큰을 반환한다 - 로그인 정보가 올바르지 않을 경우 예외를 반환한다
- 로그인 정보가 올바를 경우 쿠키로 refresh token을 반환한다 - 로그인 정보가 올바를 경우 body에 access token을 반환한다 - 로그인 정보가 올바르지 않을 경우 예외를 반환한다
- AuthServiceImpl에 치중된 책임을 RefreshTokenServiceImpl을 통해 덜어낸다 - cookie 생성 로직을 여러번 사용하기 위해, service 레이어에 작성한다 - UserTokens라는 DTO가 AccessToken DTO를 가질 수 있게한다
- AuthServiceImpl의 login 메서드 하나에 존재했던 책임들을 여러 메서드로 분리한다
- refreshToken을 쿠키에서 추출하고, 쿠키 설정까지의 과정을 하나의 클래스로 묶는다 - 그로인해 변경되는 코드를 변경한다 - 후에, 토큰들을 한번에 발급하고 반환하는 과정이 중복 될 것이기 때문에, 그 부분을 issueResponseTokens 메서드로 통합하여 사용성을 높인다
- access token이 만료될 경우, 클라이언트는, 해당 api로 토큰 재발급 요청을 보낸다 - 토큰이 repository에 존재할 경우, accesstoken과 refreshtoken을 재발급한다 - refreshtoken을 검증하고, DB에서 지우는 로직을 추가로 구현할 예정이다
- 유저의 권한을 체크하는 AOP를 추가한다 - 엔드포인트에서, 해당 AOP를 통해 유저가 올바른 접근을 하고 있는지 확인한다 - 올바른 접근일 경우, controller를 실행하고 아닐 경우 예외를 던진다
- 일관성을 위해 테스트 디렉토리에 존재하는 auth 디렉토리를 삭제합니다
[FEATURE] : 토스페이먼츠 결제 API를 구현합니다.
[FEATURE] 인증 인가 전반적인 구현을 완료합니다
REFACTOR - DDD 아키텍처로 마이그레이션 진행
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.
name: Pull Request
about: '풀 리퀘스트를 제출합니다.'
title: "[FEATURE] - [기능명] 또는 [FIX] - [버그 설명]"
labels: ''
assignees: ''
🆕 기능 추가 / 🔧 버그 수정
📋 변경 사항
🔍 테스트 사항
📄 관련 문서
📝 추가 사항