pub struct BasicAuthConfig {
pub credentials: Vec<BasicCredential>,
pub realm: String,
}Expand description
Configured Basic auth store (one or more credentials).
Fields§
§credentials: Vec<BasicCredential>§realm: StringImplementations§
Source§impl BasicAuthConfig
impl BasicAuthConfig
pub fn single(user: impl Into<String>, pass: impl Into<String>) -> Self
Sourcepub fn parse_user_pass(spec: &str) -> Result<Self, ServerError>
pub fn parse_user_pass(spec: &str) -> Result<Self, ServerError>
Parse user:pass (split on first : so passwords MAY contain :).
Sourcepub fn from_file(path: impl AsRef<Path>) -> Result<Self, ServerError>
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, ServerError>
Load plaintext credential file: one user:pass per line; # comments / blanks skipped.
Not Apache htpasswd crypt/bcrypt — plaintext only.
pub fn challenge_header(&self) -> String
Validate Authorization header value (e.g. Basic dXNlcjpwYXNz).
The configured user an Authorization header authenticates, if any.
Trait Implementations§
Source§impl Clone for BasicAuthConfig
impl Clone for BasicAuthConfig
Source§impl Debug for BasicAuthConfig
impl Debug for BasicAuthConfig
impl Eq for BasicAuthConfig
Source§impl PartialEq for BasicAuthConfig
impl PartialEq for BasicAuthConfig
impl StructuralPartialEq for BasicAuthConfig
Auto Trait Implementations§
impl Forget for BasicAuthConfig
impl Freeze for BasicAuthConfig
impl Move for BasicAuthConfig
impl RefUnwindSafe for BasicAuthConfig
impl Send for BasicAuthConfigwhere
RawVecInner: Send,
impl Sync for BasicAuthConfigwhere
RawVecInner: Sync,
impl Unpin for BasicAuthConfig
impl UnsafeUnpin for BasicAuthConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<BasicCredential>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for BasicAuthConfigwhere
RawVecInner: UnwindSafe,
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