Expand description
Host identity and pairing (kernel spec §4): the hosts registry, one-time
pairing codes, and the check of a host’s hello proof (ACP core §3.5).
Every query names the database’s owner (kernel spec §1), bound when the
registry opens (db::kernel_owner): another owner’s host is unknown
here, and another owner’s code pairs nothing.
Every time is seconds since the Unix epoch and is passed in by the
caller (secret::unix_now() in production), so expiry is testable
without sleeping.
Structs§
- Enrollment
- What a host sends to enroll (kernel spec §4.1), besides the code.
- Host
Record - One paired host, as
GET /api/hostslists it. - Hosts
- Pairing
Code - A freshly minted pairing code, shown once.
- TooMany
Pairing Codes - A mint refused because
MAX_LIVE_PAIRING_CODEScodes are live.
Enums§
- Enroll
Outcome - The outcome of
Hosts::enroll. - Hello
Check - The verdict on a
hello(ACP core §3.5). - Registered
- The outcome of
Hosts::register. - Revoke
- The outcome of
Hosts::revoke.
Constants§
- MAX_
AGENTS - The most agents of a
hello.mcp_isolationthe registry keeps (plan 8e). - MAX_
LIVE_ PAIRING_ CODES - At most this many pairing codes are live (unspent and unexpired) at
once; a mint past it is refused with
TooManyPairingCodes. - MAX_
PATH - The longest path the collector stores or shows from a host, in bytes.
- MAX_
ROOTS - The most workspace roots stored per host (decision 7).
- PAIRING_
CODE_ TTL_ SECS - A pairing code is valid this long (kernel spec §4.1).
Functions§
- is_
displayable_ path - Whether a path a host reported can be stored and shown (decision 7, the
review’s A6): absolute and
is_displayable_textwithinMAX_PATH. It is shown, never trusted: the host enforces its own fence. - is_
displayable_ text - Whether text a host sent can be shown (the review’s A6): at most
maxbytes, with no control or invisible format character. - normalize_
code - A pairing code as typed, reduced to its eight canonical characters:
case, dashes and spaces ignored,
Oread as0,IandLas1. - parse_
public_ key - A hex Ed25519 public key that is a valid point and not of small order.
- verify_
proof - Whether
proof(hex) ispublic_key’s signature over the hello message for this nonce, host id and protocol version.