pub struct ApiKeyAuth { /* private fields */ }Expand description
Authenticate callers by a secret in a request header
Several keys can be active at once (one per caller, or old and new during a
rotation); the matching entry’s name becomes the Principal.
Implementations§
Source§impl ApiKeyAuth
impl ApiKeyAuth
Sourcepub fn allow_bearer(self) -> Self
pub fn allow_bearer(self) -> Self
Also accept the key as Authorization: Bearer <key>
Sourcepub fn except_paths<I, S>(self, paths: I) -> Self
pub fn except_paths<I, S>(self, paths: I) -> Self
Paths served without a key (health checks)
Trait Implementations§
Source§impl Clone for ApiKeyAuth
impl Clone for ApiKeyAuth
Source§impl Default for ApiKeyAuth
impl Default for ApiKeyAuth
Auto Trait Implementations§
impl Freeze for ApiKeyAuth
impl RefUnwindSafe for ApiKeyAuth
impl Send for ApiKeyAuth
impl Sync for ApiKeyAuth
impl Unpin for ApiKeyAuth
impl UnsafeUnpin for ApiKeyAuth
impl UnwindSafe for ApiKeyAuth
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