pub struct AuthConfig { /* private fields */ }Expand description
Authentication configuration loaded from environment.
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn from_users(value: &str) -> Self
pub fn from_users(value: &str) -> Self
Build auth config from explicit user:pass entries.
Sourcepub fn authenticate(&self, user: &str, pass: &str) -> bool
pub fn authenticate(&self, user: &str, pass: &str) -> bool
Validate credentials against configured users.
Sourcepub fn user_count(&self) -> usize
pub fn user_count(&self) -> usize
Return the number of configured users.
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
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 moreSource§impl Debug for AuthConfig
impl Debug for AuthConfig
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnwindSafe for AuthConfig
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