Skip to content

feat: 게스트 공유링크 소유 검증 - #94

Merged
Kohseoyoung merged 2 commits into
developfrom
feature/85-guest-verification
Aug 2, 2026
Merged

feat: 게스트 공유링크 소유 검증#94
Kohseoyoung merged 2 commits into
developfrom
feature/85-guest-verification

Conversation

@Kohseoyoung

@Kohseoyoung Kohseoyoung commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🔗 관련 이슈 (Related Issue)

📝 작업 내용

  • 게스트가 자신의 공유링크에 속한 영상에만 접근하도록 소유 검증 추가
    • Guest → ShareLink → Video 체인으로 영상 일치 여부 확인
    • 링크 유효성(활성/미만료)도 함께 검증 (isUsable())
  • 피드백/답글 작성·수정·삭제·조회의 게스트 경로에 검증 적용
  • #75에서 닫아둔 피드백/답글 조회(GET) permitAll 재개방 (검증과 함께)
  • ShareLinkErrorCodeGUEST_ACCESS_DENIED(403) 추가
  • 답글 API Swagger 태그명 변경 (Reply → Feedback Reply)

변경 파일

  • FeedbackService, FeedbackDetailService
  • FeedbackController, FeedbackDetailController
  • SecurityConfig
  • ShareLinkErrorCode

테스트 완료 (로컬 Swagger)

  • 게스트 자기 영상 작성/조회 → 201/200
  • 게스트 다른 영상 접근 → 403 (SHARELINK403)
  • 답글 status 토큰 없이 → 401 (멤버 전용 유지)
  • 회원 작성/조회 → 201/200

✅ PR 체크리스트

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 변경 사항에 대한 테스트를 진행했습니다.

Summary by CodeRabbit

  • 새 기능

    • 비회원도 공유 링크를 통해 피드백과 답글을 조회할 수 있습니다.
    • 로그인 사용자와 비회원 정보를 구분해 피드백·답글 목록을 조회합니다.
    • 피드백 및 답글 작성, 수정, 삭제 시 공유 링크 권한을 확인합니다.
  • 버그 수정

    • 만료되었거나 비활성화된 공유 링크, 다른 영상의 링크를 통한 접근을 차단합니다.
    • 권한이 없는 비회원에게 명확한 접근 거부 오류를 제공합니다.

@Kohseoyoung Kohseoyoung self-assigned this Jul 31, 2026
@Kohseoyoung Kohseoyoung added the feature 새로운 기능 추가 label Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0caf3422-d30f-40cb-8581-55cd85e7fa4d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

게스트 ID와 사용자 ID를 피드백·답글 조회 API에 전달합니다. 서비스는 공유 링크의 활성·만료 상태와 영상 일치 여부를 검증합니다. 게스트 접근 거부 오류와 조회용 permitAll() 경로를 추가합니다.

Changes

게스트 접근 검증

