Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: V2 API 접근 권한 설정 추가 #881

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Feb 9, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 신규 기능
    • 관리자 스터디 API 엔드포인트가 업데이트되어, 이제 "/v2/admin/studies" 경로를 사용합니다.
    • 관리자 및 멘토 API에 대한 접근 제어 규칙이 확장되어, 기존 경로와 함께 신규 경로에도 동일한 역할 기반 인증이 적용됩니다.

@Sangwook02 Sangwook02 self-assigned this Feb 9, 2025
@Sangwook02 Sangwook02 requested a review from a team as a code owner February 9, 2025 11:14
Copy link

coderabbitai bot commented Feb 9, 2025

Walkthrough

이번 PR에서는 API 엔드포인트의 URL 구조를 변경하는 작업이 이루어졌습니다. AdminStudyControllerV2의 기본 요청 매핑 경로가 "/admin/studies/v2"에서 "/v2/admin/studies"로 업데이트되었으며, 이에 따라 WebSecurityConfig 클래스에서 보안 인증을 위한 요청 매처에도 "/v2/admin/"와 "/v2/mentor/" 경로가 추가되었습니다.

Changes

파일 변경 요약
src/main/java/com/gdschongik/.../AdminStudyControllerV2.java @RequestMapping 경로가 "/admin/studies/v2"에서 "/v2/admin/studies"로 변경됨
src/main/java/com/gdschongik/.../WebSecurityConfig.java /admin/**/mentor/** 경로에 대해 "/v2/admin/"와 "/v2/mentor/"가 추가되어 보안 정책 적용

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant WS as WebSecurityConfig
    participant ASC as AdminStudyControllerV2

    C->>WS: GET /v2/admin/studies
    WS->>C: Role 인증 검사 (ADMIN)
    C->>ASC: 요청 전달
    ASC-->>C: 응답 반환
Loading

Possibly related issues

Possibly related PRs

Suggested labels

✨ feature

Suggested reviewers

  • seulgi99
  • AlmondBreez3
  • uwoobeat

Poem

깡총깡총 뛰며 노래하는 나, 작은 토끼야
새로운 경로가 열리는 그 길 위에
"/v2/admin/studies"의 빛이 비추네
보안도 함께 맞춘 변화를 축하하며
오늘도 API의 봄을 만끽하네 🐰


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b56893d and 9aa4982.

📒 Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/api/AdminStudyControllerV2.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/global/config/WebSecurityConfig.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/api/AdminStudyControllerV2.java
🔇 Additional comments (2)
src/main/java/com/gdschongik/gdsc/global/config/WebSecurityConfig.java (2)

123-124: ADMIN 역할에 대한 V2 API 권한 설정이 적절히 구현되었습니다.

새로운 V2 API 경로에 대한 관리자 권한 설정이 기존 보안 정책과 일관성있게 적용되었습니다.


125-126: MENTOR와 ADMIN 역할에 대한 V2 API 권한 설정이 적절히 구현되었습니다.

새로운 V2 API 경로에 대한 멘토 권한 설정이 기존의 역할 계층 구조를 올바르게 유지하면서 구현되었습니다.

추가로 권한 설정의 일관성을 검증하기 위해 다음 스크립트를 실행해보시기 바랍니다:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: V2 API 엔드포인트에 대한 권한 설정의 일관성 검증

# 컨트롤러에서 V2 API 엔드포인트 사용 확인
rg -l "RequestMapping.*v2" "src/main/java"

# Security 설정에서 V2 경로에 대한 권한 설정 확인
rg "requestMatchers.*v2" "src/main/java"

Length of output: 432


멘토 및 ADMIN 역할의 V2 API 권한 설정이 올바르게 구현되었습니다.

검증 결과:

  • 기존의 "/mentor/"와 동일한 패턴으로 "/v2/mentor/"가 추가되어 역할 설정이 일관되게 적용되었습니다.
  • 관리자 경로인 "/admin/"와 "/v2/admin/" 역시 동일한 방식으로 처리되어, 전체 보안 설정에서의 패턴이 통일되어 있습니다.

따라서 변경된 멘토 권한 설정은 승인해도 무방합니다.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Sangwook02 Sangwook02 changed the title feat: V2 API 권한 설정 추가 feat: V2 API 접근 권한 설정 추가 Feb 9, 2025
Copy link

github-actions bot commented Feb 9, 2025

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

@Sangwook02 Sangwook02 merged commit 39dd7c3 into develop Feb 9, 2025
1 check passed
@Sangwook02 Sangwook02 deleted the feature/880-v2-api-security-config branch February 9, 2025 11:34
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.

✨ V2 API 접근 권한 설정 추가
2 participants