-
Notifications
You must be signed in to change notification settings - Fork 0
토큰 재발급 시 JWT 필터를 거쳐 오류가 발생하는 문제 수정 #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,13 +109,14 @@ public ResumeResponse updateResume(ResumeRequest request, Long memberId, Long re | |||||||||||||||||||||||||||||
| Resume resume = resumeRepository.findById(resumeId) | ||||||||||||||||||||||||||||||
| .orElseThrow(()-> new BusinessException(ExceptionType.RESUME_NOT_FOUND)); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| String imageUrl = resumeImageService.getResumeImagePresignedUrl(memberId); | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 권한 체크 후에 이미지 URL을 생성하세요. 권한이 확인되지 않은 상태에서 다음과 같이 순서를 변경하세요: @Transactional
public ResumeResponse updateResume(ResumeRequest request, Long memberId, Long resumeId) {
Resume resume = resumeRepository.findById(resumeId)
.orElseThrow(()-> new BusinessException(ExceptionType.RESUME_NOT_FOUND));
- String imageUrl = resumeImageService.getResumeImagePresignedUrl(memberId);
if(!resume.getMember().getId().equals(memberId)) {
throw new BusinessException(ExceptionType.RESUME_FORBIDDEN);
}
+
+ String imageUrl = resumeImageService.getResumeImagePresignedUrl(memberId);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| if(!resume.getMember().getId().equals(memberId)) { | ||||||||||||||||||||||||||||||
| throw new BusinessException(ExceptionType.RESUME_FORBIDDEN); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| resume.updateResume( | ||||||||||||||||||||||||||||||
| request.resumeTitle(), | ||||||||||||||||||||||||||||||
| request.resumeImageUrl() != null ? request.resumeImageUrl() : resume.getResumeImageUrl(), | ||||||||||||||||||||||||||||||
| imageUrl, | ||||||||||||||||||||||||||||||
kon28289 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
| request.desiredJobs() != null | ||||||||||||||||||||||||||||||
| ? request.desiredJobs().stream().map(DesiredJobRequest::toDesiredJob).collect(Collectors.toList()) | ||||||||||||||||||||||||||||||
| : null, | ||||||||||||||||||||||||||||||
|
|
@@ -148,8 +149,6 @@ public ResumeResponse updateResume(ResumeRequest request, Long memberId, Long re | |||||||||||||||||||||||||||||
| : null | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| String imageUrl = resumeImageService.getResumeImagePresignedUrl(memberId); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| return ResumeResponse.toResumeResponse(resume, imageUrl, MemberProfileResponse.toMemberProfileResponse(resume.getMember(), null)); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startsWith사용으로 인한 보안 취약점을 수정하세요.현재
startsWith방식은 의도하지 않은 경로까지 매치할 수 있는 보안 문제가 있습니다. 예를 들어 "/api/v1/members/sign-in-test" 같은 경로도 매치됩니다.정확한 패턴 매칭을 위해 다음과 같이 수정하세요:
📝 Committable suggestion
🤖 Prompt for AI Agents