pub trait AuthSession: Send + Sync {
// Required method
fn auth_client(&self) -> &AuthClient;
// Provided methods
fn store_name(&self) -> &'static str { ... }
fn token_with_login<'life0, 'async_trait>(
&'life0 self,
login: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn token_or_login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn force_refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn refresh_rejected_token<'life0, 'life1, 'async_trait>(
&'life0 self,
stale: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn logout<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Expand description
A provider wrapper that inherits the canonical credential lifecycle.
Implement only auth_client; the defaults retain locking, refresh, and
refresh-token redaction in the shared client rather than in each provider.
Required Methods§
Sourcefn auth_client(&self) -> &AuthClient
fn auth_client(&self) -> &AuthClient
Return the shared client that owns this session’s lifecycle.
Provided Methods§
Sourcefn store_name(&self) -> &'static str
fn store_name(&self) -> &'static str
Identify the active credential store.
Sourcefn token_with_login<'life0, 'async_trait>(
&'life0 self,
login: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn token_with_login<'life0, 'async_trait>(
&'life0 self,
login: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Resolve binding login policy: true forces login, false forbids it, None allows it.
Sourcefn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Explicitly acquire and persist a new credential.
Sourcefn token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Load or renew a credential without initiating an interactive login.
Sourcefn token_or_login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn token_or_login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Load or renew a credential, allowing login when none is stored.
Sourcefn force_refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn force_refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Renew the stored credential even when it has not reached its refresh window.
Sourcefn refresh_rejected_token<'life0, 'life1, 'async_trait>(
&'life0 self,
stale: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn refresh_rejected_token<'life0, 'life1, 'async_trait>(
&'life0 self,
stale: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Token, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Reuse another caller’s replacement or renew the rejected credential.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".