pub enum CredentialState {
Active,
Expired {
expires_at: u64,
},
SignedOut,
Unreadable(String),
}Expand description
Why there is no usable Parslee access token — for ERROR MESSAGES, not for control flow.
access_token_refreshing returns a bare Option, so every failure renders
as “no credential … run car auth login”. That reads as never
authenticated, and the three states below need different remedies: a token
that aged out mid-run is not the same problem as a signed-out account, and
neither is a keychain that momentarily could not be read. A long job dying
on the first with the message for the second is Parslee-ai/car#797.
Consulted only on the failure path, so the extra store read costs nothing in the hot path.
Variants§
Active
Credentials exist and the access token is not past expiry.
Expired
Credentials exist but the access token is expired (or within the refresh skew) and refresh did not yield a new one — commonly because the refresh token itself is spent, or the network refused.
SignedOut
A published tombstone: no account is active. This is the only state that genuinely means “log in”.
Unreadable(String)
The credential store could not be read at all (locked keychain, helper timeout). Says nothing about whether credentials exist.
Trait Implementations§
Source§impl Clone for CredentialState
impl Clone for CredentialState
Source§fn clone(&self) -> CredentialState
fn clone(&self) -> CredentialState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more