pub enum Auth {
None,
Bearer(String),
Basic {
username: String,
password: String,
},
ApiKey {
header: String,
value: String,
},
ApiKeyQuery {
param: String,
value: String,
},
OAuth2 {
token_url: String,
client_id: String,
client_secret: String,
scopes: Vec<String>,
expiry_ratio: f64,
},
Custom(HeaderMap),
}Expand description
Supported authentication methods.
Variants§
None
Bearer(String)
Basic
ApiKey
API key sent in a request header.
ApiKeyQuery
API key sent as a query parameter (e.g. ?api_key=secret).
Some APIs require the key in the URL rather than a header. The param
field is the query parameter name, and value is the key itself.
OAuth2
Fields
Custom(HeaderMap)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl UnwindSafe for Auth
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