Repository navigation
feat(s3): multipart uploads, Object Lock retention and legal holds, and request payment - #98
Merged
Michael McQuade (giraffesyo) merged 6 commits intoNov 5, 2026
Conversation
…nd request payment
…s on Object Lock writes and pin their root elements
… answer bucket configurations in the S3 namespace
… it, and require a checksum on PutBucketRequestPayment
…ys report the next upload markers
Michael McQuade (giraffesyo)
deleted the
feat/s3-multipart-object-lock
branch
November 5, 2026 18:01
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
Adds three areas of the S3 API to
aws/s3:InvalidPartOrder), uploaded with the ETags given (InvalidPart), and at least 5 MiB except for the last (EntityTooSmall). The new version's ETag takes S3'smd5-of-md5s-Nform. Completing an upload ends it, so a retry after a lost response getsNoSuchUpload.Server.MultipartUploadsreports in-progress uploads and their parts, which S3 bills as storage.Server.CreateMultipartUploadstarts an upload directly. S3 documents in-progress uploads as blocking DeleteBucket only for directory buckets, so deleting a general purpose bucket discards its uploads.x-amz-bucket-object-lock-enabledturns on versioning, which then cannot be suspended. Get/PutObjectLockConfiguration handle default retention in Days or Years, and Put can enable Object Lock on a bucket that already has versioning on.x-amz-bypass-governance-retention: truefrom a caller granteds3:BypassGovernanceRetention. A delete without a version ID adds a delete marker, and DeleteBucket staysBucketNotEmptywhile any version remains.WithClock).Server.SetRetentionandServer.SetLegalHoldlock a version directly.x-amz-request-payer, so there is nothing to enforce. The docs say so.WithPolicychecks the documented actions for all of these, including the conditional ones (lock headers on PutObject, Object Lock on CreateBucket, and the bypass).The package docs list every behavior that is inferred rather than documented. These are the messages for the object lock AccessDenied, InvalidBucketState and InvalidRequest errors,
NoSuchObjectLockConfiguration, theMethodNotAllowedanswer for a delete marker's version, the InvalidArgument messages for lock headers, and how ListMultipartUploads counts common prefixes toward a page. Changing a GOVERNANCE retention to COMPLIANCE also needs the bypass, which is stricter than the cases AWS documents (shortening and removal) and is marked inferred. Object Lock writes (PutObject with a retention, UploadPart of such an upload, and the lock configuration, retention and legal hold PUTs) need Content-MD5 or a checksum, retain-until dates are kept to the millisecond, max-uploads and max-parts above 1000 return 1000 like max-keys, and below 1 fail with InvalidArgument (inferred). GetBucketVersioning, GetBucketTagging and GetBucketRequestPayment responses now carry the S3 namespace. PutBucketRequestPayment and the Object Lock PUTs reject another root element, as the versioning and tagging PUTs already did, and need Content-MD5 or a checksum. Event holds (variable retention), UploadPartCopy, and conditional writes on CompleteMultipartUpload are rejected with 400 rather than ignored.Testing
sdktest/aws/s3: tests through aws-sdk-go-v2 cover:aws/s3: XML shapes and header validation throughServeHTTP, plus fuzz seeds for the new operations.go build,go vet,go test -p 2 -race ./...in both modules,make lintandmake vulnall pass.make bench(aws/s3,-count 5), canary compared with this branch:Checklist
make checkpasses