Expand description
Zero-config machine token for a loopback synaps auth-broker (#147 C1).
A loopback broker started without --machine-token-file /
SYNAPS_BROKER_TOKEN generates a random token into
<base_dir>/auth-broker.token (0600, next to auth.json) and requires
it like any other machine token. A client whose broker endpoint is a
loopback URL and that has no auth.machine_token /
SYNAPS_MACHINE_TOKEN reads the same file, so synaps → local broker
keeps working with no extra configuration for the same user/base dir.
Structs§
- Machine
Token - The machine token a client presents to a broker, with its provenance.
Enums§
- Broker
Token Origin - How
load_or_create_broker_tokenobtained the token.
Constants§
- LOCAL_
BROKER_ TOKEN_ FILE - File name of the auto-generated loopback broker token.
Functions§
- is_
loopback_ endpoint - True when
endpointis an http(s) URL whose host is loopback (localhost,127.0.0.0/8,::1). - load_
or_ create_ broker_ token - Broker side: read the token at
path, or create it when absent. - local_
broker_ token_ path <base_dir>/auth-broker.token.- read_
local_ broker_ token - Client side: the local broker token, if the file exists and is non-empty.
- unauthorized_
hint - Actionable text for a broker 401 (client side).