pub struct ApiKeyMethod { /* private fields */ }Expand description
API key authentication method.
Implementations§
Source§impl ApiKeyMethod
impl ApiKeyMethod
Sourcepub fn key_prefix(self, prefix: impl Into<String>) -> Self
pub fn key_prefix(self, prefix: impl Into<String>) -> Self
Set the key prefix.
Sourcepub fn key_length(self, _length: usize) -> Self
pub fn key_length(self, _length: usize) -> Self
Set the key length (for compatibility with examples).
Sourcepub fn header_name(self, name: impl Into<String>) -> Self
pub fn header_name(self, name: impl Into<String>) -> Self
Set the header name.
Sourcepub fn key_validator(self, validator: Box<dyn ApiKeyValidator>) -> Self
pub fn key_validator(self, validator: Box<dyn ApiKeyValidator>) -> Self
Set the key validator.
Trait Implementations§
Source§impl AuthMethod for ApiKeyMethod
impl AuthMethod for ApiKeyMethod
Source§fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
credential: &'life1 Credential,
_metadata: &'life2 CredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<MethodResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
credential: &'life1 Credential,
_metadata: &'life2 CredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<MethodResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate using the provided credentials.
Source§fn validate_config(&self) -> Result<()>
fn validate_config(&self) -> Result<()>
Validate configuration for this method.
Source§fn supports_refresh(&self) -> bool
fn supports_refresh(&self) -> bool
Check if this method supports refresh tokens.
Auto Trait Implementations§
impl Freeze for ApiKeyMethod
impl !RefUnwindSafe for ApiKeyMethod
impl Send for ApiKeyMethod
impl Sync for ApiKeyMethod
impl Unpin for ApiKeyMethod
impl !UnwindSafe for ApiKeyMethod
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