pub enum AuthType {
Bearer(String),
ApiKey {
header: String,
key: String,
},
Custom {
header: String,
value: String,
},
None,
}Expand description
The type of authentication to use.
Variants§
Bearer(String)
Bearer token authentication (e.g. OAuth2 or JWT).
ApiKey
API key authentication, usually provided in a custom header.
Custom
Custom header authentication.
None
No authentication.
Implementations§
Source§impl AuthType
impl AuthType
Sourcepub fn apply(self, request: HttpRequest) -> HttpRequest
pub fn apply(self, request: HttpRequest) -> HttpRequest
Applies the authentication to the given HTTP request.
Sourcepub fn google_api_key(key: impl Into<String>) -> Self
pub fn google_api_key(key: impl Into<String>) -> Self
Creates an AuthType::ApiKey using the X-Goog-Api-Key header, which is the header
the real Jules v1alpha API accepts an API key through (verified against the live API).
Trait Implementations§
impl Eq for AuthType
impl StructuralPartialEq for AuthType
Auto Trait Implementations§
impl Freeze for AuthType
impl RefUnwindSafe for AuthType
impl Send for AuthType
impl Sync for AuthType
impl Unpin for AuthType
impl UnsafeUnpin for AuthType
impl UnwindSafe for AuthType
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