Skip to content

feat(core): add transfer fidelity option models - #303

Merged
cxymds merged 1 commit into
mainfrom
cxymds/issue-1455-transfer-option-models
Jul 23, 2026
Merged

feat(core): add transfer fidelity option models#303
cxymds merged 1 commit into
mainfrom
cxymds/issue-1455-transfer-option-models

Conversation

@cxymds

@cxymds cxymds commented Jul 23, 2026

Copy link
Copy Markdown
Member

Related issue

Closes rustfs/backlog#1455
Parent: rustfs/backlog#1371
Roadmap: rustfs/backlog#1361

Background and impact

The existing ObjectStore write/copy APIs can express only Content-Type and SSE-S3/SSE-KMS. Adding metadata, tags, storage class, checksums, SSE-C, retention, or legal hold directly to those public structs would break downstream struct literals, while adding SSE-C to the serializable encryption enum could expose customer key material. Backends also need an explicit way to reject advanced fields instead of silently discarding them.

Solution

  • Add backend-neutral transfer fidelity models for standard object attributes, metadata/tag directives, checksum calculation or precomputed values, storage class, encryption, retention, and legal hold.
  • Store SSE-C keys in zeroizing memory with redacted Debug output and exact 32-byte validation.
  • Validate HTTP metadata names/values, S3 tag limits, checksum Base64/digest length, empty storage class/KMS identifiers, and copy directive consistency before mutation.
  • Add additive ObjectStore transfer methods with compatibility defaults. Legacy-compatible fields delegate to existing methods; unsupported advanced behavior returns UnsupportedFeature before backend requests.
  • Add a separate transfer metadata result so ObjectInfo and output schema v1 remain unchanged.
  • Cover single and multipart copy compatibility, source-version consistency, trait-object dispatch, argument preservation, zero-request rejection, and encryption propagation.

Compatibility

  • No protected files changed.
  • No direct AWS SDK dependency was added to rc-core.
  • Existing ObjectReadOptions, CopyObjectOptions, ObjectEncryptionRequest, ObjectInfo, and output schemas are unchanged.
  • Existing ObjectStore implementations keep compiling because all new trait methods have defaults.

Review follow-up addressed

  • Reject metadata header injection and invalid metadata header names.
  • Validate checksum Base64 and algorithm-specific digest lengths.
  • Enforce S3 object-tag count/key/value limits.
  • Exercise inherited default methods through &dyn ObjectStore, including zero-request rejection and multipart version behavior.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • CARGO_BUILD_JOBS=2 cargo test --workspace
  • Independent final re-review: no remaining actionable findings

@cxymds
cxymds merged commit 1780f40 into main Jul 23, 2026
@cxymds
cxymds deleted the cxymds/issue-1455-transfer-option-models branch July 23, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant