Skip to content

[chore] Token 관련 로직을 Auth 폴더로 분리#82

Merged
KiSeungMin merged 1 commit into
developfrom
feature/seungmin
Jul 29, 2025
Merged

[chore] Token 관련 로직을 Auth 폴더로 분리#82
KiSeungMin merged 1 commit into
developfrom
feature/seungmin

Conversation

@KiSeungMin

@KiSeungMin KiSeungMin commented Jul 29, 2025

Copy link
Copy Markdown
Member

✔️ 연관 이슈

📝 작업 내용

  • 다음 로직을 Auth 폴더로 분리했습니다.
    • 토큰 관련 로직
    • login, logout 로직
  • 인증 로직의 엔드포인트를 /api/v1/auth로 변경했습니다.

스크린샷 (선택)

Summary by CodeRabbit

  • 신규 기능

    • 인증 및 토큰 관리를 위한 별도의 인증 API 엔드포인트(/api/v1/auth/*)가 추가되었습니다. (이메일/비밀번호 로그인, 카카오 로그인, 토큰 재발급, 로그아웃 제공)
  • 버그 수정

    • 인증 관련 엔드포인트가 기존 사용자 API에서 분리되어, 인증 요청이 보다 명확하게 처리됩니다.
  • 기타

    • 인증 관련 엔드포인트가 별도의 경로로 이동함에 따라, 기존 사용자 API의 로그인, 토큰 재발급, 로그아웃 엔드포인트가 제거되었습니다.
    • 인증 엔드포인트가 인증 없이 접근 가능한 공개 API로 설정되었습니다.

@KiSeungMin KiSeungMin requested a review from seung-in-Yoo July 29, 2025 14:34
@KiSeungMin KiSeungMin self-assigned this Jul 29, 2025
@KiSeungMin KiSeungMin added the ⚙️ chore 패키지 매니저 및 기타 수정 label Jul 29, 2025
@coderabbitai

coderabbitai Bot commented Jul 29, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@KiSeungMin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 11 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f7c8e3a and 7c45db1.

📒 Files selected for processing (9)
  • src/main/java/com/wayble/server/auth/controller/AuthController.java (1 hunks)
  • src/main/java/com/wayble/server/auth/dto/TokenResponseDto.java (1 hunks)
  • src/main/java/com/wayble/server/auth/enttiy/RefreshToken.java (1 hunks)
  • src/main/java/com/wayble/server/auth/repository/RefreshTokenRepository.java (1 hunks)
  • src/main/java/com/wayble/server/auth/service/AuthService.java (1 hunks)
  • src/main/java/com/wayble/server/auth/service/KakaoLoginService.java (1 hunks)
  • src/main/java/com/wayble/server/common/config/SecurityConfig.java (1 hunks)
  • src/main/java/com/wayble/server/user/controller/KakaoLoginController.java (0 hunks)
  • src/main/java/com/wayble/server/user/controller/UserController.java (2 hunks)

Walkthrough

인증 관련 엔드포인트(로그인, 토큰 재발급, 로그아웃, 카카오 로그인)가 기존 UserControllerKakaoLoginController에서 분리되어 새로운 AuthController로 이동되었습니다. 이에 따라 관련 DTO, 엔티티, 레포지토리, 서비스의 패키지 경로도 auth 하위로 일원화되었으며, 시큐리티 설정에서 인증 엔드포인트 접근 허용 경로가 갱신되었습니다.

Changes

Cohort / File(s) Change Summary
AuthController 신설 및 인증 엔드포인트 이전
src/main/java/com/wayble/server/auth/controller/AuthController.java,
src/main/java/com/wayble/server/user/controller/UserController.java,
src/main/java/com/wayble/server/user/controller/KakaoLoginController.java
인증 관련 엔드포인트(기본 로그인, 카카오 로그인, 토큰 재발급, 로그아웃)를 새로운 AuthController로 이동. 기존 UserControllerKakaoLoginController에서 관련 메서드 및 클래스 삭제.
패키지 구조 리팩토링
src/main/java/com/wayble/server/auth/dto/TokenResponseDto.java,
src/main/java/com/wayble/server/auth/enttiy/RefreshToken.java,
src/main/java/com/wayble/server/auth/repository/RefreshTokenRepository.java,
src/main/java/com/wayble/server/auth/service/AuthService.java,
src/main/java/com/wayble/server/auth/service/KakaoLoginService.java
인증 관련 DTO, 엔티티, 레포지토리, 서비스의 패키지 경로를 user 하위에서 auth 하위로 변경. 코드 로직에는 영향 없음.
시큐리티 설정 갱신
src/main/java/com/wayble/server/common/config/SecurityConfig.java
/api/v1/auth/** 경로에 대한 인증 없이 접근 허용 설정 추가. 기존 인증 관련 엔드포인트와 동일하게 처리.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AuthController
    participant AuthService
    participant KakaoLoginService
    participant SecurityContext

    Client->>AuthController: POST /api/v1/auth/login/basic (이메일/비밀번호)
    AuthController->>AuthService: login(req)
    AuthService-->>AuthController: TokenResponseDto
    AuthController-->>Client: CommonResponse<TokenResponseDto>

    Client->>AuthController: POST /api/v1/auth/login/kakao (카카오 토큰)
    AuthController->>KakaoLoginService: kakaoLogin(request)
    KakaoLoginService-->>AuthController: KakaoLoginResponseDto
    AuthController-->>Client: CommonResponse<KakaoLoginResponseDto>

    Client->>AuthController: POST /api/v1/auth/reissue (refreshToken)
    AuthController->>AuthService: reissue(refreshToken)
    AuthService-->>AuthController: TokenResponseDto
    AuthController-->>Client: CommonResponse<TokenResponseDto>

    Client->>AuthController: POST /api/v1/auth/logout (Authorization 헤더)
    AuthController->>SecurityContext: 사용자 ID 추출
    AuthController->>AuthService: logout(userId)
    AuthService-->>AuthController: 성공 메시지
    AuthController-->>Client: CommonResponse<String>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇
인증의 길을 새롭게 열었네,
컨트롤러 옮겨 깔끔하게!
패키지 정리, 경로도 맞추고,
시큐리티 문도 살짝 열었지요.
로그인, 로그아웃, 토큰까지 척척!
토끼는 오늘도 코드에 껑충 뛰어요.
🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/seungmin

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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.

@KiSeungMin KiSeungMin merged commit 2c0a53c into develop Jul 29, 2025
1 check was pending

@seung-in-Yoo seung-in-Yoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

구조 변경 확인했습니다~~~ 감사합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ chore 패키지 매니저 및 기타 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants