Hook: a connection has been authorized and is about to be admitted. Runs afterprotectedonAttach(_att):void|Promise<void>
authorize resolved the
connection’s claims and before anything is sent to it. Inspect
att.claims (and att.req, the upgrade request carrying front-door
identity headers) and call att.close(code?, reason?) (or throw) to
veto: a vetoed socket is closed, receives no frames, and is never
counted in attachments. The default
implementation admits every authorized connection.
Parameters
Returns
void | Promise<void>
Attachment
One authorized client connection, as handed toAgent.onAttach (and to the
socket server’s onAttach hook) right before the connection is admitted.
Inspect claims and call
close to veto the connection: a vetoed socket
is closed immediately, never admitted as a watcher, and receives no
protocol frames.
Properties
claims
The claims this connection was granted by the authorization policy.readonlyclaims:ReadonlySet<Claim>
req?
The connection’s upgrade request, when the host provided one. Identity headers stamped by an authenticating front door ride here, so a veto can consider the caller’s identity as well as its claims. Methods close()readonlyoptionalreq?:Request
close(Veto this connection: close the socket now. It is never admitted and receives no frames. Parameterscode?,reason?):void
Returns
void