Skip to content

[Feat] 인증 원격 데이터 소스 구현 - #85

Merged
MinHeokChoi merged 1 commit into
mainfrom
feat/#84-auth-remote-contracts
Jul 28, 2026
Merged

[Feat] 인증 원격 데이터 소스 구현#85
MinHeokChoi merged 1 commit into
mainfrom
feat/#84-auth-remote-contracts

Conversation

@MinHeokChoi

@MinHeokChoi MinHeokChoi commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

✨ PR 유형

어떤 변경 사항이 있나요??

  • 새로운 기능 추가
  • 버그 수정
  • 사용자 UI 디자인 변경 및 추가
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

🛠️ 작업내용

  • Apple·Google·Kakao와 unknown 값을 보존하는 AuthProvider를 추가했습니다.
  • 로그인·재발급·로그아웃·탈퇴 요청 및 응답 DTO를 추가했습니다.
  • 인증 endpoint별 AuthTarget을 추가하고 /auth/reissue
    X-Refresh-Token 헤더 계약을 고정했습니다.
  • isNewMember가 누락된 응답과 신규 provider raw value를 안전하게 처리합니다.
  • DefaultAuthRemoteDataSource와 deterministic stub/error 계약 테스트를
    추가했습니다.
  • UI, Keychain, AccountSessionStore, 자동 401 재시도와 런타임 네트워크 주입은
    포함하지 않았습니다.
  • Domain/Data Local/SwiftData/schema 계약은 변경하지 않았습니다.

검증

  • Auth Remote Contract XCTest: 14 passed, 0 failed/skipped
  • 전체 XCTest: 308 passed, 0 failed/skipped
  • iPhone 16 Simulator Debug build: passed
  • generic iPhone Debug/Release build: passed
  • bash Scripts/check-iphone-functional-gate.sh: passed
  • bash Scripts/check-swiftdata-boundary.sh: passed
  • plutil -lint Moru/Info.plist: passed
  • git diff --check: passed
  • 실제 iPhone: 미검증

📋 추후 진행 상황

  • 후속 P2에서 Keychain credential 저장과 AccountSessionStore 기반을 추가합니다.
  • 로그인 UI, 토큰 재발급 coordinator와 계정 lifecycle은 각각 후속 PR입니다.

📌 리뷰 포인트

  • public login/logout/withdrawal과 refresh header 계약이 Swagger와 맞는지 확인해 주세요.
  • isNewMember 누락과 unknown provider가 decoding 실패를 만들지 않는지 확인해 주세요.
  • P0 branch만 base로 포함되고 v1 런타임과 SwiftData 계약에 영향이 없는지 확인해 주세요.

✅ Checklist

PR이 다음 요구 사항을 충족하는지 확인해주세요!!!

Closes #84

Summary by CodeRabbit

  • New Features

    • Added authentication support for Apple, Google, Kakao, and other provider values.
    • Added login, token renewal, logout, and account withdrawal operations.
    • Added handling for access and refresh tokens, onboarding status, and new-member information.
    • Added validation for missing or unsupported authentication credentials.
  • Tests

    • Added comprehensive coverage for authentication requests, responses, validation, error handling, and protection of sensitive data in logs and sample payloads.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: da31c9fe-57b4-4b0e-a72a-31cae638a4a4

📥 Commits

Reviewing files that changed from the base of the PR and between c44afae and 4461fa0.

📒 Files selected for processing (5)
  • Moru/Moru/Data/Remote/Auth/AuthDTO.swift
  • Moru/Moru/Data/Remote/Auth/AuthProvider.swift
  • Moru/Moru/Data/Remote/Auth/AuthTarget.swift
  • Moru/Moru/Data/Remote/Auth/RemoteAuthDataSource.swift
  • Moru/MoruTests/AuthRemoteContractTests.swift

📝 Walkthrough

Walkthrough

Adds authentication DTOs, provider mapping, endpoint targets, and an injected remote data source for login, token reissue, logout, and withdrawal, with contract tests covering routing, validation, responses, and sensitive-data logging.

Changes

Authentication remote contract

Layer / File(s) Summary
Authentication DTO and provider contracts
Moru/Moru/Data/Remote/Auth/AuthDTO.swift, Moru/Moru/Data/Remote/Auth/AuthProvider.swift
Defines typed authentication requests and responses, provider serialization, case-insensitive known-provider decoding, and unknown-provider preservation.
Authentication endpoint routing
Moru/Moru/Data/Remote/Auth/AuthTarget.swift
Maps authentication operations to HTTP paths, methods, payload encoding, refresh-token headers, authentication requirements, and sample responses.
Remote operations and contract validation
Moru/Moru/Data/Remote/Auth/RemoteAuthDataSource.swift, Moru/MoruTests/AuthRemoteContractTests.swift
Adds validated async API-client operations and tests request construction, decoding, errors, deterministic samples, and sensitive-data omission from logs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

  • Team-Moru/moru-iOS#83 — Provides the networking foundation used by AuthTarget, AuthenticationRequirement, and APIClient.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: implementing the authentication remote data source.
Description check ✅ Passed The description follows the template and covers type, work done, follow-up, review points, and checklist.
Linked Issues check ✅ Passed The PR implements the requested auth API contract, RemoteDataSource, header contract, optional fields, unknown provider handling, and tests for #84.
Out of Scope Changes check ✅ Passed The changes stay within the auth contract and test scope and explicitly avoid the excluded UI, Keychain, and storage changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#84-auth-remote-contracts

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.

❤️ Share

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

Constraint: v2 네트워크 기반과 서버 인증 API 계약을 유지
Rejected: UI·Keychain·런타임 주입 동시 도입 | 계층별 검토와 회귀 격리를 위해 제외
Confidence: high
Scope-risk: narrow
Directive: 신규 provider와 DTO는 unknown·누락 필드 호환성을 유지할 것
Tested: 기존 PR HEAD와 tree 동일; PR 기록상 전체 XCTest 308개 및 Foundation·SwiftData gate 성공
Not-tested: 실제 iPhone 검증
@MinHeokChoi
MinHeokChoi force-pushed the feat/#84-auth-remote-contracts branch from 73a2cda to 4461fa0 Compare July 28, 2026 02:57
@MinHeokChoi
MinHeokChoi changed the base branch from chore/#81-v2-network-foundation to main July 28, 2026 02:57
@MinHeokChoi
MinHeokChoi marked this pull request as ready for review July 28, 2026 02:59
@MinHeokChoi
MinHeokChoi merged commit 9f0aad9 into main Jul 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 인증 API 계약과 RemoteDataSource 추가

1 participant