Layer / File(s) Summary
조회 API 및 접근 오류 계약
src/main/java/com/slatto/domain/feedback/controller/*, src/main/java/com/slatto/domain/sharelink/exception/ShareLinkErrorCode.java, src/main/java/com/slatto/global/config/SecurityConfig.java
피드백과 답글 목록 API가 userId, guestId를 서비스에 전달합니다. GUEST_ACCESS_DENIED 오류와 게스트 조회 GET 허용 경로를 추가합니다.
피드백 게스트 검증
src/main/java/com/slatto/domain/feedback/service/FeedbackService.java
피드백 생성·수정·삭제·목록 조회 전에 게스트의 공유 링크 상태와 영상 일치 여부를 검증합니다.
답글 게스트 검증
src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java
답글 조회·수정·삭제 전에 피드백 영상에 대한 게스트 접근 권한을 검증합니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant Guest
  participant FeedbackController
  participant FeedbackService
  participant ShareLink
  Guest->>FeedbackController: guestId와 videoId로 조회 요청
  FeedbackController->>FeedbackService: userId, guestId, videoId 전달
  FeedbackService->>ShareLink: 공유 링크 조회
  ShareLink-->>FeedbackService: 활성 상태와 연결된 Video 반환
  FeedbackService-->>FeedbackController: 피드백 목록 반환
Loading

Possibly related PRs

  • SLAT-TO/SLAT-TO-BE#60: 피드백 및 답글 컨트롤러·서비스 목록 API의 기반 변경과 직접 연결됩니다.
  • SLAT-TO/SLAT-TO-BE#72: ShareLink 게스트 접근 모델과 ShareLinkErrorCode를 기반으로 합니다.
  • SLAT-TO/SLAT-TO-BE#84: 피드백·답글 API의 사용자/게스트 식별과 보안 규칙을 함께 변경합니다.

Suggested reviewers: guingguing, sangwon02, chazy-d

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경사항인 게스트 공유링크 소유 검증을 간결하게 설명하며 커밋 컨벤션을 따릅니다.
Description check ✅ Passed PR 설명은 관련 이슈, 작업 내용, 변경 파일, 테스트 완료 현황을 포함하여 템플릿의 모든 필수 요소를 충족합니다.
Linked Issues check ✅ Passed 코드 변경사항이 #85의 모든 요구사항을 충족합니다: 게스트 소유 검증 로직 추가, 피드백/답글 작성·수정·삭제·조회에 검증 적용, SecurityConfig 재개방, 테스트 완료.
Out of Scope Changes check ✅ Passed 모든 변경사항은 #85 요구사항과 관련됩니다. Swagger 태그명 변경과 오류 코드 추가는 검증 기능 구현을 지원하는 범위 내 변경입니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/main/java/com/slatto/domain/feedback/service/FeedbackService.java`:
- Around line 185-188: 익명 목록 조회 시 guestId 없이 접근하는 경로를 차단하십시오.
src/main/java/com/slatto/domain/feedback/service/FeedbackService.java 185-188의
userId 검증에서 guestId가 null이면 GUEST_ACCESS_DENIED를 발생시키고, guestId가 있으면
validateGuestAccess를 호출하십시오. 동일하게
src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java
112-115의 익명 접근 검증도 수정하십시오.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 69f499b2-b10f-43cb-90cf-5e5a3aaac481

📥 Commits

Reviewing files that changed from the base of the PR and between f6c3681 and ecea7aa.

📒 Files selected for processing (6)
  • src/main/java/com/slatto/domain/feedback/controller/FeedbackController.java
  • src/main/java/com/slatto/domain/feedback/controller/FeedbackDetailController.java
  • src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java
  • src/main/java/com/slatto/domain/feedback/service/FeedbackService.java
  • src/main/java/com/slatto/domain/sharelink/exception/ShareLinkErrorCode.java
  • src/main/java/com/slatto/global/config/SecurityConfig.java

Comment on lines +185 to +188
// 2. 게스트가 조회하는 경우 이 영상에 접근 자격이 있는지 검증
if (userId == null && guestId != null) {
validateGuestAccess(guestId, videoId);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

익명 목록 조회를 차단하십시오.

SecurityConfig는 두 GET 경로를 permitAll()로 엽니다. 현재 조건은 userIdguestId가 모두 null이면 검증을 건너뜁니다. 따라서 요청자는 guestId 없이 다른 영상의 피드백과 답글 목록을 조회할 수 있습니다.

userId == null이면 guestId가 반드시 존재하도록 확인하십시오. guestId가 없으면 GUEST_ACCESS_DENIED를 발생시키십시오.

  • src/main/java/com/slatto/domain/feedback/service/FeedbackService.java#L185-L188: guestId == null인 익명 요청을 거부한 후 validateGuestAccess를 호출하십시오.
  • src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java#L112-L115: guestId == null인 익명 요청을 거부한 후 validateGuestAccess를 호출하십시오.
수정 예시
- if (userId == null && guestId != null) {
-     validateGuestAccess(guestId, videoId);
+ if (userId == null) {
+     if (guestId == null) {
+         throw new BaseException(ShareLinkErrorCode.GUEST_ACCESS_DENIED);
+     }
+     validateGuestAccess(guestId, videoId);
  }
📍 Affects 2 files
  • src/main/java/com/slatto/domain/feedback/service/FeedbackService.java#L185-L188 (this comment)
  • src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java#L112-L115
🤖 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/main/java/com/slatto/domain/feedback/service/FeedbackService.java` around
lines 185 - 188, 익명 목록 조회 시 guestId 없이 접근하는 경로를 차단하십시오.
src/main/java/com/slatto/domain/feedback/service/FeedbackService.java 185-188의
userId 검증에서 guestId가 null이면 GUEST_ACCESS_DENIED를 발생시키고, guestId가 있으면
validateGuestAccess를 호출하십시오. 동일하게
src/main/java/com/slatto/domain/feedback/service/FeedbackDetailService.java
112-115의 익명 접근 검증도 수정하십시오.

@Kohseoyoung
Kohseoyoung merged commit 93055a1 into develop Aug 2, 2026
2 checks passed
@guingguing
guingguing deleted the feature/85-guest-verification branch August 11, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: 게스트 공유링크 소유 검증 (피드백/답글 접근 인가)

3 participants