Skip to main content

AuthSession

Trait AuthSession 

Source
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§

Source

fn auth_client(&self) -> &AuthClient

Return the shared client that owns this session’s lifecycle.

Provided Methods§

Source

fn store_name(&self) -> &'static str

Identify the active credential store.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn logout<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Remove the persisted credential under its refresh lock.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl AuthSession for dbx_tools_auth::client::AuthClient

Source§

impl AuthSession for dbx_tools_databricks_auth::AuthClient