1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! **A tool host presents its set** (REMOTE §5, bl-4e08) — the executor behind
//! [`Action::Advertise`](crate::boundary::Action::Advertise), beside
//! [`delete_exec`](super::delete_exec) and for its reason: everything else in
//! the chokepoint routes, and these *gate*.
//!
//! The gate here is **who is asking**, not what was named. Every other action
//! is authorized by the workspace it addresses (REMOTE §4's one filter); this
//! one addresses no workspace at all, because a tool set is a fact about a
//! machine and the registration listing already says which workspaces see it.
//! So its authorization is the identity the intake carries — the connection's
//! certificate common name, read exactly where scoping reads it — and an intake
//! that carries none refuses **in band**, with a sentence, rather than being
//! silently dropped: an operator typing this at a terminal has made a category
//! error worth naming, not committed an authentication failure.
use crate;
use Deps;
use crateReply;
/// Validate the set and store it under the caller's own identity, writing only
/// when it differs from what is stored (REMOTE §5) — **answer whether it
/// wrote** (REMOTE §5.1, bl-66d4) — and **end whatever read this certificate
/// holds** (REMOTE §5.1, bl-96e0).
///
/// [`tools::store`] has always computed that bool and this executor used to
/// discard it, so a box re-presenting an unchanged set and a box restoring a
/// set some other connection blanked were answered the identical `ok`. The
/// second of those is two processes claiming one machine's name; `wrote` on a
/// re-assertion is the sentence that makes it audible (thrall bl-2d78).
///
/// **An advertisement is an activation, and an activation takes the queue.** A
/// foot presents its set when it takes a channel up — at process start and on
/// every redial — and never while its own read is parked, so a read still
/// parked under this certificate when one arrives is a predecessor: the
/// process a supervisor just killed, the connection a network change stranded,
/// or a second process bearing the same name. The server cannot tell those
/// apart and no longer has to: the set comes into force, the parked read is
/// ended and *told* ([`Mailbox::supersede`](crate::registry::mailbox::Mailbox::supersede)),
/// and the read this caller makes next is the reader.
///
/// It replaces a guard that refused a CHANGED set while a read was parked
/// (bl-1462), which protected a serving machine from being disarmed without
/// learning of it. That guard could not tell a serving machine from a dead
/// one's claim — a parked read sleeps through its peer's death for the rest of
/// its hold — so it refused exactly the restart that follows an edited tool
/// document. What it protected is kept by other means: the machine that loses
/// its queue is now told so, at once.
///
/// The read is ended **after** the store, so an advertisement that is refused
/// — invalid, registered nowhere, unwritable — ends nothing.
pub
/// **An advertisement into nothing is told so** (REMOTE §5.1, bl-6b14). A set
/// is presented into the workspaces its client is registered in, so a client
/// registered in NONE presents it to nobody — and that was answered `ok`, with
/// the set stored, no line on the server's stderr, no row on the ops trail and
/// no row in any roster (a roster is per workspace, and this client is in
/// none). The documented way to provision a second machine produced exactly
/// that state: `wire-certs WIRE_LEAF=` mints a leaf and registers nothing, so
/// the foot dialled, handshaked, advertised and parked on its mailbox read,
/// useful to no one, silently, at both ends.
///
/// It refuses rather than warning because the alternative is the silence this
/// closes: a foot's only reader is a program, and a program acts on an `ok`. It
/// refuses **before the store**, so nothing is written for nobody to see; the
/// host re-presents its set on its next connection, which is REMOTE §5's own
/// traffic shape, so the registration and a reconnect are the whole remedy.