feat(configuration): 파일 도메인 모델 및 규칙 정의 #26 - #56
Open
tlgms wants to merge 5 commits into
Hidden character warning
The head ref may contain hidden characters: "feat(document)-\ud30c\uc77c-\ub3c4\uba54\uc778-\ubaa8\ub378-#26"
Open
Conversation
- FileExtension: 확장자↔MIME 매핑, jpeg 별칭 허용 - FileCategory: 용도별 object_key prefix, 허용 확장자, 최대 용량 - FileDocument: files 테이블 대응 도메인 모델 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
명세의 에러 코드에 1:1 대응하는 예외를 추가한다. INVALID_FILE_FORMAT, FILE_TOO_LARGE, FILE_NOT_FOUND, STORAGE_UPLOAD_FAILED, PRESIGN_FAILED 및 키 조작 방어용 예외. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- port/in: UploadFileUseCase, IssueDownloadUrlUseCase, ReadFileUseCase - port/out: StoragePort(S3), FileDocumentRepository(files) - DownloadUrl, StoredObject 값 객체와 커맨드 추가 바이너리는 커맨드가 아니라 InputStream 파라미터로 분리해 커맨드의 값 의미를 유지한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
명세 응답 예시(application_1001.pdf, photo_5f3c9a2b.jpg 등)에 맞는 파일명 생성 규칙을 도메인에 둔다. 경로 구분자, 상위 경로 참조, 허용 외 문자를 걸러 object_key 조작을 막는다. 지원자 목록 excel 다운로드는 fileName이 그대로 키에 붙으므로 requireSafeFileName으로 거부한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
확장자 인식, 카테고리별 허용 형식/용량, 명세 예시와 동일한 파일명 생성, 경로 조작 거부를 검증한다. 기존 test 타깃이 :main에 의존하지 않아 도메인 클래스를 참조하는 테스트가 컴파일되지 않던 문제를 함께 수정한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
🚫 Excluded labels (none allowed) (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 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
deps.bzl은 비어 있는 상태 유지).Related Issue
Scope
configuration-domain의hs.kr.entrydsm.configuration.domain.document패키지Implementation
API 11종은 허용 확장자·용량 한도·
object_key명명 규칙이 API마다 다릅니다. 이 규칙이 컨트롤러나 어댑터에 흩어지면 원서 슬롯에 이미지가 올라가는 식의 사고를 막을 수 없어 도메인에 모았습니다.FileExtension— 확장자↔MIME 매핑.jpeg를jpg별칭으로 처리FileCategory— 용도별object_keyprefix, 허용 확장자 집합, 최대 용량. 전역 화이트리스트 하나로 두면 카테고리별 제한이 불가능해 카테고리가 자기 허용 집합을 갖습니다FileNaming— 명세 응답 예시와 동일한 파일명 생성(application_1001.pdf,photo_5f3c9a2b.jpg등) + 경로 조작 방어INVALID_FILE_FORMAT,FILE_TOO_LARGE,FILE_NOT_FOUND,STORAGE_UPLOAD_FAILED,PRESIGN_FAILED)port/in3종,port/out2종. 참조 구현(EnvironmentVariable)과 동일하게-application이 아니라-domain에 둡니다#7 지원자 목록 excel 다운은fileName이 그대로 S3 키에 붙으므로requireSafeFileName으로 경로 구분자·상위 경로 참조를 거부합니다.Testing
Deployment Notes
Checklist
리뷰 시 봐주셨으면 하는 것
.hwpMIME — 표준이 없어application/x-hwp로 고정했습니다.BUILD.bazel수정 포함 — 기존test타깃이:main에 의존하지 않아 도메인 클래스를 참조하는 테스트가 컴파일되지 않았습니다. 함께 고쳤습니다.kt_jvm_test는test_class를 하나만 받아document_test타깃을 별도로 추가했습니다.