feat: CoreSocialAuth 기반 소셜 로그인 연동 - #14
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughCoreSocialAuth에 Kakao·Apple 인증을 추가하고, Data와 앱 부트스트랩에 연결했습니다. Kakao SDK 설정과 리디렉션 처리를 추가했습니다. 네트워크 로그의 JSON 포맷팅과 민감 값 마스킹도 확장했습니다. Changes소셜 인증 통합
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant App
participant AppBootstrap
participant SocialAuthServiceFactory
participant KakaoAuthBootstrap
participant AuthClient
App->>AppBootstrap: 앱 시작
AppBootstrap->>KakaoAuthBootstrap: initializeIfNeeded(appKey:)
AppBootstrap->>SocialAuthServiceFactory: make(configuration:)
SocialAuthServiceFactory-->>AppBootstrap: SocialAuthServices
AppBootstrap->>AuthClient: 의존성 등록
App->>KakaoAuthBootstrap: handle(url:)
KakaoAuthBootstrap-->>App: 인증 리디렉션 처리 결과
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
Projects/Core/Network/Sources/Logging/NetworkLog.swift (1)
16-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCoreNetwork 로그 경로를
SharedLogger.network로 통일하세요.Line 16은
Logger.shared에 직접 기록합니다. 요청, 응답, 오류 로그가 같은 network logger를 사용하도록NetworkLog의 호출을SharedLogger.network로 변경하세요.As per coding guidelines,
CoreNetwork 로깅은 SharedLogger.network를 사용해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Projects/Core/Network/Sources/Logging/NetworkLog.swift` at line 16, Update the logging call in NetworkLog to use SharedLogger.network instead of Logger.shared, ensuring request, response, and error messages all write through the shared network logger while preserving the existing message and info-level behavior.Sources: Coding guidelines, Path instructions
Projects/Core/SocialAuth/Sources/SocialAuthService.swift (1)
3-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win공개 API와 계약에
///문서를 추가하세요.이 모듈은 다른 계층이 사용하는 인증 계약을 새로 노출합니다. 각 공개 타입, 프로토콜, 초기화 메서드, 동작의 입력과 실패 조건을 문서화하세요.
Projects/Core/SocialAuth/Sources/SocialAuthService.swift#L3-L4:login()의 반환 토큰과 오류 조건을 문서화하세요.Projects/Core/SocialAuth/Sources/SocialAuthConfiguration.swift#L3-L8: Kakao app key의 용도와 nil 허용 의미를 문서화하세요.Projects/Core/SocialAuth/Sources/SocialAuthError.swift#L3-L7: 각 오류 case의 발생 조건을 문서화하세요.Projects/Core/SocialAuth/Sources/SocialAuthServices.swift#L3-L10: provider별 서비스 선택 계약을 문서화하세요.Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift#L7-L16: 초기화와login()의 presentation 요구사항을 문서화하세요.Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthBootstrap.swift#L5-L16: 초기화 호출 시점과 빈 key 처리 동작을 문서화하세요.Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthRedirectHandler.swift#L4-L12: 처리 가능한 URL과 반환값의 의미를 문서화하세요.Projects/Core/SocialAuth/Sources/Kakao/KakaoSocialAuthService.swift#L5-L8: 초기화 요구사항과 반환 access token의 의미를 문서화하세요.As per path instructions, “공개 API·계약에는 ///를 사용”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Projects/Core/SocialAuth/Sources/SocialAuthService.swift` around lines 3 - 4, The public SocialAuth API lacks required `///` documentation. Add concise documentation at the listed declarations: in Projects/Core/SocialAuth/Sources/SocialAuthService.swift lines 3-4 document `login()`’s token result and failure conditions; in Projects/Core/SocialAuth/Sources/SocialAuthConfiguration.swift lines 3-8 document the Kakao app key purpose and nil meaning; in Projects/Core/SocialAuth/Sources/SocialAuthError.swift lines 3-7 document each error case; in Projects/Core/SocialAuth/Sources/SocialAuthServices.swift lines 3-10 document provider selection; in Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift lines 7-16 document initialization and presentation requirements; in Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthBootstrap.swift lines 5-16 document initialization timing and empty-key behavior; in Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthRedirectHandler.swift lines 4-12 document supported URLs and return-value meaning; and in Projects/Core/SocialAuth/Sources/Kakao/KakaoSocialAuthService.swift lines 5-8 document initialization requirements and access-token meaning.Source: Path instructions
Projects/Core/SocialAuth/Sources/SocialAuthServiceFactory.swift (1)
3-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win공개 API 문서를 추가하십시오.
SocialAuthServiceFactory,init(),make(configuration:)는 공개 계약입니다. 각 선언에///문서를 추가하십시오.As per coding guidelines: “공개 API·계약에는 ///를 사용”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Projects/Core/SocialAuth/Sources/SocialAuthServiceFactory.swift` around lines 3 - 7, SocialAuthServiceFactory and its public init() and make(configuration:) declarations lack required API documentation. Add concise /// documentation to each declaration, describing the factory, its initializer, and the service-creation method while preserving the existing API and actor isolation.Sources: Coding guidelines, Path instructions
Projects/Core/SocialAuth/Sources/NotConfiguredSocialAuthService.swift (1)
3-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win공개 API 문서를 추가하세요.
NotConfiguredSocialAuthService,init(message:),login()은 public 계약입니다. 각 선언에///문서를 추가하세요.As per coding guidelines, 공개 API·계약에는
///를 사용해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Projects/Core/SocialAuth/Sources/NotConfiguredSocialAuthService.swift` around lines 3 - 10, 공개 API인 NotConfiguredSocialAuthService, init(message:), login() 선언에 각각 Swift /// 문서를 추가하세요. 각 문서는 타입과 초기화 메서드 및 로그인 동작의 계약을 명확히 설명해야 하며, 구현은 변경하지 마세요.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift`:
- Around line 48-56: AppleSocialAuthService의 resolvePresentationAnchor를 제거하고,
로그인 요청을 시작한 scene의 ASPresentationAnchor를 반환하는 provider를 외부에서 주입하도록 변경하세요. App
composition에서 실제 window/scene 선택 로직을 구현하고, CoreSocialAuth 내부에서는 주입된 provider만
사용해 anchor를 얻도록 하며 UIApplication, UIWindowScene, connectedScenes에 대한 직접 참조와 임시
anchor fallback을 제거하세요.
---
Nitpick comments:
In `@Projects/Core/Network/Sources/Logging/NetworkLog.swift`:
- Line 16: Update the logging call in NetworkLog to use SharedLogger.network
instead of Logger.shared, ensuring request, response, and error messages all
write through the shared network logger while preserving the existing message
and info-level behavior.
In `@Projects/Core/SocialAuth/Sources/NotConfiguredSocialAuthService.swift`:
- Around line 3-10: 공개 API인 NotConfiguredSocialAuthService, init(message:),
login() 선언에 각각 Swift /// 문서를 추가하세요. 각 문서는 타입과 초기화 메서드 및 로그인 동작의 계약을 명확히 설명해야 하며,
구현은 변경하지 마세요.
In `@Projects/Core/SocialAuth/Sources/SocialAuthService.swift`:
- Around line 3-4: The public SocialAuth API lacks required `///` documentation.
Add concise documentation at the listed declarations: in
Projects/Core/SocialAuth/Sources/SocialAuthService.swift lines 3-4 document
`login()`’s token result and failure conditions; in
Projects/Core/SocialAuth/Sources/SocialAuthConfiguration.swift lines 3-8
document the Kakao app key purpose and nil meaning; in
Projects/Core/SocialAuth/Sources/SocialAuthError.swift lines 3-7 document each
error case; in Projects/Core/SocialAuth/Sources/SocialAuthServices.swift lines
3-10 document provider selection; in
Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift lines 7-16
document initialization and presentation requirements; in
Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthBootstrap.swift lines 5-16
document initialization timing and empty-key behavior; in
Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthRedirectHandler.swift lines 4-12
document supported URLs and return-value meaning; and in
Projects/Core/SocialAuth/Sources/Kakao/KakaoSocialAuthService.swift lines 5-8
document initialization requirements and access-token meaning.
In `@Projects/Core/SocialAuth/Sources/SocialAuthServiceFactory.swift`:
- Around line 3-7: SocialAuthServiceFactory and its public init() and
make(configuration:) declarations lack required API documentation. Add concise
/// documentation to each declaration, describing the factory, its initializer,
and the service-creation method while preserving the existing API and actor
isolation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 03276a76-16a3-4f9c-ab8a-ff3a3d3439b0
⛔ Files ignored due to path filters (1)
Config/Example.xcconfigis excluded by!Config/**
📒 Files selected for processing (44)
.gitignore.package.resolved.swiftlint.ymlAGENTS.mdCLAUDE.mdProjects/App/Mozi.entitlementsProjects/App/Project.swiftProjects/App/Sources/DI/AppBootstrap.swiftProjects/App/Sources/DI/AppConfiguration.swiftProjects/App/Sources/DI/Dependencies.swiftProjects/App/Sources/DI/InfraContainer.swiftProjects/App/Sources/MoziApp.swiftProjects/Core/Network/Sources/Logging/NetworkLog.swiftProjects/Core/Network/Tests/NetworkLogTests.swiftProjects/Core/SocialAuth/Project.swiftProjects/Core/SocialAuth/README.mdProjects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swiftProjects/Core/SocialAuth/Sources/Kakao/KakaoAuthBootstrap.swiftProjects/Core/SocialAuth/Sources/Kakao/KakaoAuthRedirectHandler.swiftProjects/Core/SocialAuth/Sources/Kakao/KakaoSocialAuthService.swiftProjects/Core/SocialAuth/Sources/NotConfiguredSocialAuthService.swiftProjects/Core/SocialAuth/Sources/SocialAuthConfiguration.swiftProjects/Core/SocialAuth/Sources/SocialAuthError.swiftProjects/Core/SocialAuth/Sources/SocialAuthService.swiftProjects/Core/SocialAuth/Sources/SocialAuthServiceFactory.swiftProjects/Core/SocialAuth/Sources/SocialAuthServices.swiftProjects/Core/SocialAuth/Tests/SocialAuthServiceFactoryTests.swiftProjects/Data/Project.swiftProjects/Data/README.mdProjects/Data/Sources/Auth/Client/AuthClient+Live.swiftProjects/Data/Sources/Auth/Datasource/AuthRemoteDatasource.swiftProjects/Data/Sources/Auth/Service/OAuth/OAuthServiceFactory.swiftProjects/Data/Sources/Auth/Service/SocialAuth/SocialAuthCredentialProvider.swiftProjects/Data/Tests/Auth/OAuthServiceFactoryTests.swiftProjects/Data/Tests/Auth/SocialAuthCredentialProviderTests.swiftProjects/Feature/Sources/AppCoordinator/AppCoordinatorView.swiftProjects/Shared/Util/Sources/Bundle/AppInfo.swiftProjects/Shared/Util/Sources/Bundle/InfoPlistKey.swiftProjects/ThirdParty/ThirdPartyCore/Project.swiftProjects/ThirdParty/ThirdPartyCore/Sources/Exports.swiftTuist/ProjectDescriptionHelpers/DefaultInfoPlist.swiftTuist/ProjectDescriptionHelpers/Module.swiftTuist/ProjectDescriptionHelpers/ProjectFactory.swiftdocs/ARCHITECTURE.md
💤 Files with no reviewable changes (3)
- Projects/Data/Tests/Auth/OAuthServiceFactoryTests.swift
- Projects/Data/Sources/Auth/Service/OAuth/OAuthServiceFactory.swift
- Projects/Feature/Sources/AppCoordinator/AppCoordinatorView.swift
📌 변경 요약
📌 변경 내용
CoreSocialAuth
Projects/Core/SocialAuth모듈 추가Data
AuthClient.live의 CoreSocialAuth 주입 연동SocialAuthCredentialProviderprovider 선택 및 에러 매핑 추가App
Network / Config
Docs / Test