pub struct SecurityConfig {
pub api_key_enabled: bool,
pub api_key: Option<String>,
pub rate_limit_enabled: bool,
pub rate_limit_requests: u32,
pub rate_limit_window_secs: u64,
}Expand description
Security configuration for API protection.
Fields§
§api_key_enabled: boolEnable API key authentication.
When enabled, clients must provide the API key in the X-API-Key header.
api_key: Option<String>The API key required for authentication (if enabled). Should be a secure random string of at least 32 characters.
rate_limit_enabled: boolEnable rate limiting.
rate_limit_requests: u32Maximum requests per window.
rate_limit_window_secs: u64Rate limit window in seconds.
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn validate(&self) -> Vec<ValidationError>
pub fn validate(&self) -> Vec<ValidationError>
Validate security configuration.
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
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 SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfigwhere
SecurityConfig: Default,
impl<'de> Deserialize<'de> for SecurityConfigwhere
SecurityConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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