[Feat]: 경로 변수 및 요청 파라미터 유효성 검사#25
Merged
Merged
Conversation
- UserController: username 경로 변수에 GitHub 사용자명 패턴 검증 추가 - RankingController: page 파라미터에 최소값 검증 추가 - GlobalExceptionHandler: ConstraintViolationException 처리 추가
Closed
📝 WalkthroughWalkthrough컨트롤러 메서드 파라미터에 Bean Validation 애노테이션을 추가하고( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/java/com/gitranker/api/domain/user/UserController.java`:
- Around line 24-42: Update the USERNAME_PATTERN constant to enforce GitHub
rules by forbidding consecutive hyphens and ensuring hyphens only appear between
alphanumeric characters while still enforcing the 1–39 character limit; replace
the current pattern value in the USERNAME_PATTERN constant used by getUser and
refreshUser with a regex that uses a negative lookahead to disallow "--",
asserts total length 1–39, and matches one or more alphanumerics optionally
separated by single hyphens (so hyphens cannot start/end or be adjacent).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 개요
API 안정성과 보안 강화를 위해 입력값 검증을 추가했습니다. GitHub 사용자명 패턴 검증으로 잘못된 요청을 조기에 차단하고, 명확한 에러 메시지를 제공합니다.
🔗 관련 이슈
🛠 작업 내용
UserController 검증 추가
RankingController 검증 추가
GlobalExceptionHandler 개선
Summary by CodeRabbit
Bug Fixes
New Features
✏️ Tip: You can customize this high-level summary in your review settings.