Expand description
Object metadata setter via self-overwrite CopyObject.
§Design
S3 does not expose a PatchObjectMetadata API. The only supported way to
change user-defined metadata on an existing object without re-uploading the
body is a server-side CopyObject from bucket/key back to itself with
MetadataDirective::Replace. This replaces the metadata in-place while the
body is preserved on the server side.
§ETag precondition
When if_match_etag is supplied the call sets the S3 copy-source-if-match
header. S3 returns 412 (Precondition Failed) when the live ETag does not
match. We map that to AppError::Conflict so the frontend can surface a
“object was modified since you loaded it” message.
§OCP
PutResult is the open shape for metadata/tag setters:
checksumandsse_kms_key_idcan be added asOptionfields later.version_idis already present for versioned-bucket support.
Structs§
- PutResult
- Result returned by
set_object_metadataandset_object_tags.
Functions§
- classify_
copy_ 🔒sdk_ error_ with_ precondition - set_
object_ metadata - Replace the user-defined metadata on
bucket/key.