pub struct Credential { /* private fields */ }Expand description
One presented credential routed to a named authentication strategy.
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn bearer(
strategy: impl Into<String>,
token: impl Into<String>,
) -> SoapResult<Self>
pub fn bearer( strategy: impl Into<String>, token: impl Into<String>, ) -> SoapResult<Self>
Creates a bearer credential.
Sourcepub fn api_key(
strategy: impl Into<String>,
identifier: Option<String>,
key: impl Into<String>,
) -> SoapResult<Self>
pub fn api_key( strategy: impl Into<String>, identifier: Option<String>, key: impl Into<String>, ) -> SoapResult<Self>
Creates an API-key credential with an optional public key identifier.
Sourcepub fn password(
strategy: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
) -> SoapResult<Self>
pub fn password( strategy: impl Into<String>, username: impl Into<String>, password: impl Into<String>, ) -> SoapResult<Self>
Creates a username/password credential.
Sourcepub fn session(
strategy: impl Into<String>,
session_id: impl Into<String>,
) -> SoapResult<Self>
pub fn session( strategy: impl Into<String>, session_id: impl Into<String>, ) -> SoapResult<Self>
Creates a session credential.
Sourcepub fn custom(
strategy: impl Into<String>,
kind: impl Into<String>,
identifier: Option<String>,
secret: impl Into<String>,
) -> SoapResult<Self>
pub fn custom( strategy: impl Into<String>, kind: impl Into<String>, identifier: Option<String>, secret: impl Into<String>, ) -> SoapResult<Self>
Creates an application-defined credential.
Sourcepub fn strategy(&self) -> &AuthorizationName
pub fn strategy(&self) -> &AuthorizationName
Returns the strategy selected for this credential.
Sourcepub const fn kind(&self) -> &CredentialKind
pub const fn kind(&self) -> &CredentialKind
Returns the credential category.
Sourcepub fn identifier(&self) -> Option<&str>
pub fn identifier(&self) -> Option<&str>
Returns a public username or key identifier when supplied.
Sourcepub const fn secret(&self) -> &SecretString
pub const fn secret(&self) -> &SecretString
Returns the redacted secret wrapper.
Trait Implementations§
Source§impl<P> Authenticator<Credential, P> for AuthenticationRegistry<P>where
P: Send,
impl<P> Authenticator<Credential, P> for AuthenticationRegistry<P>where
P: Send,
Source§fn authenticate(
&self,
credential: Credential,
) -> BoxFuture<'_, SoapResult<Authentication<P>>>
fn authenticate( &self, credential: Credential, ) -> BoxFuture<'_, SoapResult<Authentication<P>>>
Authenticates a presented credential.
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Credential
impl Debug for Credential
impl Eq for Credential
Source§impl PartialEq for Credential
impl PartialEq for Credential
impl StructuralPartialEq for Credential
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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