Conversation
- JwtTokenProvider: buildToken()에 jti(UUID) 추가 → 동일 사용자 동일 초 재로그인 시 토큰값 중복 불가 - RefreshTokenRepository: deleteAllExpired() JPQL 쿼리 추가 - UserCleanupScheduler: 매일 새벽 4시 만료 refresh token 일괄 삭제 job 추가
- JwtTokenProviderTest: 동일 파라미터 연속 호출 시 서로 다른 토큰 반환, 100회 호출 중복 없음 - UserServiceTest: 동일 사용자 연속 두 번 로그인 시 서로 다른 refreshToken 반환
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.
Summary
JwtTokenProvider.buildToken()에jti(UUID) 추가 — 동일 사용자가 같은 1초 안에 재로그인해도 매번 고유한 토큰값 생성, refresh_token UK 위반 원천 차단RefreshTokenRepository.deleteAllExpired()JPQL 쿼리 추가UserCleanupScheduler에 매일 새벽 4시 만료 refresh token 정리 job 추가 (DB housekeeping)Background
Phase 2 부하 테스트(S-3 AuthUser, 30 users) 중 간헐적 500 에러 발생.
원인:
login()이 기존 토큰 DELETE 없이 INSERT만 수행 +jti없어 동일 파라미터 시 동일 토큰 생성 →uk_refresh_token위반.실 서비스 재현 경로: 네트워크 단절 후 사용자 수동 재시도 (1초 이내).
Test plan
JwtTokenProviderTest— 동일 파라미터 연속 호출 시 서로 다른 토큰 반환JwtTokenProviderTest— 100회 호출 시 중복 없음UserServiceTest— 동일 사용자 연속 두 번 로그인 시 서로 다른 refreshToken 반환UserServiceTest10개 테스트 모두 통과