[Chore] Refresh Token Redis 연동 - #17
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesRedis 리프레시 토큰 인프라
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/com/ilson/spotwork/infra/redis/RefreshTokenRepository.java`:
- Around line 27-29: The find() method in RefreshTokenRepository currently
returns a String that can be null, which risks causing NullPointerException when
callers don't perform null checks. Change the return type of the find(Long
userId) method from String to Optional<String> and update the implementation to
wrap the redis template result with Optional.ofNullable() instead of directly
returning the value, making null handling explicit and safer for callers.
- Line 15: The REFRESH_TOKEN_TTL constant in RefreshTokenRepository is hardcoded
to 7 days, but the JwtProvider class uses a configurable refreshTokenExpiration
value injected from application properties. If the configuration specifies a
different expiration time, the Redis TTL and JWT validation time will be
misaligned. Replace the hardcoded REFRESH_TOKEN_TTL with a field annotated with
`@Value` that reads the same configuration property used by JwtProvider (likely
jwt.refresh-token-expiration), ensuring both the Redis storage TTL and JWT token
validation use the same expiration duration.
🪄 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 Plus
Run ID: 2729ef5c-662c-4bdb-9b51-7736c324dcb4
📒 Files selected for processing (2)
src/main/java/com/ilson/spotwork/infra/redis/RedisConfig.javasrc/main/java/com/ilson/spotwork/infra/redis/RefreshTokenRepository.java
관련 이슈
closes #16
구현 내용
주요 구현 포인트
RedisConfig
→ Redis CLI에서 사람이 읽을 수 있는 형태로 저장
RefreshTokenRepository
→ 만료된 토큰이 Redis에 쌓이지 않도록 자동 삭제
참고
체크리스트
Summary by CodeRabbit
릴리스 노트