Skip to content

feat: CoreSocialAuth 기반 소셜 로그인 연동 - #14

Merged
gnoes-ios merged 8 commits into
devfrom
feat/auth-social-login
Aug 5, 2026
Merged

feat: CoreSocialAuth 기반 소셜 로그인 연동#14
gnoes-ios merged 8 commits into
devfrom
feat/auth-social-login

Conversation

@gnoes-ios

Copy link
Copy Markdown
Contributor

📌 변경 요약

  • CoreSocialAuth 모듈 신설 및 Kakao/Apple 로그인 실구현 이동
  • AuthClient 소셜 credential 주입 경로를 Core 기반으로 재구성
  • 네트워크 로그/UserDefaults 경고 정리와 아키텍처 문서 동기화

📌 변경 내용

CoreSocialAuth

  • Projects/Core/SocialAuth 모듈 추가
  • Kakao/Apple credential 획득, factory, bootstrap/redirect helper 배치
  • Domain 비의존 소셜 인증 기술 계층 구성

Data

  • AuthClient.live의 CoreSocialAuth 주입 연동
  • SocialAuthCredentialProvider provider 선택 및 에러 매핑 추가
  • 구 OAuth stub 소유 제거
  • RemoteDatasource encoder 프로퍼티 규칙 적용

App

  • SocialAuth factory/bootstrap/redirect 조립 전용 구조 정리
  • Debug 카카오 키 누락 시 부트 실패 가드 추가
  • Sign in with Apple entitlement 및 URL scheme 설정 반영
  • UserDefaults standard 저장소 사용으로 suiteName 경고 제거

Network / Config

  • DEBUG 네트워크 로그 body 멀티라인 + 필드 유지형 redact 적용
  • Kakao SDK 패키지, Example 키 템플릿, AppInfo 키 로딩 경로 추가
  • 로컬 DerivedData 경로 git/lint 무시 보강

Docs / Test

  • ARCHITECTURE, AGENTS, Data/Core README 계층 규칙 동기화
  • 소셜 factory notConfigured 및 credential 매핑 테스트 추가

@gnoes-ios gnoes-ios added the feat 새로운 기능 label Aug 5, 2026
@gnoes-ios gnoes-ios self-assigned this Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • 새로운 기능

    • Apple 및 Kakao 소셜 로그인을 지원합니다.
    • 로그인 리디렉션과 인증 오류 처리가 개선되었습니다.
    • 앱 설정에서 Kakao 인증 정보를 안전하게 구성할 수 있습니다.
  • 개선

    • 네트워크 로그의 JSON 본문 가독성이 향상되었습니다.
    • 액세스 토큰과 인증 관련 민감 정보가 자동으로 마스킹됩니다.
    • 인증 자격 증명 처리와 오류 매핑이 일관되게 동작합니다.
  • 문서

    • 소셜 인증 모듈과 인증 아키텍처 안내를 추가했습니다.

Walkthrough

CoreSocialAuth에 Kakao·Apple 인증을 추가하고, Data와 앱 부트스트랩에 연결했습니다. Kakao SDK 설정과 리디렉션 처리를 추가했습니다. 네트워크 로그의 JSON 포맷팅과 민감 값 마스킹도 확장했습니다.

Changes

소셜 인증 통합

Layer / File(s) Summary
CoreSocialAuth 서비스와 SDK 연결
Projects/Core/SocialAuth/..., Projects/ThirdParty/ThirdPartyCore/..., Tuist/ProjectDescriptionHelpers/Module.swift
Kakao·Apple 인증 서비스, 공통 프로토콜, 오류 타입, factory와 SDK 의존성을 추가했습니다.
Data 인증 credential 흐름
Projects/Data/Sources/Auth/..., Projects/Data/Tests/Auth/...
AuthClientSocialAuthServices를 사용하도록 변경했습니다. credential provider와 오류 매핑 테스트를 추가했습니다.
앱 설정과 인증 런타임 wiring
Projects/App/..., Projects/Shared/Util/..., Tuist/ProjectDescriptionHelpers/..., Projects/Feature/...
Kakao 키 조회·초기화, Apple entitlement, Kakao URL 리디렉션과 앱 의존성 구성을 추가했습니다.
네트워크 로그 포맷과 마스킹
Projects/Core/Network/Sources/Logging/NetworkLog.swift, Projects/Core/Network/Tests/NetworkLogTests.swift
JSON 본문을 pretty-print하고 Bearer 토큰 및 지정 민감 필드의 값만 [REDACTED]로 치환합니다.
저장소와 아키텍처 지원 변경
.gitignore, .package.resolved, .swiftlint.yml, AGENTS.md, CLAUDE.md, docs/ARCHITECTURE.md
DerivedData 제외 규칙, 패키지 잠금 정보, 모듈 구조와 아키텍처 문서를 갱신했습니다.

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: 인증 리디렉션 처리 결과
Loading

