-
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
✨ 인증 코드 도메인 정의 #7
Conversation
Walkthrough이 변경 사항은 인증 코드 관리를 위한 새로운 도메인 모델을 도입하는 것입니다. Changes
Possibly related PRs
Tip New featuresWalkthrough comment now includes:
Notes:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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
CodeRabbit Configuration File (
|
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.
p3) 이거 서브모듈 왜 계속 changed로 남는지 아시나요?
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.
저도 잘 모르겠네용...허허 알면 알려주세요
|
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- domain/src/main/kotlin/com/threedays/domain/auth/entity/AuthCode.kt (1 hunks)
- domain/src/main/kotlin/com/threedays/domain/auth/exception/AuthException.kt (1 hunks)
- domain/src/main/kotlin/com/threedays/domain/auth/repository/AuthCodeRepository.kt (1 hunks)
- domain/src/main/kotlin/com/threedays/domain/auth/vo/AuthCodeId.kt (1 hunks)
- domain/src/test/kotlin/com/threedays/domain/auth/entity/AuthCodeTest.kt (1 hunks)
- openapi (1 hunks)
Files skipped from review due to trivial changes (2)
- domain/src/main/kotlin/com/threedays/domain/auth/repository/AuthCodeRepository.kt
- openapi
Additional comments not posted (10)
domain/src/main/kotlin/com/threedays/domain/auth/vo/AuthCodeId.kt (1)
6-6
: UUIDTypeId 상속을 통한 타입 안전성 강화
AuthCodeId
클래스는UUIDTypeId
를 상속받아 UUID를 안전하게 관리합니다. 이 구조는 타입 안전성을 강화하며, UUID의 유효성을 보장하는 데 도움이 됩니다.domain/src/main/kotlin/com/threedays/domain/auth/exception/AuthException.kt (1)
5-18
: 예외 처리 클래스의 구조화
AuthException
클래스는 봉인된 클래스를 사용하여 인증 관련 예외의 종류를 제한합니다. 각 예외는 고유한 메시지와 코드 번호를 가지고 있어, 오류 처리와 디버깅에 유용합니다.domain/src/main/kotlin/com/threedays/domain/auth/entity/AuthCode.kt (1)
9-52
: 인증 코드 관리 및 검증 로직 구현
AuthCode
클래스는 인증 코드의 생성, 관리 및 검증을 담당합니다. 클래스는AggregateRoot
를 상속받아 도메인 주도 설계의 원칙을 잘 따르고 있습니다. 인증 코드의 유효성 검사는 명확하게 정의되어 있으며, 유효하지 않은 경우 또는 만료된 경우에 대한 예외 처리가 적절히 구현되어 있습니다.domain/src/test/kotlin/com/threedays/domain/auth/entity/AuthCodeTest.kt (7)
1-11
: 구조 및 임포트 승인테스트 클래스의 구조와 임포트가 적절하게 관리되고 있습니다. Kotest를 사용한 테스트 작성 방식이 명확하게 구현되어 있습니다.
15-28
: 새로운 인증 코드 생성 테스트 승인인증 코드 생성에 대한 테스트가 잘 구현되어 있습니다. 코드의 길이, 숫자 여부, 만료 시간 일치 등 필요한 모든 속성을 정확하게 검증하고 있습니다.
31-43
: 유효한 인증 코드 검증 테스트 승인유효한 인증 코드에 대한 검증이 예외 없이 정상적으로 수행되는 것을 확인하는 테스트가 잘 구현되어 있습니다.
46-57
: 잘못된 인증 코드 처리 테스트 승인잘못된 인증 코드를 사용할 때
InvalidAuthCodeException
이 발생하는 것을 확인하는 테스트가 적절하게 구현되어 있습니다.
60-70
: 만료된 인증 코드 처리 테스트 승인만료된 인증 코드를 사용할 때
AuthCodeExpiredException
이 발생하는 것을 확인하는 테스트가 적절하게 구현되어 있습니다.
74-104
: 인증 코드 값 객체 테스트 승인인증 코드의 값 객체에 대한 테스트가 잘 구현되어 있습니다. 유효한 코드 생성, 길이 불일치 및 숫자가 아닌 문자 포함에 대한 예외 처리가 포함되어 있어 객체의 무결성을 보장합니다.
106-115
: 코드 생성 테스트 승인코드 생성 기능에 대한 테스트가 잘 구현되어 있습니다. 생성된 코드가 6자리 숫자로만 구성되어 있는지를 정확하게 검증하고 있습니다.
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.
auth code 생성되고 이후에 삭제 되진 않아도 되나요? ttl이 없어서 db 크론 돌려야하나
Redis ttl로 날리려구요 |
인증코드는 유저랑 라이프사이클이 달라서 별도 바운디드 컨텍스트로 분리했습니다.
Summary by CodeRabbit
새로운 기능
AuthCode
클래스 추가.verify()
추가.AuthException
클래스 추가.AuthCodeRepository
추가.AuthCodeId
클래스 추가.버그 수정