Skip to main content

Module jekt_cloud

Module jekt_cloud 

Source
Expand description

Files sent with a jekt over the cloud relay (docs/specs/SPEC_JEKT_FILE_TRANSFER_2026_10_05.md §4.4).

Sending: each file is encrypted (AES-256-GCM, a fresh key per file and send), uploaded to a URL the relay issues (POST /reactive/blob), and named in a cloud manifest with its key and blob id. The key is sealed to the install that runs the target when its lease offers a key (jekt_seal, spec §7), and travels as plain base64 to an older one. The jekt’s msgid is rebound to that manifest, so srv’s WAN signature covers keys and blob ids too. Receiving: after the claim, each blob is downloaded through a URL the relay issues to the target alone (GET /reactive/blob/:id), decrypted and checked against its hash, then stored like any received file.

Constants§

B64 🔒
OVERHEAD 🔒
Bytes a blob adds to its file: the nonce in front, the GCM tag behind.
TRANSFER_TIMEOUT 🔒
An upload or download may take this long; the relay’s URLs live 300 s.

Functions§

fetch 🔒
On the receiving side, after the claim: check a cloud manifest, then fetch, decrypt and store each file, setting req.files for jekt_files::prepare to list. Err when the relay couldn’t be reached, so the caller releases the claim for a retry; a file that is gone, tampered with or undecryptable is left out and listed as missing.
file_key 🔒
The key f’s blob opens with, using agent_id’s WAN key on this install for a sealed one. Err says why not.
open 🔒
Decrypt a blob seal made; None if the key, nonce or tag don’t match.
open_key 🔒
A plain key decoded, or a sealed one opened with the WAN keypair wan_key gives (asked for only then).
recipient 🔒
The key to seal target’s files to, from its lease’s offer, checked against the agent’s record in the account’s key directory. Err says why not, after the target’s name: a holder that offers a key gets sealed keys or nothing, never plain ones.
relay 🔒
Send req and its files through the relay: Ok(Some(answer)) once the relay queued it, Ok(None) when this instance has no relay or the relay didn’t take it (the caller holds or refuses), Err with why the files can’t go that way at all.
seal 🔒
Encrypt plain under a fresh key: the blob (nonce, ciphertext, tag) and the key.
store_fetched 🔒
Put a fetched file’s bytes in the store: derived on the way in when the sender is proven, else placed as they came.
takes_cloud_files 🔒
Whether the target’s lease holder can fetch files from the relay: only a live holder that says so. Err says why not, after the target’s name.
upload 🔒
Encrypt and upload each file, sealing its key to seal_to when there is one; the request to relay, its files named by the cloud manifest and its msgid bound to it.