feat: per-part sha256 checksums on multipart uploads#122
Open
lee-reinhardt wants to merge 1 commit intomainfrom
Open
feat: per-part sha256 checksums on multipart uploads#122lee-reinhardt wants to merge 1 commit intomainfrom
lee-reinhardt wants to merge 1 commit intomainfrom
Conversation
compute sha256 of each part before uploading and send as x-amz-checksum-sha256 header on every presigned PUT. include base64-encoded checksums in the complete request payload so the api can forward them to s3's CompleteMultipartUpload. this enables s3 to validate each part inline at upload time, catching corruption immediately rather than after assembly.
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
x-amz-checksum-sha256header (base64-encoded) on every presigned PUT request/completerequest payload (checksum_sha256field on each part) so the API can forward them to S3'sCompleteMultipartUploadXMLupload_artifacts) and container-side (upload_in_container)sha2andbase64crates already in Cargo.tomlAPI dependency — do not merge yet
The
x-amz-checksum-sha256header is anx-amz-*header, which means it must be included inX-Amz-SignedHeaderswhen generating presigned URLs (per AWS SigV4 spec). The API currently does not sign this header into presigned URLs — S3 will reject the PUT with a signature mismatch.Before merging this PR, the API needs to:
headers: [{"x-amz-checksum-sha256", "UNSIGNED-PAYLOAD"}](or equivalent) when generating presigned part URLs inpresign_part/4ChecksumAlgorithm: SHA256toCreateMultipartUploadininitiate_multipart/3<ChecksumSHA256>per part inCompleteMultipartUploadXML incomplete_multipart/4checksum_sha256from the CLI's complete request inRuntimeController.complete/2Tracked in ENG-1663. API integrity groundwork in peridio/avocado-connect-mono-repo#306.
Test plan
cargo build— cleancargo clippy— no new warningscargo test— 742 unit + 6 doc tests pass