pub struct BasicAuth { /* private fields */ }
Expand description
Authentication type that uses HTTP basic authentication.
This type always uses a pre-defined endpoint:
let auth = osauth::BasicAuth::new("https://cloud.local/baremetal",
"username", "password")
.expect("Invalid endpoint URL");
let session = osauth::Session::new(auth);
Implementations§
source§impl BasicAuth
impl BasicAuth
sourcepub fn new<U, S1, S2>(
endpoint: U,
username: S1,
password: S2
) -> Result<BasicAuth, Error>where
U: AsRef<str>,
S1: Into<String>,
S2: Into<String>,
pub fn new<U, S1, S2>( endpoint: U, username: S1, password: S2 ) -> Result<BasicAuth, Error>where U: AsRef<str>, S1: Into<String>, S2: Into<String>,
Create a new HTTP basic authentication method using a fixed endpoint.
This endpoint will be returned in response to all get_endpoint
calls
of the AuthType trait.
Trait Implementations§
source§impl AuthType for BasicAuth
impl AuthType for BasicAuth
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,
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,
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 predefined endpoint for all service types
Auto Trait Implementations§
impl RefUnwindSafe for BasicAuth
impl Send for BasicAuth
impl Sync for BasicAuth
impl Unpin for BasicAuth
impl UnwindSafe for BasicAuth
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more