Skip to content

Conversation

@1210thatman
Copy link
Contributor

@1210thatman 1210thatman commented Jan 13, 2026


문제를 해결하였습니다. subString으로 url에서 s3 인증관련 부분을 날려버렸던 것이 문제였습니다.
해당 로직을 삭제헀고, jpg, png 파일 모두 프로필 사진으로 뜨는 것을 확인했습니다.

Summary by CodeRabbit

릴리스 노트

  • 수정 사항

    • 사용자 프로필 URL: 응답에 프로필 URL의 쿼리 문자열을 제거하지 않고 원본 URL을 그대로 전달하도록 변경
    • 시간표 이미지 처리: 과목명이 없을 경우 이미지 URL을 null로 처리하여 불완전한 파일명 생성 방지
  • 기타

    • Firebase 메시징 설정에서 일부 키 항목 제거로 설정 간소화
  • 스타일

    • 내부 호출 형식 정리(코드 포맷팅 개선)

✏️ Tip: You can customize this high-level summary in your review settings.

@1210thatman 1210thatman linked an issue Jan 13, 2026 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Walkthrough

Kotlin 코드에서 프로필 URL의 query 제거(substringBefore("?"))를 제거하고, timetable 이미지 URL 생성의 null 안전 처리와 한 파일의 호출 포맷팅 수정, application.yaml에서 Firebase 메시징 키 속성 삭제가 이루어졌습니다.

Changes

Cohort / File(s) 변경 요약
타임테이블 서비스 (포맷팅)
src/main/kotlin/dsm/pick2024/domain/timetable/service/QueryTeacherTimetableService.kt
fileUtil.generateObjectUrl(...) 호출을 한 줄에서 여러 줄로 재포맷팅 (동작 변경 없음)
타임테이블 응답 null 안전 처리
src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt
subjectName이 null일 때 "null.png" 대신 imageUrl을 null로 반환하도록 subjectName?.let { fileUtil.generateObjectUrl(...) }로 변경
프로필 URL 처리 변경
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt, src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt, src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt
응답에 넘기는 profileUrl에서 substringBefore("?") 호출을 제거하여 원본 URL 전체를 사용하도록 변경
설정 파일
src/main/resources/application.yaml
firebase.messaging.url.key (FIREBASE_KEY_JSON) 속성 제거

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 URL 통째로 달려가네, 물음표 놀이 멈추고
이미지 이름도 조심스레, 비어있음엔 비워두네.
한 줄은 나눠서 읽기 좋게, 설정은 깔끔히 정리했지.
당근 한 입에 코드 한숨, 깡총깡총 고쳤다옹.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request 제목이 변경사항의 주요 목적을 명확하게 나타냅니다. S3 접근 권한 오류 해결이라는 핵심 변경 사항을 잘 요약하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent 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

📥 Commits

Reviewing files that changed from the base of the PR and between 12727c1 and e101742.

📒 Files selected for processing (1)
  • src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt
⏰ 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)
  • GitHub Check: Check Code Quality
🔇 Additional comments (1)
src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt (1)

27-29: LGTM! Null-safe 처리가 올바르게 적용되었습니다.

subjectName이 null일 때 "null.png" 같은 잘못된 URL을 생성하지 않고, imageUrl을 null로 설정하는 방식으로 개선되었습니다. Kotlin의 ?.let 구문을 사용한 관용적인 null 처리입니다.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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: 패키지 위치 개선이 필요합니다.

FileNameVotimetable.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

📥 Commits

Reviewing files that changed from the base of the PR and between aa50ee8 and de85d91.

📒 Files selected for processing (9)
  • src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt
  • src/main/kotlin/dsm/pick2024/domain/bug/AddBugService.kt
  • src/main/kotlin/dsm/pick2024/domain/timetable/domain/vo/FileNameVo.kt
  • src/main/kotlin/dsm/pick2024/domain/timetable/presentation/dto/response/TimetableResponse.kt
  • src/main/kotlin/dsm/pick2024/domain/timetable/service/QueryTeacherTimetableService.kt
  • src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt
  • src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt
  • src/main/kotlin/dsm/pick2024/infrastructure/s3/FileUtil.kt
  • src/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 생성 로직은 올바르게 유지되고 있습니다.

ByunDohwi
ByunDohwi previously approved these changes Jan 13, 2026
Copy link
Member

@ByunDohwi ByunDohwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +35 to +38
val imageUrl = fileUtil.generateObjectUrl(
"${timetable.subjectName}.png",
PathList.TIMETABLE
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 lint에서 짤려서 내린건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileNameVo 말씀하시는 거면 의존성 관리가 안되어서 없앴습니다.

imhanseong
imhanseong previously approved these changes Jan 13, 2026
Copy link
Member

@ByunDohwi ByunDohwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@1210thatman 1210thatman merged commit 91de6d5 into develop Jan 13, 2026
2 checks passed
@1210thatman 1210thatman deleted the 634-s3-acess-denied-오류-해결 branch January 13, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

기능 개발 API 개발

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

S3 Acess Denied 오류 해결

4 participants