Files
seaweedfs/test
04a93bd7dd s3api: support UploadPartCopy from SSE-KMS sources (#13431)
* s3api: support UploadPartCopy from SSE-KMS sources

UploadPartCopy from an SSE-KMS source returned 501, so `aws s3 cp`, `mv`
and `sync` failed for SSE-KMS objects over the multipart threshold. The
re-encrypting copy path now decrypts the source the way GET does: chunks
with their own SSE-KMS metadata decrypt with it, and a source without any
uses the entry-level key. A ranged copy starts at the chunk holding the
range, so copying the tail of a large object doesn't fetch and decrypt
everything before it.

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

* s3api: start an SSE-S3 part copy at the chunk holding the range

A ranged UploadPartCopy from a per-chunk SSE-S3 source fetched and
decrypted every chunk before the range and discarded it, so copying a
large SSE-S3 object part by part read the source quadratically. Start at
the chunk holding the range start, as the SSE-KMS path does.

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

* s3api: answer UploadPartCopy with the KMS error when the source won't decrypt

A part copy from an SSE-KMS source whose key the KMS no longer holds,
has disabled or refuses answered 500 InternalError, whether the refusal
came while opening the source or mid-stream. Answer it with the KMS
error, as PUT and CopyObject do.

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

* s3api: refuse an SSE-KMS part copy over chunks of another SSE type

A source mixing SSE-KMS chunks with SSE-S3 or SSE-C ones would stream
the foreign chunks through as plaintext, copying their ciphertext into
the destination part. Refuse the copy before fetching anything.

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-05 11:07:31 -08:00
..