pub struct BasicAuth { /* private fields */ }Expand description
Applies AppPassword credentials as an Authorization: Basic header.
The value is base64(user:password); the colon separator is fixed by
RFC 7617, so neither field may contain one — callers use the URL-encoded
Nextcloud user name, which never does.
Implementations§
Source§impl BasicAuth
impl BasicAuth
Sourcepub fn new(user: impl Into<String>, password: SecretString) -> Self
pub fn new(user: impl Into<String>, password: SecretString) -> Self
Builds a provider from a user name and its app password.
Sourcepub const fn from_app_password(credentials: AppPassword) -> Self
pub const fn from_app_password(credentials: AppPassword) -> Self
Builds a provider from already-assembled credentials.
Sourcepub const fn credentials(&self) -> &AppPassword
pub const fn credentials(&self) -> &AppPassword
The credentials this provider applies.
Sourcepub fn header_value(&self) -> String
pub fn header_value(&self) -> String
The header value sent to the server.
Trait Implementations§
Source§impl AuthProvider for BasicAuth
impl AuthProvider for BasicAuth
Source§fn authenticate(&self, headers: &mut Headers)
fn authenticate(&self, headers: &mut Headers)
Applies this provider’s credentials to
headers. Read moreAuto Trait Implementations§
impl Freeze for BasicAuth
impl RefUnwindSafe for BasicAuth
impl Send for BasicAuth
impl Sync for BasicAuth
impl Unpin for BasicAuth
impl UnsafeUnpin for BasicAuth
impl UnwindSafe for BasicAuth
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