pub struct AuthConfig {
pub allow_anonymous: bool,
pub public_paths: Vec<String>,
pub header_name: String,
}Expand description
Builder for creating auth middleware configurations
Fields§
§allow_anonymous: boolWhether to allow unauthenticated requests to pass through
public_paths: Vec<String>Paths that don’t require authentication
header_name: StringCustom header name for auth token
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn allow_anonymous(self, allow: bool) -> Self
pub fn allow_anonymous(self, allow: bool) -> Self
Allow anonymous requests (no auth required)
Sourcepub fn public_path(self, path: impl Into<String>) -> Self
pub fn public_path(self, path: impl Into<String>) -> Self
Add paths that don’t require authentication
Sourcepub fn header_name(self, name: impl Into<String>) -> Self
pub fn header_name(self, name: impl Into<String>) -> Self
Set the header name for auth tokens
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 moreAuto 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