Trait openstack::auth::AuthMethod
[−]
[src]
pub trait AuthMethod: BoxedClone + Debug { fn get_endpoint(
&self,
service_type: String,
endpoint_interface: Option<String>
) -> Result<Url>; fn request(&self, method: Method, url: Url) -> Result<RequestBuilder>; fn refresh(&mut self) -> Result<()>; 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:
- get an authentication token to use when accessing services,
- 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(
&self,
service_type: String,
endpoint_interface: Option<String>
) -> Result<Url>
&self,
service_type: String,
endpoint_interface: Option<String>
) -> Result<Url>
Get a URL for the requested service.
fn request(&self, method: Method, url: Url) -> Result<RequestBuilder>
Create an authenticated request.
fn refresh(&mut self) -> Result<()>
Refresh the authentication (renew the token, etc).
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).
Implementors
impl AuthMethod for PasswordAuthimpl AuthMethod for NoAuth