Expand description
Album provisioning — telling the server an album exists.
A container album’s id is derived from the account master key
(Organization — The Default Album), so the client knows it before the server does. This
module is the one call that closes that gap: POST /v1/albums binds the derived UUID to
the authenticated owner, so invariant 6 (“album exists; the caller has write capability
on it”) can pass for an album the client named. Every push runs it first —
crate::push::ensure_album is the step, this module is the wire.
Idempotent, and that is the whole point. The same id arrives from every device the
user owns, and again after a passphrase recovery on a fresh one. Re-provisioning is a
success that writes nothing (created: false), so a client needs no
“have I registered this album yet?” flag — which is precisely the synced pointer the
master-key derivation exists to avoid. Pushing twice therefore cannot error here.
No name crosses the wire. The request body carries the id and nothing else; album titles live in the encrypted sidecar and the server is not entitled to them.
Lifecycle ops ride here too. AlbumClient::apply_op sends one signed delete,
trash-restore or other bytes-free lifecycle manifest to POST /v1/albums/{album_id}/ops
and types the refusal (LifecycleOpError), so every client tells a closed retention window
(retention_elapsed, final for the asset) from a stale chain or a transient fault the same
way. The op’s envelope (op_envelope), which records of a chain go to the server
(chain_after, stretch_after), and when they are held instead (plan_delivery) are
defined here once, for every client that sends one.
Re-exports§
pub use crate::upload::StaticToken;
Structs§
- Album
Client - The album-provisioning client.
- Album
Transport - The authorized HTTP transport for the album surface: the album endpoint root (no trailing
slash —
POST {base}provisions) plus the authorization seam. - Applied
Op - What the server did with one lifecycle op (
POST /v1/albums/{album_id}/ops). - Provisioned
Album - What provisioning an album resolved to. Both cases are successes;
createdis informational — a caller treats a fresh binding and an existing one identically. - Published
Roster - What the server holds for an album after a roster publish.
Enums§
- Album
Error - A failure on the album surface: provisioning, or publishing a roster.
- Held
Delivery - What a delivery does with one asset’s chain (
plan_delivery). - Hold
Reason - Why an asset’s records were not sent.
- Lifecycle
OpError - Why a lifecycle op was not applied.
Functions§
- chain_
after - The records of
records(a chain, oldest first) the server lacks when it holdshead: those after it, which is none whenheadalready is the last; or the last record alone whenheadis unknown or not in the chain, which the server judges (a stale chain is refused, never applied). - judging_
clock - The clock a held stretch is judged by: this device’s (
now), floored by the latestchanged_ata feed drain saw on the server’s clock, so a restore is withheld whenever either clock says the server would refuse it. Onlyplan_deliveryuses it: a retention sweep judges expiry by the server’schanged_atalone, since a device clock running ahead would purge early. - op_
envelope - The server-visible projection of a lifecycle manifest: every field verbatim, naming the original’s ciphertext, and no derivative (the server refuses the pair on a lifecycle write).
- plan_
delivery - Decide what of
records(an asset’s chain, oldest first) goes to the server, given what its feed lists for the asset (server:Nonewhen it does not list it, otherwise the hash of the head it holds,Nonefor an entry that carries no record) and the judging clock (judging_clock). - stretch_
after - The stretch a delivery sends when the server holds
head:chain_after, except that a server level with the chain is sent the last record alone, which it answers as a replay (a send whose answer was lost). Empty only for an empty chain.