refactor: Hono 기반 파일 API 및 자동 OpenAPI 문서 전환 - #1
Merged
Merged
Conversation
AlphaBs
commented
Sep 5, 2026
AlphaBs
left a comment
Owner
Author
There was a problem hiding this comment.
코드 리뷰 완료 — main 대비 커밋 055d178 기준입니다.
검토 범위는 라우팅과 HEAD 처리, 인증·입력 검증 순서, R2 키 및 메타데이터, 업로드 서명, 캐시 기본값, OpenAPI/Scalar, CI와 배포 설정입니다. 현재 확인한 범위에서 합의된 동작 변경 외에 추가 수정을 요구할 결함은 발견하지 못했습니다.
- 파일 HEAD는 GET 핸들러에서 분기하여 R2.head()만 호출하며, 본문 없는 응답을 유지합니다.
- 보호된 요청은 인증 후 검증하고, 일괄 요청은 모든 해시를 검증한 뒤 R2에 접근합니다.
- 정상 MD5의 저장 키와 고정 시각의 서명 결과는 기존 계약 테스트로 검증합니다.
- 저장된 Cache-Control/Expires가 있으면 유지하고, 없는 GET 성공 응답에만 immutable 기본값을 적용합니다.
- 운영 필수 설정은 Secret으로 존재하며, 사용자 지정 도메인과 로그 설정이 Wrangler 설정에 반영돼 있습니다.
남은 검증 한계:
- 실제 S3 PUT과 조건부 덮어쓰기 거부까지의 업로드 종단 간 검증은 수행하지 않았습니다. 현재 테스트는 생성된 서명·헤더와 로컬 R2 동작을 검증합니다.
- 비정상 해시의 기존 객체가 운영에 존재하는지 전체 조사하지 않았습니다. 새 검증으로 접근이 차단될 수 있다는 점은 승인된 변경이며 PR에 명시돼 있습니다.
- 같은 URL의 덮어쓰기·메타데이터 변경이 1년 캐시 동안 보이지 않을 수 있습니다. 이 역시 승인된 정책이며 결함으로 중복 지적하지 않습니다.
로컬 pnpm check(163개 테스트, 커버리지 100%, OpenAPI 및 빌드 검증)와 브랜치 CI가 통과했습니다. 운영 표본 파일의 목록·HEAD·GET·MD5·캐시 헤더도 확인했습니다.
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.
변경 내용
itty-router 기반 파일 서버를 Hono로 리팩토링하고 파일 라우트·서비스·R2 저장소·서명 로직을 분리했습니다. pnpm으로 전환하고, Hurl과 수동 Swagger 명세를 Vitest 및 자동 생성 OpenAPI/Scalar 문서로 대체했습니다. README는 한국어로 작성했습니다.
정상 MD5의 R2 저장 키, 인증 방식, 업로드 서명 규칙과 파일 HEAD의 메타데이터 조회는 유지합니다. 후속 결정으로 아래 외부 동작 변경을 포함합니다.
/docs,/openapi.json추가; HEAD 동작은 GET 설명에 포함기존 비정상 키의 객체는 이동·삭제하지 않지만 새 입력 검증으로 접근이 거부될 수 있습니다. 같은 URL의 덮어쓰기와 메타데이터 변경은 캐시 만료 전까지 반영되지 않을 수 있습니다. 세부 계약은
docs/compatibility.md에 기록했습니다.검증
pnpm check: 타입 검사, 테스트 163개, 커버리지 100%, OpenAPI 검증 및 Worker dry-run 빌드 통과c336eee5-5d5f-4e01-8675-3f5cf7c26bd9Cache-Control: public, max-age=31536000, immutable확인