Module admission
Expand description
Admitting a subscription session, whatever carries it
(docs/design/subscriptions-websocket.md §6.3): the first frame must be
Init, its headers stand in for the handshake’s when present, and a
refusal’s close code follows the error’s status.
Structs§
- Handshake
- What the handshake (WebTransport CONNECT, WebSocket upgrade) carried that authentication needs later.
Functions§
- authenticate_
session - Runs the app’s
AuthProviderover the handshake request.Initheaders, when present, stand in for the handshake’s: that is how a browser, which cannot set headers onnew WebTransport(url)ornew WebSocket(url), presents credentials. A native client sends them on the handshake and an emptyInit. - init_
headers - The first frame must be
Init: its headers, elseNone. - refusal_
close_ code - The close code a refusal ends the session with, from the error’s HTTP
status: 401 → 4401 and 403 → 4403, as on REST; a malformed
Init→ 4400; and a provider that could not decide (5xx: a key server down) → 4500, which is not a verdict on the credentials — a client must retry later rather than sign the user out.