Skip to main content

BearerTokenProvider

Trait BearerTokenProvider 

Source
pub trait BearerTokenProvider: Send + Sync {
    // Required method
    fn get_token<'life0, 'async_trait>(
        &'life0 self,
        args: ProviderTokenArgs,
    ) -> Pin<Box<dyn Future<Output = Result<String, BearerTokenError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Provider-side callback used to acquire bearer tokens for BYOK providers.

Experimental. This trait is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

Required Methods§

Source

fn get_token<'life0, 'async_trait>( &'life0 self, args: ProviderTokenArgs, ) -> Pin<Box<dyn Future<Output = Result<String, BearerTokenError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Acquire a bearer token without the Bearer prefix.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> BearerTokenProvider for F
where F: Fn(ProviderTokenArgs) -> Fut + Send + Sync, Fut: Future<Output = Result<String, BearerTokenError>> + Send,