Expand description
Op-layer for the backup-blob byte transport (GET/POST /backup/blob/{id}).
The token-gated state machine that moves the staged .vtabak bytes —
GET streams an export bundle (one-shot, delete-before-flip), POST
accepts an import upload (size + SHA-256 verified) — lives here. The
HTTP route adapters in routes/backup_blob.rs handle only transport
concerns (path/header parsing, body cap, response framing) and
delegate the state machine to these two functions.
See docs/05-design-notes/backup-descriptor-pattern.md for the full
state machine, and §“Auth model” for why the bearer token — not a
JWT — is the authenticator.
Functions§
- read_
export_ blob - Download the encrypted bytes of an export bundle. One-shot: on
success the record transitions to
ExportDownloaded(terminal) and the bytes are removed from disk. - write_
import_ blob - Accept the encrypted upload for an import bundle. The body’s
SHA-256 must match the record’s
expected_sha256; the byte count must matchexpected_size_bytes. On success the state moves toImportReceived(no further uploads accepted against this bundle_id).