Skip to main content

Module move_ops

Module move_ops 

Source
Expand description

The destination’s operations for a move of an agent to this computer (SPEC_MOVE_AN_AGENT_TO_ANOTHER_COMPUTER section 6.2, step D of the build): agent.move.preflight, .offer, .chunk, .status and .abort. Each is a write operation, so the transport has already required a LAN-verified caller whose install this computer trusts.

  • Preflight answers with this install’s box key and what the asker needs to know, signed by this install’s key for this asker and this nonce: LAN answers carry no signature of their own, and the asker seals the move’s key only to a key that verifies.

  • Offer carries the source’s signed summary. It is verified against the install key the caller’s certificate names, the sealed content key is checked to open here, the uid and name are checked against the agents here and on the other computers, and the move is filed in the staging area awaiting the person’s decision: no chunk is taken before it is allowed.

  • Chunk, status, abort are accepted only from the source and requester that made the offer. Only chunk takes a large body.

  • Commit opens the staged chunks into the archive, checks it against what the source signed (import::moved), and registers the agent here, stopped, with its memory and history. It answers registered, and answers the same again when asked again, so a source that lost the answer can ask.

The person’s decision is move_consent.

Structs§

ChunkReq 🔒
CommitClaim 🔒
CommitReq 🔒
MoveReq 🔒
OfferReq 🔒
PreflightReq 🔒
Scratch 🔒
The opened archive never outlives the commit, whatever the outcome.

Enums§

Assembly 🔒
Why the chunks did not become the archive: they are not this move’s (the move is over), or this computer could not read or write a file (the move stays staged to be tried again).

Constants§

MAX_CHUNK_PARAMS 🔒
The largest agent.move.chunk body: one 256 KiB sealed chunk as base64, with the envelope around it.
OFFER_MAX_AGE_MS 🔒
How old an offer may be when it arrives.
STD 🔒

Functions§

abort 🔒
assemble 🔒
The chunks, opened and put together as one file at path: the archive the source wrote. Anything that does not open under the move’s key, or does not add up to the offered size, is not an archive of this move.
chunk 🔒
clash 🔒
Why an offer for this uid and name is refused here: an agent with this id lives here, the name is taken, or another computer on the network hosts an agent of that name.
commit 🔒
commit_blocking 🔒
The commit, on a blocking thread: it reads and writes files.
committing 🔒
The moves being committed here now: a second commit of a move that is being committed is refused, so two calls never share the opened archive or place the agent twice.
counterpart 🔒
The caller as the staging area knows it: the install its certificate names and the agent whose key signed the request.
lan_key_of 🔒
The agent’s LAN key here (made when there is none): the key peers will see it sign with from now on, which the source names in its statement that the name moved.
me 🔒
This install: its id, its keys.
offer 🔒
An offer that is refused is a row too: who sent it and why it was not taken. A refusal after the offer verified is under the move id and names the agent, so it reads next to the source rows; one before it has no move to name, so its id is its own.
parse 🔒
preflight 🔒
receive 🔒
verified is set to the move id and the agent name once the offer has verified, for the row of a refusal after that.
refuse 🔒
registered 🔒
source_key 🔒
The public key of the install the caller’s certificate names. The certificate must be one this computer holds for the caller’s agent, name the same install the request was admitted under, and verify down to its own key.
staging 🔒
status 🔒
status_json 🔒