pub struct BasicAuthConfig { /* private fields */ }Expand description
Basic Authentication configuration
Implementations§
Source§impl BasicAuthConfig
impl BasicAuthConfig
Sourcepub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
pub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
Create a new Basic Auth configuration
Sourcepub fn realm(self, realm: impl Into<String>) -> Self
pub fn realm(self, realm: impl Into<String>) -> Self
Set the authentication realm (shown in browser prompt)
Sourcepub fn exclude(self, path: impl Into<String>) -> Self
pub fn exclude(self, path: impl Into<String>) -> Self
Exclude a path from authentication (e.g., health check endpoints)
Sourcepub fn exclude_paths(
self,
paths: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn exclude_paths( self, paths: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Exclude multiple paths from authentication
Trait Implementations§
Source§impl Clone for BasicAuthConfig
impl Clone for BasicAuthConfig
Source§fn clone(&self) -> BasicAuthConfig
fn clone(&self) -> BasicAuthConfig
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 BasicAuthConfig
impl RefUnwindSafe for BasicAuthConfig
impl Send for BasicAuthConfig
impl Sync for BasicAuthConfig
impl Unpin for BasicAuthConfig
impl UnwindSafe for BasicAuthConfig
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