Skip to main content

Module credential

Module credential 

Source
Expand description

Issuer-scoped credential and session identity types.

Per the v16 credential/session profile: credential identifiers are scoped by issuer (iss, jti/cti) and session identifiers are scoped by issuer (iss, sid/workload_session_id). The credential and session namespaces are disjoint by construction — they have separate types, separate stores, and never share a key.

CWT cti is a byte string. It is kept as bytes here and never stringified into the JWT jti text namespace, which would create an ambiguous collision domain. The CredentialValue enum preserves the encoding distinction.

Structs§

CredentialId
Issuer-scoped credential identifier: (iss, jti/cti).
GlobalSessionRegistryAlreadySet
Error returned when the global session registry was already published.
InMemorySessionRegistry
In-memory session registry with TTL cleanup.
InvalidSessionRecord
Error returned when a session registration record is malformed: an empty issuer or session identifier in the key, or an empty subject/tenant in the state (v16 §3.1 malformed-identifier denial, §3.3 record shape).
SessionExists
Error returned when a session already exists at the given key.
SessionKey
Issuer-scoped session key: (iss, sid/workload_session_id).
SessionKindMismatch
Error returned when a session key’s identifier variant disagrees with the session state’s kind (v16 §3.3 coherence requirement).
SessionPublicationFailed
Error returned when the session authority could not durably accept a registration (durable write / transport failure) — the session was NOT registered and callers must surface the failure, never proceed as though it succeeded.
SessionRevokeError
The session authority did not durably accept a session revocation.
SessionState
Session state record per v16 §3.3.

Enums§

ActiveOrRevoked
Active-or-revoked session status.
CredentialValue
A credential identifier value — the JWT jti (text) or CWT cti (bytes).
SessionIdentifier
A session identifier — disjoint OIDC sid vs workload session.
SessionKind
Whether a session is interactive (OIDC user login) or workload.
SessionRegisterError
Error returned by SessionRegistry::register_session.

Traits§

SessionRegistry
Session registry: tracks active sessions and their revocation state.

Functions§

global_session_registry
Access the process-global session registry, if published.
set_global_session_registry
Publish the process-global session registry. Called once at startup; a second call returns an error so the caller can detect a publication race.