-
Notifications
You must be signed in to change notification settings - Fork 1
fix: sub 클레임 값을 UUID로 변환해 Authentication 객체의 principal로 설정하도록 수정 #44
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
Conversation
📝 Walkthrough""" WalkthroughJwtConfig의 jwtAuthenticationConverter 메서드가 JwtAuthenticationConverter에서 커스텀 Converter<Jwt, AbstractAuthenticationToken>로 변경되었습니다. JWT의 sub 클레임을 UUID로 변환하여 principal로 사용하며, roles 클레임에서 권한을 추출하도록 JwtGrantedAuthoritiesConverter를 활용합니다. SecurityConfig에서는 jwtAuthenticationConverter 타입이 구체 클래스에서 인터페이스 타입으로 변경되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Gateway (JwtConfig)
participant Spring Security
Client->>Gateway (JwtConfig): JWT 포함 요청
Gateway (JwtConfig)->>Gateway (JwtConfig): jwtAuthenticationConverter 호출
Gateway (JwtConfig)->>Gateway (JwtConfig): JWT에서 sub 추출 및 UUID 변환
Gateway (JwtConfig)->>Gateway (JwtConfig): roles에서 권한 추출
Gateway (JwtConfig)->>Spring Security: UsernamePasswordAuthenticationToken 생성 및 반환
Spring Security-->>Client: 인증된 principal(UUID) 전달
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 변경사항에서 범위를 벗어난 변경사항은 발견되지 않았습니다.) 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
gateway/src/main/kotlin/org/yapp/gateway/config/JwtConfig.kt(3 hunks)
🔇 Additional comments (5)
gateway/src/main/kotlin/org/yapp/gateway/config/JwtConfig.kt (5)
11-13: 새로운 임포트들이 적절하게 추가되었습니다.커스텀 Converter 구현을 위해 필요한 클래스들이 올바르게 임포트되었습니다.
Also applies to: 16-16, 18-18
29-29: 권한 접두어 제거를 위한 상수가 적절합니다.
NO_AUTHORITY_PREFIX상수는 Spring Security의 기본SCOPE_접두어를 제거하기 위한 명확한 의도를 나타냅니다.
72-79: 문서가 새로운 구현에 맞게 정확히 업데이트되었습니다.메서드 문서가 새로운 커스텀 Converter 구현과 UUID 변환 로직을 정확히 설명하고 있습니다.
81-81: 메서드 시그니처 변경이 적절합니다.
JwtAuthenticationConverter에서Converter<Jwt, out AbstractAuthenticationToken>로의 변경은 더 명시적이고 타입 안전한 접근 방식을 제공합니다.
82-84: JwtGrantedAuthoritiesConverter 설정이 올바릅니다.
roles클레임에서 권한을 추출하고 접두어를 제거하는 설정이 적절하게 구성되었습니다.
minwoo1999
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
* [BOOK-143] fix: gateway - sub 클레임을 UUID 타입으로 변환하여 인증 객체의 principal로 설정하도록 수정 * [BOOK-143] fix: gateway - SecurityConfig에서 의존성 타입 일치하도록 수정
* [BOOK-140] chore: apis - 패키지 이동 * [BOOK-140] refactor: apis - vo가 아닌 dto를 반화하도록 변경 * [BOOK-140] chore: apis - 개행 삭제 * [BOOK-140] chore: apis - 필요없는 명세 삭제 * [BOOK-140] feat: apis - 애플리케이션 레이어에 사용될 DTO 정의 * [BOOK-140] feat: domain - 도메인 전용 예외 클래스 구현 * [BOOK-140] refactor: domain - 역할 부여 여부에 따라 정적 팩토리 메서드 분리 * [BOOK-140] chore: apis - 패키지 이동 * [BOOK-140] chore: apis - 패키지 이동 * [BOOK-140] refactor: apis - 정적팩토리 메서드 인자로 vo를 받도록 변경 * [BOOK-140] refactor: apis - 컨트롤러에서 usecase로 갈때 dto를 받도록 변경 * [BOOK-140] refactor: apis - valid 로직 도입 * [BOOK-140] refactor: domain - 인증 로직에 사용되는 vo 구현 * [BOOK-140] refactor: domain, infra - 도메인 서비스에서 해당하는 vo를 리턴하도록 변경 * [BOOK-140] chore: infra - 새로운 메서드 추가 * [BOOK-140] refactor: apis - 인증 로직을 클린 아키텍처에 맞게 리팩토링 * [BOOK-140] chore: apis - dto 필드 검증 NotBlank로 변경 * [BOOK-140] chore: apis - 가시성을 위한 개행 추가 * [BOOK-140] refactor: apis, domain - 코드리뷰 반영 * [BOOK-140] refactor: apis, domain, infra - 코드리뷰 반영 * [BOOK-140] refactor: domain - UuidGenerator 유틸 클래스로 아이디 생성 방식 변경 * fix: sub 클레임 값을 UUID로 변환해 Authentication 객체의 principal로 설정하도록 수정 (#44) * [BOOK-143] fix: gateway - sub 클레임을 UUID 타입으로 변환하여 인증 객체의 principal로 설정하도록 수정 * [BOOK-143] fix: gateway - SecurityConfig에서 의존성 타입 일치하도록 수정 * [BOOK-140] refactor: domain, infra - jpa 메서드 재정의 * [BOOK-140] feat: domain - 리프레쉬 토큰 관련 도메인 에러 클래스 생성 * [BOOK-140] chore: domain, apis - 메서드 네이밍 변경 * [BOOK-140] chore: domain - 필요 없는 중괄호 제거 * [BOOK-140] feat: doamin, infra - RefreshToken 도메인에 Value Class 적용 및 생성자 검증 추가 - RefreshToken 내 id, token, userId를 각각 Value Class(Id, Token, UserId)로 분리 - Value Class 내 newInstance 정적 팩토리 메서드 구현 및 검증 로직 추가 * [BOOK-140] feat: apis - 비즈니스 로직에 사용될 요청 및 응답 dto 구현 * [BOOK-140] refactor: domain - 무조건 true인 검증 제거 * [BOOK-140] refactor: requestDTO를 받도록 변경 * [BOOK-140] refactor: apis - redis 관련 인증도메인 리팩토링 * [BOOK-140] refactor: apis, infra - 값 기반 비교를 위해 객체들을 VO(Value Object)로 리팩토링 - ID, EMAIL, PROVIDERID는 동일한 값을 가지면 같은 객체임 * [BOOK-140] refactor: infra - this 추가 * [BOOK-140] refactor: apis, domain - vo 매핑으로 인한 변동사항 반영 * [BOOK-140] refactor: domain, infra - 값 기반 비교를 위해 객체들을 VO(Value Object)로 리팩토링 * [BOOK-140] refactor: apis, domain - 값 객체 매핑으로 인한 변동사항 반영 * [BOOK-140] feat: domain - 책 관련 도메인 예외 클래스 생성 * [BOOK-140] feat: domain - 책 관련 도메인 예외 클래스 생성 * [BOOK-140] refactor: domain, infra - 생성된 도메인 예외를 이용해 로직 리팩토링 * [BOOK-140] chore: apis, domain - vo 이름 구체화 * [BOOK-140] chore: infra - 패키지 변경 * [BOOK-140] refactor: domain, infra - 값 기반 비교를 위해 객체들을 VO(Value Object)로 리팩토링 * [BOOK-140] refactor: domain, apis - VO 래핑으로 인한 변동사항 반영 * [BOOK-140] refactor: apis, domain, infra - 코드레빗 리뷰 반영 * [BOOK-140] refactor: apis - 코드레빗 리뷰 반영 * [BOOK-140] chore: domain - 메서드 위치 변경 * [BOOK-140] chore: apis - 가독성을 위한 개행 추가 * [BOOK-140] feat: global-utils - email, isbn 전역 validator 구현 * [BOOK-140] refactor: domain - email, isbn 전역 validator 적용



🔗 관련 이슈
📘 작업 유형
📙 작업 내역
변경 사항
문제 상황
해결 방법
🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
✅ PR 체크리스트
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit