[][src]Trait osauth::AuthType

pub trait AuthType: BoxedClone + Debug {
    fn get_endpoint<'auth>(
        &'auth self,
        service_type: String,
        endpoint_interface: Option<String>
    ) -> Box<dyn Future<Item = Url, Error = Error> + 'auth>;
fn request<'auth>(
        &'auth self,
        method: Method,
        url: Url
    ) -> Box<dyn Future<Item = RequestBuilder, Error = Error> + 'auth>;
fn refresh<'auth>(
        &'auth mut self
    ) -> Box<dyn Future<Item = (), Error = Error> + 'auth>; fn default_endpoint_interface(&self) -> String { ... }
fn region(&self) -> Option<String> { ... } }

Trait for an authentication method.

An OpenStack authentication method 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 method should cache the token as long as it's valid.

Required methods

fn get_endpoint<'auth>(
    &'auth self,
    service_type: String,
    endpoint_interface: Option<String>
) -> Box<dyn Future<Item = Url, Error = Error> + 'auth>

Get a URL for the requested service.

fn request<'auth>(
    &'auth self,
    method: Method,
    url: Url
) -> Box<dyn Future<Item = RequestBuilder, Error = Error> + 'auth>

Create an authenticated request.

fn refresh<'auth>(
    &'auth mut self
) -> Box<dyn Future<Item = (), Error = Error> + 'auth>

Refresh the authentication (renew the token, etc).

Loading content...

Provided methods

fn default_endpoint_interface(&self) -> String

Default endpoint interface that is used when none is provided.

fn region(&self) -> Option<String>

Region used with this authentication (if any).

Loading content...

Implementors

impl AuthType for Password[src]

fn region(&self) -> Option<String>[src]

Get region.

fn request<'auth>(
    &'auth self,
    method: Method,
    url: Url
) -> Box<dyn Future<Item = RequestBuilder, Error = Error> + 'auth>
[src]

Create an authenticated request.

fn get_endpoint<'auth>(
    &'auth self,
    service_type: String,
    endpoint_interface: Option<String>
) -> Box<dyn Future<Item = Url, Error = Error> + 'auth>
[src]

Get a URL for the requested service.

fn default_endpoint_interface(&self) -> String[src]

impl AuthType for NoAuth[src]

fn request(
    &self,
    method: Method,
    url: Url
) -> Box<dyn Future<Item = RequestBuilder, Error = Error>>
[src]

Create a request.

fn get_endpoint(
    &self,
    _service_type: String,
    _endpoint_interface: Option<String>
) -> Box<dyn Future<Item = Url, Error = Error>>
[src]

Get a predefined endpoint for all service types

fn default_endpoint_interface(&self) -> String[src]

fn region(&self) -> Option<String>[src]

Loading content...