Skip to main content

Module metadata

Module metadata 

Source
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:

  • checksum and sse_kms_key_id can be added as Option fields later.
  • version_id is already present for versioned-bucket support.

Structs§

PutResult
Result returned by set_object_metadata and set_object_tags.

Functions§

classify_copy_sdk_error_with_precondition 🔒
set_object_metadata
Replace the user-defined metadata on bucket/key.