Skip to content

🔀 :: [#821] - 이메일 인증 코드 검증시 사용처도 같이 받도록 변경 - #822

Merged
dolong2 merged 5 commits into
developfrom
feature/authenticate-email-code
Jul 24, 2026
Merged

🔀 :: [#821] - 이메일 인증 코드 검증시 사용처도 같이 받도록 변경#822
dolong2 merged 5 commits into
developfrom
feature/authenticate-email-code

Conversation

@dolong2

@dolong2 dolong2 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

개요

  • 이메일 인증 코드를 검증할때 사용처를 같이 받아서 검증하도록 변경합니다.

작업내용

  • 이메일 인증 요청 dto에 usage 필드 추가
  • 이메일 인증 검증 서비스에서 usage를 검사하도록 변경
  • 유스케이스에서 dto를 서비스에 전달핟도록 수정

체크리스트

탬플릿외에 필요한 항목이 있으면 추가해주세요.

  • 로컬에서 빌드가 성공하나요?
  • 추가(수정)한 코드가 정상적으로 동작하나요?
  • pr 타켓 브랜치가 맞게 설정되어 있나요?
  • pr에서 작업할 내용만 작업됐나요?
  • 기존 API와 호환되지 않는 사항이 있나요?

Summary by CodeRabbit

  • 새로운 기능

    • 이메일 인증 요청에 인증 용도 정보가 추가되었습니다.
    • 인증 코드 검증 시 요청한 용도와 실제 인증 정보가 일치하는지 확인합니다.
  • 버그 수정

    • 다른 용도로 발급된 인증 코드를 검증에 사용할 수 없도록 개선했습니다.
  • 테스트

    • 인증 용도 일치 여부와 관련된 검증 시나리오를 보강했습니다.

@dolong2 dolong2 self-assigned this Jul 24, 2026
@dolong2 dolong2 added 1️⃣ Priority: 상 우선순위 상 ✨ Feature 기능 개발 labels Jul 24, 2026
@dolong2 dolong2 linked an issue Jul 24, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@dolong2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89f897fe-d12a-4736-bcf0-d49a58e7d5ee

📥 Commits

Reviewing files that changed from the base of the PR and between 3e90496 and 6dc947a.

📒 Files selected for processing (2)
  • src/test/kotlin/com/dcd/server/core/domain/auth/usecase/AuthenticateMailUseCaseTest.kt
  • src/test/kotlin/com/dcd/server/presentation/domain/auth/AuthWebAdapterTest.kt

Walkthrough

이메일 인증 요청과 내부 DTO에 EmailAuthUsage를 추가하고, 검증 서비스가 요청 용도와 저장된 인증 용도를 비교하도록 변경했습니다. 유스케이스와 서비스 테스트도 DTO 기반 호출을 사용합니다.

Changes

이메일 인증 용도 검증

Layer / File(s) Summary
인증 요청 계약과 DTO 매핑
src/main/kotlin/com/dcd/server/presentation/domain/auth/data/request/CertificateMailRequest.kt, src/main/kotlin/com/dcd/server/presentation/domain/auth/data/exetension/AuthRequestDataExtension.kt, src/main/kotlin/com/dcd/server/core/domain/auth/dto/request/CertificateMailReqDto.kt
외부 및 내부 인증 요청 DTO에 usage를 추가하고 DTO 변환 시 값을 전달합니다.
인증 용도 검증 흐름
src/main/kotlin/com/dcd/server/core/domain/auth/service/..., src/main/kotlin/com/dcd/server/core/domain/auth/usecase/AuthenticateMailUseCase.kt, src/test/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthServiceImplTest.kt
verifyCode가 DTO를 입력으로 받고, 저장된 인증 용도와 요청 용도가 다르면 NotFoundAuthCodeException을 발생시키도록 변경했으며 관련 테스트를 갱신했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • dolong2/dcd#415verifyCode의 인증 코드 미존재 상황에서 NotFoundAuthCodeException을 다룹니다.
  • dolong2/dcd#566 — 이메일 인증 모델과 검증 어노테이션에서 usage를 활용하는 변경과 연결됩니다.

Suggested labels: :hammer: Refactor

Poem

토끼가 코드를 들고 폴짝,
용도 필드 하나를 담았네.
맞는 인증은 저장하고,
다른 용도는 돌려보내며,
이메일 문이 활짝 열리네.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 이메일 인증 코드 검증 시 usage를 함께 받도록 바꾼 핵심 변경을 정확히 반영합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/authenticate-email-code

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/test/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthServiceImplTest.kt (1)

27-54: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

usage 불일치 시나리오를 회귀 테스트로 추가하세요.

현재 테스트는 요청 DTO와 저장된 EmailAuth 모두 testUsage를 사용하므로, VerifyEmailAuthServiceImpl.kt의 Line 31-33 분기가 검증되지 않습니다. 저장된 인증의 usage를 다른 값으로 설정하고 NotFoundAuthCodeException 발생 및 save 미호출을 검증해야 합니다.

🤖 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
`@src/test/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthServiceImplTest.kt`
around lines 27 - 54, Add a regression case to the verifyCode test where the
persisted EmailAuth usage differs from the request DTO’s testUsage. Assert that
serviceImpl.verifyCode throws NotFoundAuthCodeException and verify
commandEmailAuthPort.save is not called for this mismatch.
🤖 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.

Nitpick comments:
In
`@src/test/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthServiceImplTest.kt`:
- Around line 27-54: Add a regression case to the verifyCode test where the
persisted EmailAuth usage differs from the request DTO’s testUsage. Assert that
serviceImpl.verifyCode throws NotFoundAuthCodeException and verify
commandEmailAuthPort.save is not called for this mismatch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b5d30c3-8943-4314-becf-d7da3341fceb

📥 Commits

Reviewing files that changed from the base of the PR and between 0d835e9 and 3e90496.

📒 Files selected for processing (7)
  • src/main/kotlin/com/dcd/server/core/domain/auth/dto/request/CertificateMailReqDto.kt
  • src/main/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthService.kt
  • src/main/kotlin/com/dcd/server/core/domain/auth/service/impl/VerifyEmailAuthServiceImpl.kt
  • src/main/kotlin/com/dcd/server/core/domain/auth/usecase/AuthenticateMailUseCase.kt
  • src/main/kotlin/com/dcd/server/presentation/domain/auth/data/exetension/AuthRequestDataExtension.kt
  • src/main/kotlin/com/dcd/server/presentation/domain/auth/data/request/CertificateMailRequest.kt
  • src/test/kotlin/com/dcd/server/core/domain/auth/service/VerifyEmailAuthServiceImplTest.kt

@dolong2
dolong2 merged commit 54a6810 into develop Jul 24, 2026
2 checks passed
@dolong2
dolong2 deleted the feature/authenticate-email-code branch July 24, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1️⃣ Priority: 상 우선순위 상 ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

이메일 인증 코드 검증시 사용처도 같이 받도록 변경

1 participant