pub struct AuthMiddleware { /* private fields */ }Expand description
Authentication middleware
Implementations§
Source§impl AuthMiddleware
impl AuthMiddleware
Sourcepub fn new(config: AuthConfig) -> Self
pub fn new(config: AuthConfig) -> Self
Create new auth middleware with configuration
Sourcepub fn validate_header(&self, auth_header: Option<&str>) -> SecurityResult<()>
pub fn validate_header(&self, auth_header: Option<&str>) -> SecurityResult<()>
Validate a request’s authorization header
Sourcepub fn is_localhost_allowed(&self, remote_addr: &str) -> bool
pub fn is_localhost_allowed(&self, remote_addr: &str) -> bool
Check if a remote address should bypass authentication
Trait Implementations§
Source§impl Clone for AuthMiddleware
impl Clone for AuthMiddleware
Source§fn clone(&self) -> AuthMiddleware
fn clone(&self) -> AuthMiddleware
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthMiddleware
impl !RefUnwindSafe for AuthMiddleware
impl Send for AuthMiddleware
impl Sync for AuthMiddleware
impl Unpin for AuthMiddleware
impl !UnwindSafe for AuthMiddleware
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