pub struct AuthHandler { /* private fields */ }Expand description
Handles client-facing authentication interception
Implementations§
Source§impl AuthHandler
impl AuthHandler
Sourcepub fn new(username: Option<String>, password: Option<String>) -> Self
pub fn new(username: Option<String>, password: Option<String>) -> Self
Create a new auth handler with optional credentials
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Check if authentication is enabled
Sourcepub async fn handle_auth_command<W>(
&self,
auth_action: AuthAction,
writer: &mut W,
stored_username: Option<&str>,
) -> Result<(usize, bool)>where
W: AsyncWriteExt + Unpin,
pub async fn handle_auth_command<W>(
&self,
auth_action: AuthAction,
writer: &mut W,
stored_username: Option<&str>,
) -> Result<(usize, bool)>where
W: AsyncWriteExt + Unpin,
Handle an auth command - writes response to client and returns (bytes_written, auth_success) This is the ONE place where auth interception happens
Sourcepub const fn user_response(&self) -> &'static [u8] ⓘ
pub const fn user_response(&self) -> &'static [u8] ⓘ
Get the AUTHINFO USER response
Sourcepub const fn pass_response(&self) -> &'static [u8] ⓘ
pub const fn pass_response(&self) -> &'static [u8] ⓘ
Get the AUTHINFO PASS response
Trait Implementations§
Source§impl Debug for AuthHandler
impl Debug for AuthHandler
Source§impl Default for AuthHandler
impl Default for AuthHandler
Source§fn default() -> AuthHandler
fn default() -> AuthHandler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthHandler
impl RefUnwindSafe for AuthHandler
impl Send for AuthHandler
impl Sync for AuthHandler
impl Unpin for AuthHandler
impl UnwindSafe for AuthHandler
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