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§
- Session
Registry - 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.
- Session
Slot - One admitted session. Dropping it frees the slot, however the session ended.
Functions§
- default_
principal_ key - The default principal key (
PrincipalKeyFnin a binding config): the principal’sactor.id, else the auth identity’sid, else itssub. 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.