pub struct ApiKeyMiddlewareConfig {
pub header_name: String,
pub barnacle_config: BarnacleConfig,
pub require_api_key: bool,
pub cache_ttl_seconds: u64,
}
Expand description
Configuration for API key middleware
Fields§
§header_name: String
§barnacle_config: BarnacleConfig
§require_api_key: bool
§cache_ttl_seconds: u64
TTL for caching API keys validated by custom validator (in seconds)
Implementations§
Source§impl ApiKeyMiddlewareConfig
impl ApiKeyMiddlewareConfig
pub fn new(barnacle_config: BarnacleConfig) -> Self
pub fn custom( header_name: String, barnacle_config: BarnacleConfig, cache_ttl_seconds: u64, ) -> Self
Trait Implementations§
Source§impl Clone for ApiKeyMiddlewareConfig
impl Clone for ApiKeyMiddlewareConfig
Source§fn clone(&self) -> ApiKeyMiddlewareConfig
fn clone(&self) -> ApiKeyMiddlewareConfig
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 moreSource§impl Debug for ApiKeyMiddlewareConfig
impl Debug for ApiKeyMiddlewareConfig
Auto Trait Implementations§
impl Freeze for ApiKeyMiddlewareConfig
impl RefUnwindSafe for ApiKeyMiddlewareConfig
impl Send for ApiKeyMiddlewareConfig
impl Sync for ApiKeyMiddlewareConfig
impl Unpin for ApiKeyMiddlewareConfig
impl UnwindSafe for ApiKeyMiddlewareConfig
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