Trait osauth::AuthType

source ·
pub trait AuthType: Debug + Sync + Send {
    // Required methods
    fn authenticate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: &'life1 Client,
        request: RequestBuilder
    ) -> Pin<Box<dyn Future<Output = Result<RequestBuilder, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_endpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        client: &'life1 Client,
        service_type: &'life2 str,
        filters: &'life3 EndpointFilters
    ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn refresh<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: &'life1 Client
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for an authentication type.

An OpenStack authentication type is expected to be able to:

  1. get an authentication token to use when accessing services,
  2. get an endpoint URL for the given service type.

An authentication type should cache the token as long as it’s valid.

Required Methods§

source

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, client: &'life1 Client, request: RequestBuilder ) -> Pin<Box<dyn Future<Output = Result<RequestBuilder, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Authenticate a request.

source

fn get_endpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, client: &'life1 Client, service_type: &'life2 str, filters: &'life3 EndpointFilters ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Get a URL for the requested service using the provided client (if needed).

source

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

Refresh the authentication (renew the token, etc).

Implementors§