pub struct SecurityConfig {
pub trust_proxy_headers: bool,
pub trusted_source_cidrs: Vec<String>,
pub allowed_source_cidrs: Vec<String>,
pub api_keys: Vec<ApiKeyConfig>,
}Fields§
§trust_proxy_headers: boolWhen true, read X-Forwarded-For to resolve client IP.
Only applies when the peer IP is listed in trusted_source_cidrs.
trusted_source_cidrs: Vec<String>CIDRs whose X-Forwarded-For headers may be trusted for IP resolution.
Distinct from allowed_source_cidrs — see security model.
allowed_source_cidrs: Vec<String>CIDRs that are permitted to connect at all (empty = allow all source IPs). Applied after IP resolution; independent of proxy header trust.
api_keys: Vec<ApiKeyConfig>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 (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 SecurityConfig
impl Debug for SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfig
impl<'de> Deserialize<'de> for SecurityConfig
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 UnsafeUnpin 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