Expand description
The receiving half: POST /agentmux/remote/op on the peer listener
(spec §4.1-4.2, §6). Every refusal is an answer, status: refused with a
refused_reason, never a prompt and never a downgrade; the order below is the
order of the checks.
- the call came over the LAN key (a peer), not a local credential;
- this machine takes remote operations at all (
network:remote_ops); - the envelope is well formed, and meant for this machine (
audience); - it is fresh (a minute either way) and not older than this srv: the nonce store is in memory, so a request signed before a restart could be replayed after it;
- its signature verifies under the key this machine pins for that agent
(
reactive::lan_signer, the same judgement a LAN jekt gets), and the install the agent’s certificate names, when one is on hand, is the install it claims; - the operation exists, and a state-changing one has a caller whose key is vouched for by a fresh certificate from an install this machine trusts;
- the nonce is new, or the first answer is repeated;
- the operation runs under a
RemoteCaller.
The broadcast lan_key only gets a request here; it never authorizes one.
Structs§
- Entry 🔒
Enums§
- Reservation 🔒
- What a nonce said when it came in.
- Seen 🔒
Constants§
- MAX_
NONCES 🔒 - Answers kept at most. Past this, with every entry still live, a new request is refused rather than evict a nonce a captured copy could then pass as.
- NONCE_
TTL_ 🔒SECS - Longer than the clock window on both sides of it, so a request can’t outlive its nonce.
- RUN_
TIMEOUT 🔒 - How long an operation gets to run before the requester is told it failed.
- UNPROVEN_
AUDIT_ 🔒EVERY_ SECS - UNPROVEN_
AUDIT_ 🔒MAX_ PEERS
Statics§
- NONCES 🔒
- STARTED_
AT 🔒 - When this srv started, in Unix seconds: forced when the routes are built.
- UNPROVEN_
AUDITED 🔒 - Peers whose unproven refusal was written to the audit trail lately, so a flood of bad requests from one address makes one row a minute, not a row each.
Functions§
- audit 🔒
- The audit row on this machine:
remote.<op>, byagent@machine, with how it was proven and how it ended. - audit_
unproven 🔒 - A request refused before its signature verified: nobody is proven, so the row names the peer’s address, not the agent the request claims to be, and keeps none of the request’s own text.
- handle_
remote_ 🔒op - machine_
in 🔒 - The name of the machine at
from, among the LANpeers; a short label when none is known. - machine_
name 🔒 - mark_
started 🔒 - receive 🔒
handle_remote_opwithout the HTTP:nowis the clock andstarted_atwhen this srv began.- reserve 🔒
- settle 🔒