[FEAT] 마스터 JWT 발급 기능 구현 - #225
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough마스터 인증 기능을 조건부로 추가했습니다. 활성화되면 POST Changes마스터 인증
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
Sequence Diagram(s)sequenceDiagram
participant Client
participant MasterAuthSecurityConfig
participant MasterAuthController
participant MasterAuthService
participant UserRepository
participant JwtTokenProvider
Client->>MasterAuthSecurityConfig: POST /api/auth/master-token
MasterAuthSecurityConfig->>MasterAuthController: 요청 허용
MasterAuthController->>MasterAuthService: issueAccessToken(userId)
MasterAuthService->>UserRepository: 사용자 존재 확인
MasterAuthService->>JwtTokenProvider: Access Token 생성 및 만료 시간 조회
MasterAuthService-->>MasterAuthController: MasterAuthResponse
MasterAuthController-->>Client: ApiResponse<MasterAuthResponse>
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
🧹 Nitpick comments (1)
src/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.java (1)
13-15: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win실제
SecurityFilterChain을 사용하는 통합 테스트를 추가하세요.
MasterAuthActivationTest는MasterAuthController만 등록하고,MasterAuthControllerTest는standaloneSetup을 사용합니다. 두 테스트 모두MasterAuthSecurityConfig와SecurityConfig의 필터 체인을 실행하지 않습니다.master-auth.enabled=true일 때 인증 없이 토큰을 반환하고, 비활성 또는 미설정 상태일 때 요청이401또는403으로 차단되는지@SpringBootTest와@AutoConfigureMockMvc로 확인하세요. Spring Security MockMvc 통합 테스트 문서를 참고하세요.🤖 Prompt for 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. In `@src/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.java` around lines 13 - 15, The tests currently bypass the real Spring Security filter chain. In src/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.java:13-15, replace the limited ApplicationContextRunner setup with a `@SpringBootTest` and `@AutoConfigureMockMvc` integration setup that includes MasterAuthSecurityConfig and SecurityConfig, then verify enabled master auth returns a token without authentication while disabled or unset configuration returns 401 or 403. In src/test/java/com/mr/domain/auth/controller/MasterAuthControllerTest.java:29-31, replace standaloneSetup with MockMvc backed by the Spring application context and exercise the same real-filter-chain behavior; no direct change is needed beyond removing the standalone controller setup.
🤖 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.
Nitpick comments:
In `@src/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.java`:
- Around line 13-15: The tests currently bypass the real Spring Security filter
chain. In
src/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.java:13-15,
replace the limited ApplicationContextRunner setup with a `@SpringBootTest` and
`@AutoConfigureMockMvc` integration setup that includes MasterAuthSecurityConfig
and SecurityConfig, then verify enabled master auth returns a token without
authentication while disabled or unset configuration returns 401 or 403. In
src/test/java/com/mr/domain/auth/controller/MasterAuthControllerTest.java:29-31,
replace standaloneSetup with MockMvc backed by the Spring application context
and exercise the same real-filter-chain behavior; no direct change is needed
beyond removing the standalone controller setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3d10deb8-9d82-4ada-acd0-5d513d46eb85
📒 Files selected for processing (7)
src/main/java/com/mr/domain/auth/config/MasterAuthSecurityConfig.javasrc/main/java/com/mr/domain/auth/controller/MasterAuthController.javasrc/main/java/com/mr/domain/auth/dto/res/MasterAuthResponse.javasrc/main/java/com/mr/domain/auth/service/MasterAuthService.javasrc/test/java/com/mr/domain/auth/controller/MasterAuthActivationTest.javasrc/test/java/com/mr/domain/auth/controller/MasterAuthControllerTest.javasrc/test/java/com/mr/domain/auth/service/MasterAuthServiceTest.java
p1001q
left a comment
There was a problem hiding this comment.
P1은 없습니다~ 설계 자체는 이중 안전장치가 잘 갖춰져 있어서 P2(로깅) 하나만 보완하면 머지하셔도 될 거 같습니다! 승인 남겨드립니다~
|
|
||
| public MasterAuthController( | ||
| MasterAuthService masterAuthService, | ||
| @Value("${master-auth.user-id}") Long masterAuthUserId |
There was a problem hiding this comment.
[P5] :#{null}을 덧붙여주시면, application.yml에 해당 설정값이 아예 적혀있지 않더라도 스프링이 에러를 뱉으며 뻗어버리는 대신 null을 안전하게 넣어준다고 하니, 고려해보는 것도 좋을 것 같습니다!
📍 개요
⛓️💥 관련 이슈
🛠️ 작업 내용
🔥 리뷰 요청 사항
✅ 체크리스트
📎 참고 사항
Summary by CodeRabbit
새 기능
테스트