pub struct Authenticator { /* private fields */ }Expand description
Checks request credentials against the configured users.
Implementations§
Source§impl Authenticator
impl Authenticator
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Whether no credentials are required at all.
True when no users are configured, which makes this an open proxy;
config::Config::warnings reports it at startup.
Sourcepub fn authenticate(&self, fields: &Fields) -> Result<Option<&str>, Denials>
pub fn authenticate(&self, fields: &Fields) -> Result<Option<&str>, Denials>
Authenticates a request’s headers.
Ok(None) means authentication is disabled, Ok(Some(username)) names the
user that matched. The error carries one entry per credential value that
was tried and refused, because that is the unit the failure budget counts
(decision D76, addendum of 2026-09-04).
A value that matches ends the loop, so the values after it are neither tried nor charged: this returns what the request is, and a request that authenticates is not a failure.
Auto Trait Implementations§
impl Freeze for Authenticator
impl RefUnwindSafe for Authenticator
impl Send for Authenticator
impl Sync for Authenticator
impl Unpin for Authenticator
impl UnsafeUnpin for Authenticator
impl UnwindSafe for Authenticator
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