Skip to main content

AuthProviderFlow

Trait AuthProviderFlow 

Source
pub trait AuthProviderFlow: Send + Sync {
    // Provided methods
    fn login<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AuthFlowContext<'life2>,
        _profile: &'life3 str,
        _device_code: bool,
        _import: Option<&'life4 Path>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             Self: 'async_trait { ... }
    fn paste_redirect<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AuthFlowContext<'life2>,
        _profile: &'life3 str,
        _input: Option<&'life4 str>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             Self: 'async_trait { ... }
    fn refresh_status<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AuthFlowContext<'life2>,
        _profile_override: Option<&'life3 str>,
    ) -> Pin<Box<dyn Future<Output = Result<RefreshStatus, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait { ... }
}

Provided Methods§

Source

fn login<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _ctx: &'life1 AuthFlowContext<'life2>, _profile: &'life3 str, _device_code: bool, _import: Option<&'life4 Path>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, Self: 'async_trait,

Run the OAuth login flow. The default impl bails — only providers with an OAuth login flow override. import is a path to an existing token-set JSON file for providers that support importing already-issued credentials (OpenAI Codex ~/.codex/auth.json).

Source

fn paste_redirect<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _ctx: &'life1 AuthFlowContext<'life2>, _profile: &'life3 str, _input: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, Self: 'async_trait,

Resume an OAuth login from a paste-redirect URL/code. The default impl bails for providers that don’t expose a browser flow.

Source

fn refresh_status<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _ctx: &'life1 AuthFlowContext<'life2>, _profile_override: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<RefreshStatus, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Refresh the access token for profile_override (or active profile) and report status. Default impl bails for providers without a refresh flow.

Implementors§