Files
seaweedfs/weed/s3api
d84235e74f s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3 (#13378)
* s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3

AWS encrypts an SSE-KMS request that sends no key ID with the aws/s3
managed key. PutObject, UploadPart and CreateMultipartUpload passed the
empty key ID on, and the KMS call rejected it, so the request failed
with 500. A bucket default of aws:kms without a key failed the same way
for multipart uploads.

CopyObject was worse: its copy paths read an empty key ID as no
SSE-KMS, stored the data unencrypted or under the source key, and
marked the object as SSE-KMS, so reading it back returned garbage.

Resolve an empty key ID to alias/aws/s3 wherever a request or a bucket
default is read, with the helper the bucket default uploads and copies
already had inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3api: re-encrypt an in-place SSE-KMS copy that changes the key

The key-rotation strategy handed back the source chunks for an in-place
SSE-KMS copy, so an object copied onto itself under another key, or
under alias/aws/s3 when the request names none, stayed encrypted under
the old key. Route it through the re-encrypt copy, which already keeps
the same-key case direct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-12-04 11:33:51 -08:00
..
2024-07-04 11:00:41 -07:00

see https://blog.aqwari.net/xml-schema-go/

1. go get aqwari.net/xml/cmd/xsdgen
2. Add EncodingType element for ListBucketResult in AmazonS3.xsd
3. xsdgen -o s3api_xsd_generated.go -pkg s3api AmazonS3.xsd
4. Remove empty Grantee struct in s3api_xsd_generated.go
5. Remove xmlns: sed s'/http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\ //' s3api_xsd_generated.go