-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#7 #18
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
# Conflicts: # src/main/kotlin/com/yapp2app/auth/api/controller/AuthController.kt # src/main/kotlin/com/yapp2app/auth/infra/security/config/DocumentSecurityConfig.kt # src/main/kotlin/com/yapp2app/auth/infra/security/properties/AppProperties.kt # src/main/kotlin/com/yapp2app/common/config/JasyptConfig.kt # src/main/resources/application-local.yaml # src/main/resources/application-staging.yaml # src/main/resources/application.yaml # src/test/kotlin/com/yapp2app/JasyptTest.kt
# Conflicts: # src/main/kotlin/com/yapp2app/auth/api/dto/AuthDto.kt # src/main/kotlin/com/yapp2app/user/infra/persist/jpa/UserRepository.kt
Code Format Check ✅
|
Code Format Check ❌
|
Code Format Check ❌
|
Code Format Check ✅
|
koosco
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.
고생하셨습니다! 코멘트 남긴 부분 확인 부탁드립니다. 🙇♂️
| * date : 2025. 12. 26. 18:05 | ||
| * description : 인증/인가 관련 요청 body | ||
| */ | ||
| data class KakaoOIDCLoginRequest(@NotBlank(message = "ID 토큰은 필수입니다") val idToken: String) |
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.
반영완료했습니다! String값의 경우만 NotBlank 처리했고, 나머지 Long값이나 enum타입의 경우는 ?인자가 붙은게 아니기떄문에 이미 null을 허용할 수 없어서 기본값이 0으로 들어가는 것으로 확인했습니다. 0으로 들어가기 때문에 가입된계정이 없습니다 이라는 BusinessException을 던지는데, 이부분을 그러면 Long? 으로 반환할지도 고민이되는데, 현상태도 괜찮을 것 같고 어떻게 하는 것이 좋을까요?
| @@ -0,0 +1,43 @@ | |||
| package com.yapp2app.common.util | |||
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.
제거완료
| password: ${JASYPT_PASSWORD} | ||
|
|
||
| app: | ||
| version: "@version@" |
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.
공통 설정의 경우 application.yaml에서 관리해도 될 것 같습니다!
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.
반영했습니다~
Dockerfile
Outdated
| @@ -0,0 +1,42 @@ | |||
| # Build stage | |||
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.
DockerFile 내부에서 gradle build를 하는 것 같은데, multi stage build가 필요하지 않다면 외부에서 gradle build를 하고 빌드 결과물만 COPY해오는 방법이 어떨까요? 트레이드 오프가 있을 것 같은데, DockerFile 내부에서 gradle build를 하면 캐싱을 사실상 활용하기가 어려워 전체 빌드 시간이 증가하고 gradle build에만 필요한 파일들이 포함되어 이미지 크기가 증가할 것 같습니다.
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.
말씀하신대로 GitAction 시점에 build한 jar를 이용하는 방식으로 진행했으며 Layerd Cache를 이용하여 이미지를 만들도록 변경했습니다!
| @@ -0,0 +1,19 @@ | |||
| package com.yapp2app.common.api.config | |||
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.
외부 요청을 보내는 용도라면 infra/config가 적절할 것 같습니다
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.
반영완료했습니다!
src/main/kotlin/com/yapp2app/auth/application/contract/KakaoClientResponse.kt
Show resolved
Hide resolved
| val nickname: String?, | ||
| ) | ||
|
|
||
| data class OIDCPublicKeysResponse(var keys: MutableList<OIDCPublicKeyDto>) |
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.
| data class OIDCPublicKeysResponse(var keys: MutableList<OIDCPublicKeyDto>) | |
| data class OIDCPublicKeysResponse(val keys: MutableList<OIDCPublicKeyDto>) |
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.
수정완료했습니다!
| } | ||
|
|
||
| private fun registerKakaoUserIfEmpty(oauthInfoResponse: OauthInfoResponse): User { | ||
| val existingUser = userRepositoryPort.findByOid( |
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.
조회 후 없는 경우 새로 인스턴스를 생성하는 것 같은데 existingUser 대신 user 같은 명수명은 어떨까요?
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.
변경완료했습니다!
Code Format Check ✅
|
Code Format Check ❌
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
Code Format Check ✅
|
# Conflicts: # src/test/kotlin/com/yapp2app/e2e/E2ETestBase.kt # src/test/resources/application-test.yml
Code Format Check ❌
|
Code Format Check ✅
|
Description
1. 카카오 OIDC 인증 API 구현
2. OIDC ID Token 검증 로직 (KakaoOauthHelper)
주요 구현 내용:
3. 계층별 구조
API Layer (AuthController)
Application Layer (KakaoAuthUseCase)
Infrastructure Layer
API Usage Example
Request
Response
References
특이사항
OIDC 인증을 하기위해
access_token이 아닌id_token을 이용하여 인증 진행, access_token을 client와 주고받으면, 탈취의 위험이 생김,이때 id_token으로만 인증을 할 경우 사용자의 email을 가져올 수 없음. (biz 앱 신청을 해야 가져올 수 있음) 하지만 우리 서비스에서는 email이 별도 필요하지 않기때문에
(oid, providerType)2개로 유저를 구분하도록 진행email 혹은 name은 null값이 될 수 있기때문에
?키워드 추가