pub enum Auth {
Bearer(BearerToken),
ApiKey(ApiKey),
}Expand description
Authentication method for the Sure API
The API supports two authentication methods:
- Bearer token (JWT) via Authorization header
- API key via X-Api-Key header
Variants§
Bearer(BearerToken)
Bearer token authentication (Authorization: Bearer <token>)
ApiKey(ApiKey)
API key authentication (X-Api-Key: <key>)
Implementations§
Trait Implementations§
Source§impl From<BearerToken> for Auth
impl From<BearerToken> for Auth
Source§fn from(token: BearerToken) -> Self
fn from(token: BearerToken) -> Self
Converts to this type from the input type.
impl Eq for Auth
impl StructuralPartialEq for Auth
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin 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