Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 52 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough쿠키 기반 토큰 해석 기능을 추가했습니다. JwtProperties에 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
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
🧹 Nitpick comments (1)
src/test/java/com/dnd/moddo/domain/auth/service/JwtUtilTest.java (1)
13-52: 테스트 커버리지 보강 제안 (선택 사항)현재 2개 케이스로 핵심 우선순위 동작은 검증되지만, 다음 엣지 케이스를 추가하면 회귀 방지에 도움이 됩니다.
- 쿠키와 헤더가 모두 없을 때
null반환accessToken쿠키 값이 빈 문자열일 때의 동작(위JwtUtil코멘트의 정책 확정 후)- 다른 이름의 쿠키만 존재할 때 헤더로 fallback되는지
- 헤더가
Bearerprefix 없이 전달되었을 때null반환또한 패키지 경로(
com.dnd.moddo.domain.auth.service)와 테스트 대상 클래스의 실제 패키지(com.dnd.moddo.auth.infrastructure.security)가 일치하지 않는데, 프로젝트의 다른 테스트 클래스들과 위치 규칙이 맞는지 확인해 주세요.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/java/com/dnd/moddo/domain/auth/service/JwtUtilTest.java` around lines 13 - 52, Add edge-case unit tests to JwtUtilTest targeting JwtUtil.resolveToken: add tests for (1) request with neither cookie nor Authorization header returns null, (2) accessToken cookie present but empty string behavior (assert null or defined policy), (3) only a differently-named cookie exists and Authorization header is used as fallback, and (4) Authorization header without the "Bearer " prefix returns null; also ensure the test class package matches the JwtUtil implementation package (com.dnd.moddo.auth.infrastructure.security) or move the test to the canonical test package to match project conventions.
🤖 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/dnd/moddo/auth/infrastructure/security/JwtUtil.java`:
- Around line 22-45: resolveTokenFromCookie currently returns cookie values even
when they are empty or whitespace, causing resolveToken to treat empty strings
as valid tokens; update resolveTokenFromCookie (used by resolveToken and
referencing jwtProperties.getAccessCookieName) to trim the cookie value and
return null when the value is null, empty, or only whitespace so that
resolveToken falls back to header parsing (i.e., check StringUtils/trim and
isEmpty or use value.trim().isEmpty() and return null for such cases).
---
Nitpick comments:
In `@src/test/java/com/dnd/moddo/domain/auth/service/JwtUtilTest.java`:
- Around line 13-52: Add edge-case unit tests to JwtUtilTest targeting
JwtUtil.resolveToken: add tests for (1) request with neither cookie nor
Authorization header returns null, (2) accessToken cookie present but empty
string behavior (assert null or defined policy), (3) only a differently-named
cookie exists and Authorization header is used as fallback, and (4)
Authorization header without the "Bearer " prefix returns null; also ensure the
test class package matches the JwtUtil implementation package
(com.dnd.moddo.auth.infrastructure.security) or move the test to the canonical
test package to match project conventions.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f8045b20-c852-48e1-821c-b6f96591e049
📒 Files selected for processing (6)
src/docs/asciidoc/settlement.adocsrc/main/java/com/dnd/moddo/auth/infrastructure/security/JwtProperties.javasrc/main/java/com/dnd/moddo/auth/infrastructure/security/JwtUtil.javasrc/main/resources/configsrc/test/java/com/dnd/moddo/domain/auth/service/JwtUtilTest.javasrc/test/resources/application.yml
📝 테스트 커버리지 리포트입니다!
|
#️⃣연관된 이슈
X
🔀반영 브랜치
fix/login -> develop🔧변경 사항
accessToken인증 방식을 쿠키 기반 조회로 변경했습니다.Authorization헤더보다accessToken쿠키를 우선 조회하도록 수정했습니다.accessToken쿠키 이름 설정을 추가했습니다.JwtUtil테스트를 추가해 쿠키 우선 조회와 헤더 fallback 동작을 검증했습니다.💬리뷰 요구사항(선택)
Summary by CodeRabbit
릴리스 노트
새로운 기능
문서
테스트