-
Notifications
You must be signed in to change notification settings - Fork 1
634 s3 acess denied 오류 해결 #635
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
The head ref may contain hidden characters: "634-s3-acess-denied-\uC624\uB958-\uD574\uACB0"
Conversation
WalkthroughKotlin 코드에서 프로필 URL의 query 제거(substringBefore("?"))를 제거하고, timetable 이미지 URL 생성의 null 안전 처리와 한 파일의 호출 포맷팅 수정, application.yaml에서 Firebase 메시징 키 속성 삭제가 이루어졌습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (1)
41-41: PR 목적과 일치하지 않는 코드가 남아있습니다.PR 설명에 따르면 S3 접근 오류의 원인이 URL에서 인증 관련 부분을
substring으로 제거하던 로직이었습니다. 그러나substringBefore("?")가 여전히 존재하여 S3 presigned URL의 쿼리 파라미터(서명, 만료 시간 등)를 제거합니다.이 코드를 제거해야 S3 접근이 정상 작동합니다.
🐛 제안하는 수정
return QueryMyApplicationResponse( userId = application.userId, userName = application.userName, teacherName = application.teacherName!!, start = application.start.take(5), end = application.end!!.take(5), reason = application.reason, - profile = profileUrl?.substringBefore("?"), + profile = profileUrl, grade = user.grade, classNum = user.classNum, num = user.num, type = Type.APPLICATION )
🤖 Fix all issues with AI agents
In
@src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt:
- Around line 28-29: subjectName is nullable but is interpolated directly into
FileNameVo("$subjectName.png") which can produce "null.png"; update the code
that builds the filename (the usage of FileNameVo in the call to
fileUtil.generateObjectUrl in TimetableResponse) to handle null safely by
providing a sane fallback (e.g., use subjectName ?: "<fallback>" or derive a
name from id like "subject-$id.png") before creating FileNameVo, so the
generated filename is never the literal "null.png".
In
@src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt:
- Line 25: The code in QueryUserDetaileInfoService currently strips query params
from profileUrl with profile = profileUrl?.substringBefore("?"), which removes
S3 presigned auth parameters and breaks access; update the assignment to
preserve the full URL (e.g., set profile = profileUrl) so the S3 presigned query
parameters remain intact—mirror the fix applied in QueryMyApplicationService to
avoid removing query strings.
In @src/main/kotlin/dsm/pick2024/infrastructure/s3/FileUtil.kt:
- Line 9: The project has an inappropriate cross-domain dependency: FileNameVo
is defined in the timetable domain but used from FileUtil (infrastructure) and
other domains; move FileNameVo out of timetable into a shared location (e.g.,
create a new package/module like domain.common.vo or infrastructure.s3.vo) and
update references. Specifically, create the new FileNameVo in the chosen common
package, copy/adjust its implementation to remove timetable-specific ties, then
update imports in FileUtil.kt and all usages in user, bug, application, and
infrastructure code to reference the new package name; finally delete the old
timetable FileNameVo to finalize the refactor and run tests to ensure no
lingering imports remain.
🧹 Nitpick comments (1)
src/main/kotlin/dsm/pick2024/domain/timetable/domain/vo/FileNameVo.kt (1)
1-7: 패키지 위치 개선이 필요합니다.
FileNameVo가timetable.domain.vo패키지에 위치해 있지만,user,application,bug등 여러 도메인에서 사용됩니다. 이는 도메인 간 불필요한 의존성을 만들어냅니다.공통 모듈이나 인프라 계층으로 이동하는 것을 권장합니다. 예:
dsm.pick2024.infrastructure.s3또는dsm.pick2024.common.vo
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (9)
src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.ktsrc/main/kotlin/dsm/pick2024/domain/bug/AddBugService.ktsrc/main/kotlin/dsm/pick2024/domain/timetable/domain/vo/FileNameVo.ktsrc/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.ktsrc/main/kotlin/dsm/pick2024/domain/timetable/service/QueryTeacherTimetableService.ktsrc/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.ktsrc/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.ktsrc/main/kotlin/dsm/pick2024/infrastructure/s3/FileUtil.ktsrc/main/resources/application.yaml
💤 Files with no reviewable changes (1)
- src/main/resources/application.yaml
🔇 Additional comments (6)
src/main/kotlin/dsm/pick2024/domain/timetable/domain/vo/FileNameVo.kt (1)
5-6: NFC 정규화 구현이 적절합니다.파일명의 유니코드 정규화(NFC)는 한글 파일명의 인코딩 불일치 문제를 해결하는 올바른 접근입니다.
src/main/kotlin/dsm/pick2024/domain/bug/AddBugService.kt (1)
37-37: 변경 사항이 적절합니다.
FileNameVo를 사용하여 파일명을 정규화한 후 URL을 생성하는 로직이 올바르게 구현되었습니다.src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (1)
22-22:FileNameVo적용이 올바릅니다.프로필 URL 생성 시
FileNameVo를 사용하여 파일명을 NFC 정규화하는 변경이 적절합니다.src/main/kotlin/dsm/pick2024/domain/timetable/service/QueryTeacherTimetableService.kt (1)
36-39: LGTM - FileNameVo 적용이 올바르게 되었습니다.
generateObjectUrl호출 시FileNameVo로 래핑하는 변경이 올바르게 적용되었습니다.src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt (1)
21-28: 핵심 수정 - S3 접근 거부 문제 해결
substringBefore("?")로직 제거가 올바르게 적용되었습니다. 이전에는 presigned URL에서?이후의 쿼리 파라미터(AWS 서명 정보 포함)를 잘라내어 S3 인증이 실패했습니다. 이제 전체 presigned URL이 반환되어 정상 작동합니다.src/main/kotlin/dsm/pick2024/infrastructure/s3/FileUtil.kt (1)
57-67: LGTM - generateObjectUrl 시그니처 변경
FileNameVo를 파라미터로 받도록 변경되어 타입 안전성이 향상되었습니다. presigned URL 생성 로직은 올바르게 유지되고 있습니다.
src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt
Outdated
Show resolved
Hide resolved
ByunDohwi
left a comment
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.
LGTM
| val imageUrl = fileUtil.generateObjectUrl( | ||
| "${timetable.subjectName}.png", | ||
| PathList.TIMETABLE | ||
| ) |
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.
이건 lint에서 짤려서 내린건가요?
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.
fileNameVo 말씀하시는 거면 의존성 관리가 안되어서 없앴습니다.
e101742
ByunDohwi
left a comment
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.
LGTM
문제를 해결하였습니다. subString으로 url에서 s3 인증관련 부분을 날려버렸던 것이 문제였습니다.
해당 로직을 삭제헀고, jpg, png 파일 모두 프로필 사진으로 뜨는 것을 확인했습니다.
Summary by CodeRabbit
릴리스 노트
수정 사항
기타
스타일
✏️ Tip: You can customize this high-level summary in your review settings.