Skip to content
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

Remove checksums from HTTP range request, add part checksums #17105

Merged
merged 3 commits into from
Apr 28, 2023

Conversation

klauspost
Copy link
Contributor

@klauspost klauspost commented Apr 28, 2023

Description

Range requests silently ignores request for checksums. We now do so as well.

However part checksums should be stored and returned. This makes it possible for clients to compute expected checksums from parts.

This matches AWS S3 behavior.

We didn't store checksums, so this will only apply to new objects uploaded.

Motivation and Context

Compatibility

How to test this PR?

Mint tests here: minio/minio-go#1815

Types of changes

  • Compatibility

This matches AWS S3 behavior.

This also removes it from part requests, but that will be added in a separate PR.
@klauspost klauspost changed the title Remove checksums from HTTP range request Remove checksums from HTTP range request, add part checksums Apr 28, 2023
@klauspost
Copy link
Contributor Author

Testing part requests:

PUT /minio-go-test-o4bpfnzskfja5bnv/kqp1366oy42pnslpj59tk6gkxvzeny?partNumber=2&uploadId=YTQ0NDc3MTktNWViMS00YWY4LWI0NmMtYTgyMjMyYzE5YjAyLmU2YTMwYzcxLThhOGItNGY4Ni1hZmY4LTVhNTc1ZjE1MDNlZQ HTTP/1.1
[...]
X-Amz-Checksum-Crc32c: XUrXxQ==


GET /minio-go-test-o4bpfnzskfja5bnv/kqp1366oy42pnslpj59tk6gkxvzeny?partNumber=2 HTTP/1.1
[...]

HTTP/1.1 206 Partial Content
Content-Length: 10485760
Accept-Ranges: bytes
Content-Range: bytes 10485760-20971519/135266304
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
Date: Fri, 28 Apr 2023 10:10:10 GMT
Etag: "69d1b781cdc0867667046c1976a524d6-13"
Last-Modified: Fri, 28 Apr 2023 10:10:10 GMT
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Checksum-Crc32c: XUrXxQ==

@klauspost
Copy link
Contributor Author

Checking range requests. Compare range vs non-range:

---------START-HTTP---------
HEAD /minio-go-test-ftvb3sx12po5psy3/6n3eqio5mzhdj21ijb0qdksga3mndr HTTP/1.1
Host: 127.0.0.1:9001
User-Agent: MinIO (windows; amd64) minio-go/v7.0.53 MinIO-go-FunctionalTest/0.1.0
Authorization: AWS4-HMAC-SHA256 Credential=minio/20230428/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-checksum-mode;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Checksum-Mode: ENABLED
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230428T103952Z

HTTP/1.1 200 OK
Content-Length: 135266304
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
Date: Fri, 28 Apr 2023 10:39:52 GMT
Etag: "f53530ed27095b54f75fd57277a19245"
Last-Modified: Fri, 28 Apr 2023 10:39:52 GMT
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Checksum-Sha256: 8Tlu9msuw/cpmWNEnQx97axliBjiE6gK1doiY0N9WuA=
X-Amz-Id-2: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Request-Id: 175A13152B53B9EC
X-Amz-Server-Side-Encryption: aws:kms
X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id: arn:aws:kms:my-minio-key
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
---------END-HTTP---------


---------START-HTTP---------
GET /minio-go-test-ftvb3sx12po5psy3/6n3eqio5mzhdj21ijb0qdksga3mndr HTTP/1.1
Host: 127.0.0.1:9001
User-Agent: MinIO (windows; amd64) minio-go/v7.0.53 MinIO-go-FunctionalTest/0.1.0
Authorization: AWS4-HMAC-SHA256 Credential=minio/20230428/us-east-1/s3/aws4_request, SignedHeaders=host;range;x-amz-checksum-mode;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
Range: bytes=100-1000
X-Amz-Checksum-Mode: ENABLED
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230428T103952Z

HTTP/1.1 206 Partial Content
Content-Length: 901
Accept-Ranges: bytes
Content-Range: bytes 100-1000/135266304
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
Date: Fri, 28 Apr 2023 10:39:52 GMT
Etag: "f53530ed27095b54f75fd57277a19245"
Last-Modified: Fri, 28 Apr 2023 10:39:52 GMT
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Id-2: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Request-Id: 175A13152BCDC6D8
X-Amz-Server-Side-Encryption: aws:kms
X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id: arn:aws:kms:my-minio-key
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block

klauspost added a commit to klauspost/minio-go that referenced this pull request Apr 28, 2023
* Tests range requests
* Test multipart parts.

Requires minio/minio#17105 to pass on MinIO. Passes on AWS.
@harshavardhana harshavardhana merged commit 7fad0c8 into minio:master Apr 28, 2023
16 checks passed
@klauspost klauspost deleted the remove-checksums-partial branch April 28, 2023 15:58
harshavardhana pushed a commit to minio/minio-go that referenced this pull request May 3, 2023
* Tests range requests
* Test multipart parts.

Requires minio/minio#17105 to pass on MinIO. Passes on AWS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants