pub trait SessionRegistry: Send + Sync {
// Required methods
fn session_state<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Option<SessionState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn register_session<'life0, 'async_trait>(
&'life0 self,
key: SessionKey,
state: SessionState,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRegisterError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn revoke_session<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRevokeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_revoked<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Session registry: tracks active sessions and their revocation state.
Per v16 §3.3: revoking a SessionKey rejects every credential and handle
carrying that session ID. The canonical registry is owned by the policy
service and reached over the RPC bus by every other process (mirroring
the credential-revocation authority), so the methods are async.
Required Methods§
Sourcefn session_state<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Option<SessionState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn session_state<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Option<SessionState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up the state of a session, if known. Fail-closed consumers treat
None (unknown, or authority unreachable for a remote registry) as
revoked.
Sourcefn register_session<'life0, 'async_trait>(
&'life0 self,
key: SessionKey,
state: SessionState,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRegisterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_session<'life0, 'async_trait>(
&'life0 self,
key: SessionKey,
state: SessionState,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRegisterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register a new session. Returns Err if a session already exists at
the given key — session identifiers are never reassigned (v16 §3.3).
A revoked session CANNOT be reactivated by re-registration. Also
rejects a key/state kind mismatch (OIDC sid must pair with Interactive,
workload must pair with Workload).
Sourcefn revoke_session<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRevokeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_session<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Result<(), SessionRevokeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke a session: mark it revoked, then evict every credential derived from it.
Ordering: the session’s status is set to ActiveOrRevoked::Revoked
BEFORE credential/handle eviction runs, so a concurrent verification
checking session state fails the revocation check while cached
authority is being flushed.
Returns SessionRevokeError if the revocation authority did not
durably accept the publication; on error no state changes and no
handles are evicted (never a best-effort write).
Sourcefn is_revoked<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_revoked<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Whether a session is currently revoked, expired, or unknown. Returns
true if the session is revoked, expired, OR not found (fail-closed
for unknown sessions).