Thanks to visit codestin.com
Credit goes to github.com

Skip to content

s3: fix Content-MD5 for Object Lock uploads and add GCS quirk#9200

Open
chris081519-crypto wants to merge 1 commit intorclone:masterfrom
chris081519-crypto:s3-objectlock-fix-md5-and-gcs-quirk
Open

s3: fix Content-MD5 for Object Lock uploads and add GCS quirk#9200
chris081519-crypto wants to merge 1 commit intorclone:masterfrom
chris081519-crypto:s3-objectlock-fix-md5-and-gcs-quirk

Conversation

@chris081519-crypto
Copy link
Contributor

@chris081519-crypto chris081519-crypto commented Feb 21, 2026

AWS S3 requires Content-MD5 for PutObject with Object Lock parameters. Since rclone passes a non-seekable io.Reader, the SDK cannot compute checksums automatically. Buffer the body and compute MD5 manually for singlepart PutObject and presigned request uploads when Object Lock parameters are set. Multipart uploads are unaffected as Object Lock headers go on CreateMultipartUpload which has no body.

Add object_lock_supported provider quirk (default true) to allow skipping Object Lock integration tests on providers with incomplete S3 API support. Set to false for GCS which uses non-standard x-goog-bypass-governance-retention header and doesn't implement PutObjectLegalHold/GetObjectLegalHold.

Add Multipart and Presigned subtests to Object Lock integration tests to cover all three upload paths.

What is the purpose of this change?

Adding Content-MD5 Headers when using Object Lock on AWS for PutObject.
Adding provider quirk to skip GCP testing with Object Lock (as their implementation deviates from the standard).

Was the change discussed in an issue or in the forum before?

Fixes #9199

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

AWS S3 requires Content-MD5 for PutObject with Object Lock parameters.
Since rclone passes a non-seekable io.Reader, the SDK cannot compute
checksums automatically. Buffer the body and compute MD5 manually for
singlepart PutObject and presigned request uploads when Object Lock
parameters are set. Multipart uploads are unaffected as Object Lock
headers go on CreateMultipartUpload which has no body.

Add object_lock_supported provider quirk (default true) to allow
skipping Object Lock integration tests on providers with incomplete
S3 API support. Set to false for GCS which uses non-standard
x-goog-bypass-governance-retention header and doesn't implement
PutObjectLegalHold/GetObjectLegalHold.

Add Multipart and Presigned subtests to Object Lock integration tests
to cover all three upload paths.

Fixes rclone#9199
@chris081519-crypto chris081519-crypto force-pushed the s3-objectlock-fix-md5-and-gcs-quirk branch from dd2f101 to 3365b91 Compare February 21, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

s3: Object Lock integration test failures on AWS and GCS

1 participant