Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn display_name(&self) -> &str;
    fn credential_files(&self) -> Vec<CredentialFile>;

    // Provided method
    fn validate<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for auth credential providers.

Implement this trait to add support for syncing credentials of any dev tool. Each provider declares its name, the credential files it manages, and optionally a validation method to check credential freshness.

Required Methods§

Source

fn name(&self) -> &str

Unique name for this provider (e.g. “gh”, “claude”).

Source

fn display_name(&self) -> &str

Human-readable display name.

Source

fn credential_files(&self) -> Vec<CredentialFile>

List of credential files/directories this provider manages.

Provided Methods§

Source

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

Validate whether the current local credentials are still valid. Defaults to ValidationResult::Unknown.

Implementors§