pub struct ManifestCore {Show 22 fields
pub version: String,
pub crypto_suite_id: u16,
pub protocol_version: String,
pub file_id: Uuid,
pub album_id: Uuid,
pub amk_version: AmkVersion,
pub ciphertext_hash: Hash32,
pub plaintext_size: u64,
pub chunk_size: u32,
pub nonce_prefix: [u8; 7],
pub key_mode: KeyMode,
pub wrapped_file_key: Option<WrappedFileKey>,
pub metadata_blob_hash: Option<Hash32>,
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>,
pub upgraded_from: Option<UpgradeLineage>,
pub unknown: BTreeMap<String, Value>,
}Expand description
The signed core of an asset manifest — every field the two signatures cover.
Unknown keys survive under the signature (Versioning — invariant 2). A key this build
does not know is kept verbatim in Self::unknown, re-emitted by the canonical encoder
beside the known fields, and therefore covered by both signatures: a newer writer’s manifest
that only adds a field verifies here, and stripping that field fails verification. The
decoder is hand-written for that reason (see the Deserialize impl below): serde(flatten)
buffers unknown values through serde’s private content type, which cannot hold a CBOR tag
or an integer wider than 64 bits, so a future field carrying either would make the whole
manifest undecodable instead of preserved.
Fields§
§version: StringSchema version string (asset-manifest/v1).
crypto_suite_id: u16The primitive bundle this manifest was produced under.
protocol_version: StringDate-based wire protocol version; matches the album pin.
file_id: UuidThe asset’s file id.
album_id: UuidThe album the asset belongs to.
amk_version: AmkVersionThe AMK epoch (and write-tier key) this manifest is authorized under.
ciphertext_hash: Hash32Content-address digest over the ciphertext.
plaintext_size: u64Total plaintext byte length.
chunk_size: u32Plaintext bytes per STREAM chunk.
nonce_prefix: [u8; 7]STREAM nonce prefix (random per file).
key_mode: KeyModeHow the file key is obtained: derived (default; wire-absent) or wrapped (an
adopted web-upload drop). Closed enum — see KeyMode for the wire-presence rule.
wrapped_file_key: Option<WrappedFileKey>The AMK-sealed file key; present iff key_mode = wrapped, wire-absent otherwise.
metadata_blob_hash: Option<Hash32>Content address of the asset’s encrypted metadata blob. Present on
create | replace | metadata-update; wire-absent (key omitted, never null) on
delete | derivative-* | trash-restore.
created_by_user: UuidThe account whose device signed this record.
Per-record, not per-asset: a delete written by a second device — or by a member of a
shared album — names that writer, not the account that created the asset. The asset’s
original creator is recoverable from the create record at the head of the append-only
provenance chain, which is where it belongs.
The pairing with Self::created_by_device is load-bearing rather than descriptive:
verify_asset resolves the device inside
this account’s published directory (step 6) and verifies AssetManifest::device_sig
under that entry’s key (step 8), so a record naming anyone but its own signer cannot
verify. Album write authority is decided separately, by write_sig at step 10.
created_by_device: UuidThe device that signed this record, resolved in Self::created_by_user’s directory.
Per-record for the same reason and with the same consequence: it must be the device whose
DSK produced AssetManifest::device_sig, or step 8 of
verify_asset rejects the manifest. The
server mirrors the resolvable half key-free as invariant 7 — the device must be in the
calling account’s published directory, with added_at before the manifest’s timestamp.
client_version: StringProducing client version string.
timestamp: StringSelf-asserted capture/write time (RFC3339). Audit-only; never load-bearing.
action: ActionThe lifecycle action.
prior_provenance_hash: Option<Hash32>SHA-256 of the previous manifest in this asset’s chain; null iff action = create.
retention_until: Option<String>Server-visible retention deadline (RFC3339); set only for action = delete.
upgraded_from: Option<UpgradeLineage>The album this asset’s album was forked from, when it is a fork.
The normative link between an upgraded album and its predecessor — never the MLS group name, which is an internal detail. A device that joins the fork reads this and can walk back to the album the asset came from; without it, a fork looks like an unrelated album full of assets that appeared from nowhere.
Wire-absent when there is none, never present-null. This is inside the signed core,
so a present-null would change signing_bytes and silently break
re-verification of every manifest written before the field existed — the same trap
dek_public avoids, and the reason
an_absent_lineage_is_wire_absent_and_does_not_move_the_signature exists.
unknown: BTreeMap<String, Value>Keys a newer writer added that this build does not know, preserved verbatim and signed over. Empty (and so wire-absent) on everything this build writes.
A key here must never collide with a known field name: the decoder only ever places the keys it did not recognise here, and a caller building a core by hand must do the same.
Implementations§
Source§impl ManifestCore
impl ManifestCore
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
The canonical bytes both signatures cover.
Sourcepub fn sign(
self,
device: &dyn Signer,
write_tier: &dyn Signer,
) -> Result<AssetManifest, CryptoError>
pub fn sign( self, device: &dyn Signer, write_tier: &dyn Signer, ) -> Result<AssetManifest, CryptoError>
Sign this core with the device DSK and the epoch write-tier key. Fallible because the device signer may be hardware-backed (the write-tier key is always software).
Trait Implementations§
Source§impl Clone for ManifestCore
impl Clone for ManifestCore
Source§fn clone(&self) -> ManifestCore
fn clone(&self) -> ManifestCore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ManifestCore
impl Debug for ManifestCore
Source§impl<'de> Deserialize<'de> for ManifestCore
impl<'de> Deserialize<'de> for ManifestCore
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for ManifestCore
Source§impl PartialEq for ManifestCore
impl PartialEq for ManifestCore
Source§fn eq(&self, other: &ManifestCore) -> bool
fn eq(&self, other: &ManifestCore) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ManifestCore
impl Serialize for ManifestCore
impl StructuralPartialEq for ManifestCore
Auto Trait Implementations§
impl Freeze for ManifestCore
impl RefUnwindSafe for ManifestCore
impl Send for ManifestCore
impl Sync for ManifestCore
impl Unpin for ManifestCore
impl UnsafeUnpin for ManifestCore
impl UnwindSafe for ManifestCore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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