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
//! The local wire: frames in, control values out.
//!
//! Three layers, each refusing what the one above it cannot see:
//!
//! * [`frame`] — the `[u32 body_length][u8 kind][body]` codec. Length bounds
//! are checked against the ANNOUNCED length, before allocation, and the
//! connection's byte budget is charged for the whole frame.
//! * [`strict`] — the validating JSON decoder ADR 0001 requires: recursive
//! duplicate keys, unknown fields, invalid UTF-8, trailing bytes.
//! * [`hello`] — the handshake. Major matches exactly, minor negotiates down,
//! capabilities intersect, and the whole thing is on a deadline.
//! * [`listen`] — the socket itself: where it may live, who may connect, and
//! what is removed when the daemon stops.
//!
//! Authentication is [`listen`]'s, not the handshake's. The UDS peer credential
//! is the only identity this kernel has (ADR 0002) and it is checked before a
//! single byte of the connection is read, so an unauthorized peer never reaches
//! the decoder at all. Nothing in a hello can widen what a connection may do —
//! `client` is a log label and the capability set is a feature list.
use ;
/// A refusal on the wire, already carrying the code it will be sent as.
///
/// Same shape as [`crate::project::Refusal`] and deliberately separate: that
/// one answers a COMMAND and can be turned into a `KernelResult`, while this
/// one can also mean the connection itself is unusable — an I/O failure or a
/// budget exhausted mid-frame has no request to answer.