Skip to content

[Docs] 권한 시스템 Swagger 수동 테스트 결과 작성 (#16 #18 #21 #24 #29) - #34

Merged
kangcheolung merged 3 commits into
developfrom
test/32
Jul 17, 2026
Merged

[Docs] 권한 시스템 Swagger 수동 테스트 결과 작성 (#16 #18 #21 #24 #29)#34
kangcheolung merged 3 commits into
developfrom
test/32

Conversation

@kangcheolung

@kangcheolung kangcheolung commented Jul 17, 2026

Copy link
Copy Markdown
Member

🔍 작업 내용

✨ 상세 설명

이슈 #16 · #18 · #21 · #24 · #29에서 구현한 권한 시스템 전체를 Swagger에서 수동 테스트하고 결과를 문서로 작성했다.

테스트 계정: A(userId=2, 소유자·권한 부여자) / B(userId=3, test1)

검증한 시나리오 (Phase 1~11):

  • OWNER → sources: ["OWNER"], canRead·Write·Admin 모두 true
  • PUBLIC → canRead만 true, sources: ["PUBLIC"]
  • USER 직접 권한 부여 → user_document_access_cache 즉시 생성, sources: ["USER_CACHE"]
  • 컬렉션 ROLE 권한 부여 → sources: ["USER_CACHE", "ROLE"] 두 경로 동시 수집
  • USER 직접 권한 회수 후 ROLE 경로 유지 → sources: ["ROLE"]
  • 컬렉션에서 문서 제거 → ROLE 경로 차단, sources: []
  • 컬렉션 삭제 → soft delete(status=DELETED), 목록에서 제외
  • 중복 문서 추가 → 409

각 시나리오별 요청/응답 JSON과 서버 [PERM] 타이밍 로그를 문서에 포함했다.

🛠 추후 리팩토링 및 고도화 계획

  • DEPARTMENT 경로 시나리오 추가 (현재 ROLE까지만 검증)
  • ./gradlew test 자동 테스트를 별도 이슈로 분리해서 작성

📸 스크린샷 (선택)

💬 리뷰 요구사항

  • sources 수집 순서(USER_CACHE → ROLE → DEPARTMENT)가 의도한 대로 동작하는지 확인 부탁드립니다.
  • 컬렉션 삭제 시 collection_permissions 행이 삭제되고 soft delete가 정상 처리되는 DB 상태를 문서에서 확인해주세요.

Summary by CodeRabbit

  • 문서화
    • 권한 시스템 Swagger 수동 테스트 결과를 문서화했습니다.
    • 문서·컬렉션 권한, 권한 회수, 문서 제거 및 컬렉션 삭제 동작을 요청·응답 사례와 함께 정리했습니다.
    • 중복 문서 추가 시 오류 응답과 테스트 완료 기준을 기록했습니다.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 49 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ac3811e4-db72-4caf-955b-1862adef749c

📥 Commits

Reviewing files that changed from the base of the PR and between 572c256 and 7405cd9.

📒 Files selected for processing (1)
  • docs/test-results/chelung-#21-permission-query-service.md
📝 Walkthrough

Walkthrough

Swagger를 사용한 권한 API 수동 테스트 결과 문서를 추가했다. OWNER, PUBLIC, USER_CACHE, ROLE 권한 경로와 캐시 무효화, 문서 중복 추가, 컬렉션 soft delete 및 목록 제외 결과를 시나리오별로 기록한다.

Changes

권한 API 수동 검증

Layer / File(s) Summary
테스트 범위와 기본 권한 검증
docs/test-results/chelung-#21-permission-query-service.md
테스트 환경과 데이터를 정의하고 OWNER, PUBLIC, USER 직접 권한에 대한 /me 응답, 캐시 생성, sources 결과를 기록한다.
컬렉션 ROLE 및 캐시 경로 검증
docs/test-results/chelung-#21-permission-query-service.md
중복 문서 추가 시 409 응답과 컬렉션 ROLE 권한의 sources 수집, USER 권한 회수 후 ROLE 유지 결과를 정리한다.
접근 차단과 삭제 결과 정리
docs/test-results/chelung-#21-permission-query-service.md
문서 제거 후 접근 차단, 컬렉션 soft delete와 목록 제외 결과, 완료 기준 및 자동 테스트의 별도 진행 계획을 기록한다.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 필수 범위인 비소유자 403 검증과 ROLE live predicate 부여·조회·회수 시나리오가 문서 요약에 보이지 않아 #32 요구를 모두 충족하지 못합니다. 비소유자 접근 제한과 ROLE live predicate의 실제 요청·응답 및 타이밍 로그를 추가해 #32의 Phase 6~7을 보완하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 변경이 문서 1건 추가에 한정되어 있으며, 링크된 권한 테스트 목적과 벗어난 내용은 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 제목이 권한 시스템 Swagger 수동 테스트 문서화라는 핵심 변경을 명확히 요약합니다.
Description check ✅ Passed 템플릿의 필수 섹션들이 모두 포함되어 있고, 작업 내용·상세 설명·추후 계획·리뷰 요구사항도 구체적입니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/32

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: 3

🧹 Nitpick comments (1)
docs/test-results/chelung-#21-permission-query-service.md (1)

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

fenced code block에 언어 식별자를 추가해 주세요.

Markdownlint MD040 경고를 해소하려면 로그와 DB 결과 블록의 여는 fence를 모두 ```text로 변경해 주세요.

Also applies to: 105-105, 186-186, 282-282, 319-319, 356-356, 396-396

🤖 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 `@docs/test-results/chelung-`#21-permission-query-service.md at line 72, 문서의 모든
로그 및 DB 결과 fenced code block에 언어 식별자가 누락되어 있습니다. 지정된 fenced code block의 여는
fence를 모두 ```text 형식으로 변경해 Markdownlint MD040 경고를 해결하고, 블록 내용은 그대로 유지하세요.

Source: Linters/SAST tools

🤖 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 `@docs/test-results/chelung-`#21-permission-query-service.md:
- Line 12: 검증되지 않은 DEPARTMENT 결과를 문서의 완료 범위에서 제거하세요. 실제 DEPARTMENT 요청·응답·로그
시나리오를 추가하지 않는 경우, 해당 문장의 ROLE/DEPT 표현과 `/DEPT` 관련 주장을 ROLE만 다루도록 수정하고 ROLE 경로 차단
결과만 유지하세요.
- Around line 364-400: 컬렉션 삭제 검증 절차에 캐시 일괄 무효화 증거를 추가하세요. DELETE 이후 사용자 B로
`/permissions/documents/{documentId}/me`를 호출한 응답과 `user_document_access_cache`에서
해당 캐시가 무효화된 결과를 기록하고, 이를 확인하지 못했다면 캐시 검증이 미완료임을 명시하세요.
- Line 8: Update the PUBLIC behavior statement in the test-results document to
explicitly scope it to accounts without additional USER_CACHE, ROLE, or
DEPARTMENT permissions, such as account B. State that only under this condition
canRead is true while canWrite and canAdmin are false; do not claim this
universally for all PUBLIC users.

---

Nitpick comments:
In `@docs/test-results/chelung-`#21-permission-query-service.md:
- Line 72: 문서의 모든 로그 및 DB 결과 fenced code block에 언어 식별자가 누락되어 있습니다. 지정된 fenced
code block의 여는 fence를 모두 ```text 형식으로 변경해 Markdownlint MD040 경고를 해결하고, 블록 내용은
그대로 유지하세요.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cd65974-20b3-4738-8be0-f27fefaaf51c

📥 Commits

Reviewing files that changed from the base of the PR and between ff042d7 and 572c256.

📒 Files selected for processing (1)
  • docs/test-results/chelung-#21-permission-query-service.md

Comment thread docs/test-results/chelung-#21-permission-query-service.md Outdated
Comment thread docs/test-results/chelung-#21-permission-query-service.md Outdated
Comment on lines +364 to +400
### 4.8 컬렉션 삭제 (soft delete) 확인

문서1을 컬렉션1에 다시 추가한 뒤 컬렉션을 삭제한다.

```http
POST /collections/1/documents
Authorization: Bearer {A token}
```

```json
{
"success": true,
"status": 201,
"data": {
"collectionId": 1,
"documentId": 1,
"addedBy": 2,
"addedAt": "2026-07-17T17:24:25.353756"
},
"timestamp": "2026-07-17 17:24:25"
}
```

```http
DELETE /collections/1
Authorization: Bearer {A token}
```

응답: `204 No Content`

DB 확인:

```
collections: id=1, status=DELETED, deleted_at=2026-07-17 17:24:59.612
```

컬렉션 레코드는 삭제되지 않고 status와 deleted_at만 변경됐다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

컬렉션 삭제 후 캐시 일괄 무효화 증거를 추가해야 합니다.

현재 절은 soft delete와 목록 제외만 확인합니다. PR 목표에 포함된 캐시 일괄 무효화를 입증하려면 삭제 후 B의 /permissions/documents/{documentId}/me 응답과 user_document_access_cache의 무효화 결과를 함께 기록해야 합니다. 그렇지 않으면 캐시 검증은 미완료로 명시해 주세요.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 396-396: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 `@docs/test-results/chelung-`#21-permission-query-service.md around lines 364 -
400, 컬렉션 삭제 검증 절차에 캐시 일괄 무효화 증거를 추가하세요. DELETE 이후 사용자 B로
`/permissions/documents/{documentId}/me`를 호출한 응답과 `user_document_access_cache`에서
해당 캐시가 무효화된 결과를 기록하고, 이를 확인하지 못했다면 캐시 검증이 미완료임을 명시하세요.

@kangcheolung
kangcheolung merged commit c471395 into develop Jul 17, 2026
1 check was pending
@kangcheolung kangcheolung added 📃 Docs 문서 작업 🧪 Test 테스트 labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📃 Docs 문서 작업 🧪 Test 테스트

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Test] 권한 API 통합 테스트

1 participant