Conversation
Fix(security): permitAll 경로에서도 토큰이 있으면 인증 세팅되도록 수정
Contributor
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughJWT 필터에서 permit-all 경로 처리와 토큰 선택 로직을 재구성하고, 토큰 존재 검사 방식을 StringUtils 기반으로 변경했습니다. JwtService는 빈 액세스 토큰 반환 가드를 추가했습니다. HitsEntity의 @notblank 제약을 제거했습니다. PostInteractionService는 로그아웃 사용자(null userId)도 조회수 증가 대상이 되도록 분기 조건을 수정했습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant F as JwtAuthenticationFilter
participant S as JwtService
participant SC as SecurityContext
participant D as Downstream FilterChain
rect rgba(220,235,245,0.4)
Note over F: 요청 처리 시작
C->>F: HTTP Request
F->>F: isPermitAll = 매칭 검사
alt Swagger 경로
F->>S: getRefreshToken(req)
S-->>F: refreshToken or null
else 기타 경로
F->>S: getAccessToken(req)
S-->>F: accessToken or null
end
F->>F: StringUtils.hasText(token)?
alt 토큰 없음
F->>SC: clearContext()
alt permit-all
F->>D: doFilter(request, response)
D-->>F: return
F-->>C: Response (인증 미적용)
else 비 permit-all
F-->>C: Response (인증 실패 흐름 지속)
end
else 토큰 있음
F->>SC: 인증 설정/검증 흐름 계속
F->>D: doFilter(request, response)
D-->>F: return
F-->>C: Response
end
end
sequenceDiagram
autonumber
participant S as PostInteractionService
participant V as validateHits()
participant R as addHits()
Note over S: increaseHits(userId, postId)
alt userId == null
S->>R: addHits(postId)
R-->>S: done
else 사용자 로그인
S->>V: validateHits(userId, postId)
V-->>S: true/false
alt 이전 조회 없음(false)
S->>R: addHits(postId)
R-->>S: done
else 이미 조회(true)
Note over S: 증가 없음
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
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 |
This was referenced Oct 7, 2025
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.
#️⃣ 연관된 이슈
#263
#264
📝 작업 내용
Fix(security): permitAll 경로에서도 토큰이 있으면 인증 세팅되도록 수정
Summary by CodeRabbit
신규 기능
버그 수정
리팩터링