Skip to main content

Module principal

Module principal 

Expand description

Who a session belongs to: the key re-authentication must preserve (design §6.3, “Expiry and refresh”) and the key sessions are counted under (§6.6, “Sockets per principal”).

Structs§

SessionRegistry
Open sessions per key, shared by every session of one server. A poisoned lock is recovered rather than propagated: the guarded state is a counter no panic can leave half-updated, and propagating would turn one panicked task into a refusal of every later session.
SessionSlot
One admitted session. Dropping it frees the slot, however the session ended.

Functions§

default_principal_key
The default principal key (PrincipalKeyFn in a binding config): the principal’s actor.id, else the auth identity’s id, else its sub. A context with none of them is anonymous.
session_key
What a session is counted under: the principal, or the remote IP for an anonymous caller, so one address cannot hold unlimited anonymous sessions either.