Skip to main content

Module bus_frames

Module bus_frames 

Source
Expand description

Who a WebSocket bus:send, bus:inject or bus:broadcast frame may name as its sender. A frame carries no token, so the only identity a connection has is the one it registered with (bus:register); the frame’s from has to be that agent. A frame that names no sender is sent as unknown, which claims nothing. A registration is itself proven: it carries the agent’s token, and the agent it names must be the one that token was minted for.

Functions§

frame_allowed 🔒
Whether a bus:* frame may be acted on: a bus:register is proven by its token, a send, inject or broadcast by the registration; other frames claim nothing.
priority 🔒
The priority a frame asks for; anything unrecognised is normal.
proven_slug 🔒
The slug a bus:register frame carrying token may register as: the token has to be one this srv minted, and agent_id a name only that token’s agent answers to.
sender_allowed 🔒
Whether a frame from a connection registered as registered (empty: it never registered) may name from. Two names are the same agent when they resolve to one id, as check_s1 compares them.