Skip to content

Conversation

@david-parkk
Copy link
Contributor

@david-parkk david-parkk commented Dec 19, 2025

#️⃣ 연관된 이슈

closes #365

📝작업 내용

  • 검증 로직 수정

작업 상세 내용

상세 내용을 입력해주세요.

💬리뷰 요구사항

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.

Summary by CodeRabbit

버그 수정

  • 북마크 권한 검증 로직을 수정했습니다. 사용자가 자신의 북마크에 올바르게 접근할 수 있도록 권한 검증을 개선했습니다. 이전에는 권한 검증 과정에서 오류가 있어 일부 사용자가 북마크에 접근하지 못하는 문제가 발생했으며, 이제 올바르게 동작합니다.

✏️ Tip: You can customize this high-level summary in your review settings.

david-parkk and others added 30 commits December 1, 2025 07:29
- FCM 설정
- DB import
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

개요

북마크 삭제 검증 로직의 권한 부여 조건이 역순이었던 버그를 수정했습니다. 북마크 소유자 ID가 현재 사용자 ID와 일치하지 않을 때만 UNAUTHORIZED_BOOKMARK 예외를 발생시키도록 변경했습니다.

변경 사항

집단 / 파일 변경 요약
북마크 권한 검증 수정
src/main/java/ku_rum/backend/domain/bookmark/application/BookmarkService.java
validateBookmarkAuthorization 메서드의 권한 검증 로직 수정: 북마크 소유자와 현재 사용자가 불일치할 때 UNAUTHORIZED_BOOKMARK 예외 발생 (기존: 일치할 때 발생)

예상 코드 리뷰 소요 시간

🎯 2 (단순) | ⏱️ ~10분

  • 단일 파일의 로직 수정이지만, 권한 검증의 중요한 부분이므로 수정 내용이 올바른지 검증 필요
  • 관련 테스트 케이스 실행 확인 권장

제안 검토자

  • kmw10693

🐰 권한 검증의 뒤바뀐 마음을
다시 바로잡으니 기분 좋아!
북마크는 주인만이 삭제하니
버그는 사라지고 보안은 반짝반짝 ✨
작지만 단단한 수정, 완료!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 북마크 버그 수정에 관한 것으로, 변경사항 요약(validateBookmarkAuthorization 권한 검증 로직 수정)과 관련이 있습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 대부분 따르고 있으나, '작업 상세 내용' 섹션이 미작성 상태입니다.
Linked Issues check ✅ Passed 코드 변경사항(권한 검증 로직 수정)이 링크된 이슈 #365의 '삭제 검증 버그' 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경사항이 BookmarkService의 validateBookmarkAuthorization 메서드에만 집중되어 있으며, 이슈 #365 범위 내의 변경입니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#365

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3229df and c55116b.

📒 Files selected for processing (1)
  • src/main/java/ku_rum/backend/domain/bookmark/application/BookmarkService.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
src/main/java/ku_rum/backend/domain/bookmark/application/BookmarkService.java (1)

75-80: 북마크 삭제 권한 검증 로직 구현 확인

새롭게 추가된 validateBookmarkAuthorization 메서드의 권한 검증 로직이 올바르게 구현되었습니다. 북마크 소유자와 요청 사용자의 ID가 일치하지 않을 때 UNAUTHORIZED_BOOKMARK 예외를 발생시켜 다른 사용자의 북마크 삭제를 방지합니다.

다만 현재 테스트 코드(BookmarkControllerTest.java)는 권한 검증 로직의 실패 시나리오를 다루지 않고 있으므로, 단위 테스트로 권한 없는 사용자의 삭제 시도를 명시적으로 검증하는 것을 권장합니다.

Likely an incorrect or invalid review comment.


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 and usage tips.

@github-actions
Copy link

Test Results

 37 files   37 suites   11s ⏱️
150 tests 150 ✅ 0 💤 0 ❌
151 runs  151 ✅ 0 💤 0 ❌

Results for commit c55116b.

@david-parkk david-parkk merged commit fdf7efe into develop Dec 19, 2025
4 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.

북마크 API 버그 수정

3 participants