pub struct BasicAuthenticator { /* private fields */ }Expand description
Basic authenticator
Implementations§
Source§impl BasicAuthenticator
impl BasicAuthenticator
Sourcepub fn new(validator: AuthValidator) -> Self
pub fn new(validator: AuthValidator) -> Self
Create a new basic authenticator
Sourcepub fn with_realm(validator: AuthValidator, realm: impl Into<String>) -> Self
pub fn with_realm(validator: AuthValidator, realm: impl Into<String>) -> Self
Create a new basic authenticator with custom realm
Sourcepub fn requires_auth(&self, path: &str) -> bool
pub fn requires_auth(&self, path: &str) -> bool
Check if path requires authentication
Sourcepub fn authenticate(&self, auth_header: Option<&str>) -> AuthResult
pub fn authenticate(&self, auth_header: Option<&str>) -> AuthResult
Authenticate a request using Basic Auth header
Sourcepub fn www_authenticate_header(&self) -> String
pub fn www_authenticate_header(&self) -> String
Get the WWW-Authenticate header value for 401 responses
Sourcepub fn validator(&self) -> &AuthValidator
pub fn validator(&self) -> &AuthValidator
Get the validator
Sourcepub fn validator_mut(&mut self) -> &mut AuthValidator
pub fn validator_mut(&mut self) -> &mut AuthValidator
Get mutable validator
Auto Trait Implementations§
impl Freeze for BasicAuthenticator
impl RefUnwindSafe for BasicAuthenticator
impl Send for BasicAuthenticator
impl Sync for BasicAuthenticator
impl Unpin for BasicAuthenticator
impl UnsafeUnpin for BasicAuthenticator
impl UnwindSafe for BasicAuthenticator
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