BUG/15 회원가입 외 User 서비스 public path 해제 - #16
Conversation
- GatewayExceptionHandler 작성 - 서비스 공통모듈과 같은 형태 적용
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough새로운 중앙 에러 처리 인프라가 추가되었습니다: Changes중앙집중형 에러 처리 및 인증 리팩터
시퀀스 다이어그램sequenceDiagram
actor Client
participant AuthFilter as AuthenticationFilter
participant Handler as GatewayExceptionHandler
participant Spring as Spring Framework
participant Response
Client->>AuthFilter: 요청 (예: /api/v1/users, Authorization: Bearer ...)
alt POST /api/v1/users (회원가입)
AuthFilter->>Spring: 인증 스킵, 요청 전달
Spring->>Response: 정상 처리
else 다른 경로
AuthFilter->>AuthFilter: 토큰 추출/검증
alt 토큰 유효
AuthFilter->>Spring: 헤더 추가 후 전달
Spring->>Response: 정상 처리
else 토큰 실패
AuthFilter->>Handler: BusinessException 발생
Handler->>Handler: ErrorCode 결정 및 ErrorResponse 생성
Handler->>Response: JSON 바디와 상태 코드 쓰기
Response->>Client: 에러 응답
end
end
코드 리뷰 난이도 평가🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
시
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Review rate limit: 8/10 reviews remaining, refill in 6 minutes and 8 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/java/com/pagely/gateway/infrastructure/exception/GatewayExceptionHandler.java`:
- Around line 65-70: determineErrorCode currently maps every
non-BusinessException to CommonErrorCode.INTERNAL_SERVER_ERROR causing WebFlux
4xx/404 statuses to be lost; update determineErrorCode to detect WebFlux
exceptions (e.g., ResponseStatusException, ServerWebInputException,
WebExchangeBindException) and return appropriate ErrorCode values (map
ServerWebInputException and WebExchangeBindException to a BAD_REQUEST/ErrorCode
matching 400, and for ResponseStatusException derive the ErrorCode from the
exception's status), falling back to CommonErrorCode.INTERNAL_SERVER_ERROR
otherwise; reference determineErrorCode, BusinessException,
ResponseStatusException, ServerWebInputException, WebExchangeBindException and
CommonErrorCode in your change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b050805c-2ee1-4cde-8a16-935637ba1682
📒 Files selected for processing (9)
src/main/java/com/pagely/gateway/domain/exception/BusinessException.javasrc/main/java/com/pagely/gateway/domain/exception/CommonErrorCode.javasrc/main/java/com/pagely/gateway/domain/exception/ErrorCode.javasrc/main/java/com/pagely/gateway/domain/exception/ErrorResponse.javasrc/main/java/com/pagely/gateway/domain/exception/GatewayErrorCode.javasrc/main/java/com/pagely/gateway/infrastructure/config/ErrorConfig.javasrc/main/java/com/pagely/gateway/infrastructure/exception/GatewayExceptionHandler.javasrc/main/java/com/pagely/gateway/infrastructure/security/AuthenticationFilter.javasrc/main/resources/application.yml
💤 Files with no reviewable changes (1)
- src/main/resources/application.yml
|
브렌치 네이밍 |
📝 작업 내용
[BUG] 회원가입 외 User 서비스 public path 해제
회원가입에서만 JWT 검증 필터를 건너뛰도록 public 경로를 설정해야했는데,
/api/v1/users가 public path로 등록되어있었음.
POST /users 요청에 한해서만 검증 처리 하지 않도록 Filter 화이트리스트 설정
에러 응답을 공통 모듈과 같은 형태로 수정
🚀 주요 변경 사항
✅ 자체 체크리스트 (필수)
./gradlew build실행 결과 정상 (인증샷 첨부)📸 테스트 인증샷
💬 리뷰어 전달사항 (선택)
📎 참고 자료
Summary by CodeRabbit
새로운 기능
개선사항
기타