feat(admin): 관리자 컨트롤러에 권한 검증 추가 - #221
Conversation
`AdminController`의 엔드포인트에 인증 및 권한(`ADMIN_READ`, `ADMIN_WRITE`) 검증 로직을 추가하여 무단 접근을 방지하도록 개선하였습니다. - `TenantPermissions`에 `ADMIN_READ` 및 `ADMIN_WRITE` 권한 상수 추가 - `AdminController` 생성자에 `TenantAccessService` 주입 - 각 엔드포인트에 `TenantAccessService.require()` 호출 추가 - `AdminControllerTest`에 인증 서비스 Mock 및 검증 로직 추가
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
AdminController의 관리자 전용 엔드포인트에 권한 검증을 추가해, 무단 접근을 차단하도록 보완하는 PR입니다. 기존 TenantAccessService/헤더 기반 권한 모델을 Admin API에도 동일하게 적용하는 변경으로 보입니다.
Changes:
TenantPermissions에ADMIN_READ,ADMIN_WRITE권한 상수 추가AdminController에TenantAccessService주입 및 각 엔드포인트에서 권한 검증 호출 추가AdminControllerTest에서TenantAccessServicemock 주입 및 권한 검증 흐름을 반영
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/java/com/clearfolio/viewer/controller/AdminController.java | Admin API에 권한 검증 로직 추가 및 의존성 주입 반영 |
| src/test/java/com/clearfolio/viewer/controller/AdminControllerTest.java | AdminController 변경에 맞춰 TenantAccessService mock 주입/스텁 추가 |
| src/main/java/com/clearfolio/viewer/auth/TenantPermissions.java | 관리자 권한 상수(ADMIN_READ, ADMIN_WRITE) 추가 |
| commit_message.txt | 커밋 메시지 업데이트 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tenantAccessService.require(headers, TenantPermissions.ADMIN_WRITE); | ||
| RetryDeadLetterResult result = conversionService.retryDeadLettered(jobId, "admin"); |
| /** | ||
| * Creates a controller for admin operations. | ||
| * | ||
| * @param conversionService conversion service | ||
| */ |
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.springframework.http.HttpHeaders; | ||
| import com.clearfolio.viewer.auth.TenantAccessService; |
Superseded by #172. Both implement the same admin endpoint authorization contract; #172 is retained as the canonical branch because its exact head has passed CI, security, SAST, and fuzz checks.