Skip to main content

UploadBundle

Struct UploadBundle 

Source
pub struct UploadBundle {
Show 23 fields pub asset_id: Uuid, pub album_id: Uuid, pub crypto_suite_id: u16, pub protocol_version: String, pub amk_version: u32, pub original: OriginalCiphertext, pub ciphertext_hash: Hash32, pub plaintext_size: u64, pub chunk_size: u32, pub content_type: String, pub key_mode: KeyMode, pub metadata_blob: Vec<u8>, pub provenance_blob: Vec<u8>, pub metadata_blob_hash: Option<Hash32>, pub derivatives: Vec<DerivativeBlob>, pub derivative_manifests: Vec<Vec<u8>>, pub created_by_user: Uuid, pub created_by_device: Uuid, pub client_version: String, pub timestamp: String, pub action: Action, pub prior_provenance_hash: Option<Hash32>, pub retention_until: Option<String>,
}
Expand description

Everything needed to push one managed asset: its identity, the re-derived original ciphertext, the exact sealed metadata blob, any derivative blobs, and the manifest-envelope projection fields the server validates. Carries no Workspace internals and no album key material — the AMK never leaves the workspace. The one secret it holds is the original’s per-file key, privately inside OriginalCiphertext, which can open that one file and nothing else.

Every field maps one-for-one onto the upload protocol’s POST /upload body (capsule_sdk::push owns that mapping).

Fields§

§asset_id: Uuid

The asset id — equal to the manifest’s file_id.

§album_id: Uuid

The album the asset belongs to.

§crypto_suite_id: u16

The primitive bundle the manifest was produced under.

§protocol_version: String

The date-based wire protocol version the manifest is pinned to.

§amk_version: u32

The AMK epoch the asset is sealed under.

§original: OriginalCiphertext

The original’s ciphertext, re-derived on demand from the plaintext on disk and the manifest’s recorded nonce_prefix. It is never held whole: see OriginalCiphertext.

§ciphertext_hash: Hash32

The original ciphertext’s content address (equal to the manifest’s ciphertext_hash).

§plaintext_size: u64

Total plaintext byte length of the original.

§chunk_size: u32

Plaintext bytes per STREAM chunk.

§content_type: String

The original’s content_type as declared on the wire: the signed sidecar’s MIME type when the upload protocol’s closed enum names it, otherwise the opaque application/octet-stream (wire_content_type). The sidecar keeps the true type; this is only what the server is told.

§key_mode: KeyMode

How the file key is obtained (derived / wrapped).

§metadata_blob: Vec<u8>

The exact sealed metadata-blob wire bytes the manifest commits to.

§provenance_blob: Vec<u8>

The exact provenance-blob wire bytes: the canonical CBOR of the chain’s create ProvenanceRecord, its genesis. The records after it are not uploaded: they reach the server as lifecycle ops once it has indexed this one.

This is the asset’s envelope object — the provenance blob of provenance.md § Physical Storage, stored by the server verbatim and served back unchanged on the sync feed. It is the record and not the bare manifest because the server’s chain head is the SHA-256 of these bytes, while a client’s next prior_provenance_hash is record_hash() — the digest of the canonical record — so no other encoding lets a later lifecycle op chain onto what this upload established. The manifest travels inside it, canonically encoded and therefore byte-identical to its own signed bytes: “the signed bytes are the served bytes” holds through the wrapper.

Always present, unlike metadata_blob_hash: a managed asset always has a create record, even when it binds no metadata blob.

§metadata_blob_hash: Option<Hash32>

The content address of the sealed metadata blob, when the create binds one.

§derivatives: Vec<DerivativeBlob>

The asset’s derivative blobs, if any were generated and persisted.

§derivative_manifests: Vec<Vec<u8>>

The exact derivative_manifest-blob wire bytes: the canonical CBOR of each signed [DerivativeManifest] a receiver needs to open this bundle’s derivative tiers (#556).

One per shipped DerivativeBlob, plus one per format = "original" sentinel tier, which has no blob of its own and is only this manifest: without it a receiver could not tell “this tier is the original” from “this tier is missing”. In the order the library recorded them. A manifest whose derivative is skipped is skipped with it, so nothing here names a blob the bundle does not carry.

Signed CBOR, not ciphertext: like Self::provenance_blob it is deliberately server-visible (it holds no plaintext secret by construction), and it is served back unchanged so the receiver verifies the bytes the producer signed.

§created_by_user: Uuid

The authoring user.

§created_by_device: Uuid

The authoring device.

§client_version: String

The exact client build that authored the create manifest.

§timestamp: String

RFC3339 authoring timestamp of the create manifest.

§action: Action

The create manifest’s lifecycle action: create.

§prior_provenance_hash: Option<Hash32>

The create manifest’s prior-provenance link: null, as for every create.

§retention_until: Option<String>

The create manifest’s retention floor: unset, as it is set only for delete.

Implementations§

Source§

impl UploadBundle

Source

pub fn ciphertext_size(&self) -> u64

The original ciphertext’s size in bytes — what POST /upload declares as size for the original blob.

Trait Implementations§

Source§

impl Clone for UploadBundle

Source§

fn clone(&self) -> UploadBundle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UploadBundle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more