Possibly related PRs

  • TeamMozi/mozi-iOS#9: NetworkLog의 본문 포맷팅과 민감 정보 마스킹을 확장한 변경과 직접 연결됩니다.
  • TeamMozi/mozi-iOS#12: Dependencies.register, AuthClient.live와 OAuth wiring을 소셜 인증 서비스로 변경한 흐름과 연결됩니다.
  • TeamMozi/mozi-iOS#13: 새 소셜 인증 서비스와 AuthClient 로그인 의존성을 사용하는 후속 인증 흐름과 연결됩니다.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 CoreSocialAuth 기반 Kakao 및 Apple 소셜 로그인 연동이라는 주요 변경 사항을 명확하게 요약합니다.
Description check ✅ Passed 설명은 템플릿의 요약, 변경 내용, 참고 사항 구조를 따르며 주요 구현·설정·테스트 변경을 구체적으로 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
Projects/Core/Network/Sources/Logging/NetworkLog.swift (1)

16-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

CoreNetwork 로그 경로를 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

📥 Commits

Reviewing files that changed from the base of the PR and between bba51b0 and 810ad7a.

⛔ Files ignored due to path filters (1)
  • Config/Example.xcconfig is excluded by !Config/**
📒 Files selected for processing (44)
  • .gitignore
  • .package.resolved
  • .swiftlint.yml
  • AGENTS.md
  • CLAUDE.md
  • Projects/App/Mozi.entitlements
  • Projects/App/Project.swift
  • Projects/App/Sources/DI/AppBootstrap.swift
  • Projects/App/Sources/DI/AppConfiguration.swift
  • Projects/App/Sources/DI/Dependencies.swift
  • Projects/App/Sources/DI/InfraContainer.swift
  • Projects/App/Sources/MoziApp.swift
  • Projects/Core/Network/Sources/Logging/NetworkLog.swift
  • Projects/Core/Network/Tests/NetworkLogTests.swift
  • Projects/Core/SocialAuth/Project.swift
  • Projects/Core/SocialAuth/README.md
  • Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift
  • Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthBootstrap.swift
  • Projects/Core/SocialAuth/Sources/Kakao/KakaoAuthRedirectHandler.swift
  • Projects/Core/SocialAuth/Sources/Kakao/KakaoSocialAuthService.swift
  • Projects/Core/SocialAuth/Sources/NotConfiguredSocialAuthService.swift
  • Projects/Core/SocialAuth/Sources/SocialAuthConfiguration.swift
  • Projects/Core/SocialAuth/Sources/SocialAuthError.swift
  • Projects/Core/SocialAuth/Sources/SocialAuthService.swift
  • Projects/Core/SocialAuth/Sources/SocialAuthServiceFactory.swift
  • Projects/Core/SocialAuth/Sources/SocialAuthServices.swift
  • Projects/Core/SocialAuth/Tests/SocialAuthServiceFactoryTests.swift
  • Projects/Data/Project.swift
  • Projects/Data/README.md
  • Projects/Data/Sources/Auth/Client/AuthClient+Live.swift
  • Projects/Data/Sources/Auth/Datasource/AuthRemoteDatasource.swift
  • Projects/Data/Sources/Auth/Service/OAuth/OAuthServiceFactory.swift
  • Projects/Data/Sources/Auth/Service/SocialAuth/SocialAuthCredentialProvider.swift
  • Projects/Data/Tests/Auth/OAuthServiceFactoryTests.swift
  • Projects/Data/Tests/Auth/SocialAuthCredentialProviderTests.swift
  • Projects/Feature/Sources/AppCoordinator/AppCoordinatorView.swift
  • Projects/Shared/Util/Sources/Bundle/AppInfo.swift
  • Projects/Shared/Util/Sources/Bundle/InfoPlistKey.swift
  • Projects/ThirdParty/ThirdPartyCore/Project.swift
  • Projects/ThirdParty/ThirdPartyCore/Sources/Exports.swift
  • Tuist/ProjectDescriptionHelpers/DefaultInfoPlist.swift
  • Tuist/ProjectDescriptionHelpers/Module.swift
  • Tuist/ProjectDescriptionHelpers/ProjectFactory.swift
  • docs/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

Comment thread Projects/Core/SocialAuth/Sources/Apple/AppleSocialAuthService.swift
@gnoes-ios
gnoes-ios merged commit 18a5b55 into dev Aug 5, 2026
3 checks passed
@gnoes-ios
gnoes-ios deleted the feat/auth-social-login branch August 5, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant