CustomAuthenticator

Trait CustomAuthenticator 

Source
pub trait CustomAuthenticator {
    // Required method
    fn set_headers<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        headers: &'life1 mut HeaderMap,
        client: &'life2 ClientWithMiddleware,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthenticatorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for a custom authenticator. This should set the necessary headers in headers before each request. Note that this may be called from multiple places in parallel.

Required Methods§

Source

fn set_headers<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, headers: &'life1 mut HeaderMap, client: &'life2 ClientWithMiddleware, ) -> Pin<Box<dyn Future<Output = Result<(), AuthenticatorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the required headers for authentication. This may use the provided client to perform a request, if necessary. This will be called frequently, so make sure it only makes external requests when needed.

§Arguments
  • headers - Header map to modify.
  • client - Client used to perform any external authentication requests.

Implementors§