session
Module: session
Section titled “Module: session”Contents
Section titled “Contents”Structs
NativeSession- Supplies short-lived access from a saved renewable login.SessionAccess- An access token and the saved connection it was issued for, read under
Enums
SessionError- Why a saved native login could not provide access.
firma_login::session::NativeSession
Section titled “firma_login::session::NativeSession”Struct
Supplies short-lived access from a saved renewable login.
The access token and refresh UUID exist only in this process. The store’s exclusive lock covers loading R0, every bounded retry, and replacing it with R1, so another process waits and then reads the successor.
Methods:
fn new(store: ConnectionStore) -> Self- Usesstoreas the single source of the renewable credential.fn access_token(self: & mut Self) -> Result<&SessionAccess, SessionError>- Returns cached access or rotates and saves the renewable credential.
firma_login::session::SessionAccess
Section titled “firma_login::session::SessionAccess”Struct
An access token and the saved connection it was issued for, read under the same lock that obtained it.
Methods:
fn token(self: &Self) -> &SecretString- The bearer token; never log or format it.fn origin(self: &Self) -> &ControlPlaneOrigin- The Control Plane that issued the token, the only one it may reach.fn workspace_id(self: &Self) -> WorkspaceId- The Workspace the token speaks for.
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_login::session::SessionError
Section titled “firma_login::session::SessionError”Enum
Why a saved native login could not provide access.
Variants:
LoginRequired{ login: crate::LoginCommand }- This process can no longer safely reuse the saved credential.LoginExpired{ login: crate::LoginCommand }- The Control Plane no longer renews the saved login: it expired, wasMissingConnection- No login is saved locally.MissingCredential{ login: crate::LoginCommand }- The saved renewable credential could not be read.NotRenewable{ login: crate::LoginCommand }- The saved login is access-only: it has no renewable credential.BlockingTask(tokio::task::JoinError)- A blocking store operation could not complete.Store(firma_connection_store::StoreError)- The saved connection could not be read or replaced.Origin(crate::ControlPlaneOriginError)- The saved Control Plane origin is no longer valid.TokenSetup(crate::NativeTokenError)- Token-client setup failed before a refresh request was sent.RenewalRefused{ login: crate::LoginCommand, source: crate::NativeTokenError }- The Control Plane answered a refresh in a way no retry can change.RefreshFailed{ login: crate::LoginCommand, source: crate::NativeTokenError }- A refresh request was sent but did not yield a usable successor.SaveAfterRefresh{ login: crate::LoginCommand, source: firma_connection_store::StoreError }- The successor was issued but could not replace the saved credential.IdentityMismatch{ login: crate::LoginCommand }- The refresh response named a different saved identity.
Trait Implementations:
- From
fn from(source: tokio::task::JoinError) -> Self
- Error
fn source(self: &Self) -> ::core::option::Option<&dyn ::thiserror::__private21::Error>
- From
fn from(source: NativeTokenError) -> Self
- From
fn from(source: StoreError) -> Self
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- From
fn from(source: ControlPlaneOriginError) -> Self