-
Notifications
You must be signed in to change notification settings - Fork 3
refactor : refreshToken 인식 문제 해결 #113
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
Conversation
Walkthrough토큰 리프레시 엔드포인트의 시큐리티 요구 사항 어노테이션이 "JWT_REFRESH"에서 "Authorization"으로 변경되었습니다. 또한, 리프레시 토큰을 추출하는 HTTP 헤더도 "JWT_REFRESH"에서 "Authorization"으로 변경되었습니다. 토큰 추출 로직은 동일하게 유지됩니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AuthController
participant HttpServletRequest
Client->>AuthController: POST /refresh (Authorization: Bearer <refresh_token>)
AuthController->>HttpServletRequest: getHeader("Authorization")
AuthController->>AuthController: "Bearer " 접두사 제거 및 검증
AuthController-->>Client: 새 토큰 또는 오류 반환
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/org/ezcode/codetest/presentation/usermanagement/AuthController.java (1)
82-82: 디버그 로그를 제거하는 것을 고려해보세요.리프레시 토큰 정보를 로그로 출력하는 것은 보안상 위험할 수 있으며, PR 체크리스트에서도 불필요한 console.log 제거를 언급했습니다.
- log.info("Refresh token 추출 : {}", token);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/org/ezcode/codetest/presentation/usermanagement/AuthController.java(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/main/java/org/ezcode/codetest/presentation/usermanagement/AuthController.java (1)
Learnt from: NCookies
PR: ezcode-my/backend#17
File: src/main/java/org/ezcode/codetest/presentation/problemmanagement/ProblemAdminController.java:25-25
Timestamp: 2025-06-02T06:57:37.929Z
Learning: 이 프로젝트에서는 아직 Spring Security가 적용되지 않아서 @PreAuthorize 어노테이션이 주석 처리되어 있음. Spring Security 도입 전까지는 권한 검증 어노테이션들이 비활성화 상태임.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (2)
src/main/java/org/ezcode/codetest/presentation/usermanagement/AuthController.java (2)
73-73: Swagger 보안 요구사항 변경이 올바르게 적용되었습니다.
JWT_REFRESH에서Authorization으로 변경한 것은 표준 OAuth2/JWT 관례를 따르는 좋은 개선사항입니다.
78-78: 헤더 추출 로직이 Swagger 어노테이션과 일치하도록 올바르게 변경되었습니다.Authorization 헤더를 사용하는 것은 로그아웃 메서드(65-67라인)와 일관성을 유지하며 표준 관례를 따릅니다. 다만 기존 클라이언트에서
JWT_REFRESH헤더를 사용하고 있었다면 breaking change가 될 수 있으니 확인이 필요합니다.다음 스크립트를 실행하여 기존 클라이언트 코드에서
JWT_REFRESH헤더 사용을 확인해주세요:#!/bin/bash # 설명: JWT_REFRESH 헤더를 사용하는 클라이언트 코드가 있는지 확인 # 예상 결과: 클라이언트 코드에서 JWT_REFRESH 사용 여부 확인 # 테스트: 프로젝트 전체에서 JWT_REFRESH 사용 검색 rg -i "jwt_refresh" --type js --type ts --type java
작업 내용
트러블 슈팅
해결해야 할 문제
코드 리뷰 전 확인 체크리스트
type :)Summary by CodeRabbit