Skip to content

[feature] 민감한 Endpoint 접근 권한 상승#1199

Merged
lepitaaar merged 1 commit intodevelop/befrom
feature/#1198-add-developer-permission-endpoint-MOA-651
Feb 15, 2026
Merged

[feature] 민감한 Endpoint 접근 권한 상승#1199
lepitaaar merged 1 commit intodevelop/befrom
feature/#1198-add-developer-permission-endpoint-MOA-651

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Feb 15, 2026

#️⃣연관된 이슈

📝작업 내용

  • POST /api/promotion 접근 권한을 isAuthenticated()에서 hasRole('DEVELOPER')로 강화했습니다.
  • POST /auth/user/register@PreAuthorize("hasRole('DEVELOPER')")를 추가했습니다.
  • POST /auth/user/reset@PreAuthorize("hasRole('DEVELOPER')")를 추가했습니다.
  • 위 2개 유저 API에 @SecurityRequirement(name = "BearerAuth")를 추가해 인증 요구사항을 명시했습니다.
  • 권한 제어 위치를 엔드포인트별 어노테이션 기준으로 정리했습니다.

중점적으로 리뷰받고 싶은 부분(선택)

논의하고 싶은 부분(선택)

🫡 참고사항

Summary by CodeRabbit

변경 사항

  • 보안
    • 프로모션 게시물 작성 엔드포인트의 접근 권한이 변경되었습니다.
    • 사용자 등록 및 초기화 엔드포인트의 접근 권한이 강화되었습니다.

@lepitaaar lepitaaar self-assigned this Feb 15, 2026
@lepitaaar lepitaaar added ✨ Feature 기능 개발 💾 BE Backend labels Feb 15, 2026
@vercel
Copy link

vercel bot commented Feb 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 15, 2026 6:10am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

두 개의 컨트롤러에서 민감한 엔드포인트에 대한 접근 권한을 변경합니다. PromotionArticleController의 프로모션 아티클 생성 엔드포인트는 인증 사용자에서 DEVELOPER 역할로 제한되며, UserController의 사용자 등록 및 초기화 엔드포인트도 DEVELOPER 역할 권한 확인이 추가됩니다.

Changes

Cohort / File(s) Summary
PromotionArticleController Authorization
backend/src/main/java/moadong/club/controller/PromotionArticleController.java
POST /api/promotion 엔드포인트의 접근 권한을 isAuthenticated()에서 hasRole('DEVELOPER')로 변경하여 DEVELOPER 역할만 프로모션 아티클을 생성할 수 있도록 제한합니다.
UserController Authorization & Security
backend/src/main/java/moadong/user/controller/UserController.java
registerUser 및 reset 엔드포인트에 @PreAuthorize("hasRole('DEVELOPER')")@SecurityRequirement("BearerAuth") 어노테이션을 추가하여 DEVELOPER 역할 인증 및 Bearer 토큰 보안 요구사항을 명시합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

📬 API

Suggested reviewers

  • Zepelown
  • oesnuj
  • seongwon030
🚥 Pre-merge checks | ✅ 4 | ❌ 2
❌ Failed checks (2 warnings)
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.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 민감한 Endpoint의 접근 권한을 상승시키는 변경사항을 명확하게 설명하며, 코드 변경 내용과 일치합니다.
Linked Issues check ✅ Passed PR은 연관 이슈 MOA-651의 목적인 민감한 Endpoint(auth/register, auth/user/reset, promotion)에 DEVELOPER 역할 권한 추가를 모두 구현했습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 MOA-651의 권한 강화 요구사항 범위 내에 있으며, 범위를 벗어난 변경은 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feature/#1198-add-developer-permission-endpoint-MOA-651
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feature/#1198-add-developer-permission-endpoint-MOA-651
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

72 tests   72 ✅  17s ⏱️
14 suites   0 💤
14 files     0 ❌

Results for commit c9663db.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/src/main/java/moadong/club/controller/PromotionArticleController.java (1)

35-43: ⚠️ Potential issue | 🟠 Major

홍보 게시글 생성 권한을 hasRole('DEVELOPER')에서 hasRole('CLUB_ADMIN')으로 변경 필요.

CLUB_ADMIN은 시스템의 기본 역할이며 실제로 동아리 관리 기능에 사용되는 역할입니다. 현재 구현에서는 CLUB_ADMIN 권한을 가진 동아리 관리자들이 홍보 게시글을 생성할 수 없으므로, 의도된 동작이 아니라면 권한 설정을 수정해야 합니다.

DEVELOPER 역할은 시스템 레벨의 관리자 기능(예: /api/admin/** 엔드포인트)에만 제한하고, 동아리 운영 기능인 홍보 게시글 생성은 CLUB_ADMIN으로 변경하시기 바랍니다.

@lepitaaar lepitaaar merged commit 28d4895 into develop/be Feb 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants