Expand description
Who in a formation may call whom: the credential a formation launcher issues for each roster edge, the check every member’s door makes, and the channel a member’s runtime is handed its credentials and its callees’ addresses on.
There is one principal per formation, and it is the launcher. After minting the
FormationId, the launcher generates one Ed25519 key pair (FormationAuthority) and signs
one FormationToken for every roster edge from → to:
mft1 "." base64url-nopad(payload JSON) "." base64url-nopad(Ed25519 signature)
payload: {"formation":"frm_…","from":"<member>","to":"<member>"}
signed: FORMATION_TOKEN_DOMAIN ‖ 0x1f ‖ "mft1" ‖ 0x1f ‖ <payload base64url>The signing key exists only in the launcher’s memory: it is never written, never put in an
environment variable and never sent anywhere. Every member is handed the 32-byte public key
(FormationVerifyKey) and nothing that signs, so no member can mint a token.
A token is bound to its audience. to is signed, so a token presented at any door but the
one it was issued for is refused there (FormationRefusal::NotPermitted) and reaches nothing.
Verification order is fixed: tag → signature → payload → formation id, and every failure among
them is the one FormationRefusal::Invalid. Only a token that passed all four is looked at
for its audience, so a forged or foreign token learns nothing about which members exist.
There is no expiry, rotation or revocation list. One formation is one task. The launcher drops the key when the formation is torn down, and a new launch of the same roster has a new id and a new key, so no token outlives what it was issued for.
Tokens reach a member’s runtime and nothing else. The launcher writes each member’s
FormationBundle as the first line of a pipe only that member’s mur run inherits, named by
FORMATION_CHANNEL_ENV, and later lines carry callees’ door URLs as they become known.
FormationMember reads the channel. A guest sees its callees’ names and the virtual address
http://<name>.formation.invalid under the reserved .invalid domain; the runtime’s egress
resolves that to the real door and attaches the token. No token reaches an environment
variable, argv, a file, stdout, the trace, an error or Debug output: FormationToken has no
Display and no Serialize, and FormationToken::expose is the one way to read it.
Structs§
- Formation
Authority - A formation’s signing key: generated by the launcher for one formation and held in its memory alone. Dropping it — at teardown — leaves nothing that can mint for that formation again.
- Formation
Bundle - One member’s credentials, as its channel’s first line carries them:
- Formation
Caller - The member a verified formation token was issued to.
- Formation
Member - One member’s live formation state: who it is, what its door accepts, the tokens for the members it may call, and the door URLs of those members as the channel delivers them.
- Formation
Token - One formation token’s text.
- Formation
Verifier - What one member’s door holds to check a formation token: its formation, its own name, and the formation’s public key.
- Formation
Verify Key - A formation’s 32-byte Ed25519 public key.
Enums§
- Formation
Refusal - Why a formation token was not let in.
Constants§
- FORMATION_
ADDRESS_ WAIT - How long a guest’s request to a callee waits for that callee’s address to arrive on the channel before it is refused.
- FORMATION_
CALL_ SCOPES - Exactly what a valid formation token reaches at the door it was issued for: starting a task,
and reading, listing, cancelling and subscribing to the tasks this member started. The door
answers every other task as it does an id it never held. No
SendStreamingMessage, sinceSendMessageandSubscribeToTasktogether reach everything it would, and nothing that watches or stops the session or reads files. - FORMATION_
CHANNEL_ ENV - The variable a formation launcher sets in each member’s environment, naming the inherited file
descriptor its formation channel is read from. Set by
mur run --rosterand nothing else. - FORMATION_
CHANNEL_ FIRST_ LINE_ DEADLINE - How long a member waits for its channel’s first line before its launch is refused.
- FORMATION_
CREDENTIAL_ PREFIX - The prefix of the door credential a formation token is let in as:
member:<from>. A declared credential name cannot contain:, so the two never collide. - FORMATION_
PEER_ DOMAIN - The reserved domain every virtual callee address sits under.
.invalidnever resolves (RFC 6761), so a request that escaped the runtime’s egress reaches nobody. - FORMATION_
TOKEN_ DOMAIN - The signature domain of a formation token. Distinct from every MAC domain, so no other token family’s bytes are ever a formation token’s signed input.
- FORMATION_
TOKEN_ TAG - The version tag of a formation token.
Functions§
- is_
formation_ host - Whether
hostlies underFORMATION_PEER_DOMAIN, in any letter case. Every such request is the runtime’s to route or to refuse; none is ever sent as written. - parse_
address_ line - Read an address line. Every URL must be
http://host:port. The error never quotes the line. - render_
address_ line - One address line:
{"addresses":[{"name":"coder","url":"http://127.0.0.1:41873"}]}. - virtual_
member - The member
authoritynames when it is exactly<name>.formation.invalid— one label, no port, no user info — orNone. - virtual_
url - The virtual address a guest calls
nameat:http://<name>.formation.invalid.