pub struct IpFilterConfig { /* private fields */ }Expand description
User-facing configuration for IpFilterPlugin and CompiledIpFilter.
Implementations§
Source§impl IpFilterConfig
Fluent configuration builders for IpFilterConfig.
impl IpFilterConfig
Fluent configuration builders for IpFilterConfig.
Sourcepub fn with_allowlist<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
pub fn with_allowlist<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
Sourcepub fn with_denylist<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
pub fn with_denylist<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
Sourcepub fn with_trusted_proxies<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
pub fn with_trusted_proxies<I, S>(self, cidrs: I) -> Result<Self, IpFilterError>
Sourcepub fn with_max_trusted_hops(self, max_hops: usize) -> Self
pub fn with_max_trusted_hops(self, max_hops: usize) -> Self
Sourcepub fn with_trust_forwarded_header(self, enabled: bool) -> Self
pub fn with_trust_forwarded_header(self, enabled: bool) -> Self
Sourcepub fn with_trust_x_real_ip(self, enabled: bool) -> Self
pub fn with_trust_x_real_ip(self, enabled: bool) -> Self
Sourcepub fn with_exempt_paths<I, S>(self, paths: I) -> Self
pub fn with_exempt_paths<I, S>(self, paths: I) -> Self
Sourcepub fn with_exempt_prefixes<I, S>(self, prefixes: I) -> Self
pub fn with_exempt_prefixes<I, S>(self, prefixes: I) -> Self
Sourcepub fn with_reject_response<C, B>(
self,
status: HttpStatus,
content_type: C,
body: B,
) -> Self
pub fn with_reject_response<C, B>( self, status: HttpStatus, content_type: C, body: B, ) -> Self
Source§impl IpFilterConfig
impl IpFilterConfig
pub fn get_allowlist(&self) -> &Vec<IpNet>
pub fn get_mut_allowlist(&mut self) -> &mut Vec<IpNet>
pub fn set_allowlist(&mut self, val: Vec<IpNet>) -> &mut Self
pub fn get_denylist(&self) -> &Vec<IpNet>
pub fn get_mut_denylist(&mut self) -> &mut Vec<IpNet>
pub fn set_denylist(&mut self, val: Vec<IpNet>) -> &mut Self
pub fn get_trusted_proxies(&self) -> &Vec<IpNet>
pub fn get_mut_trusted_proxies(&mut self) -> &mut Vec<IpNet>
pub fn set_trusted_proxies(&mut self, val: Vec<IpNet>) -> &mut Self
pub fn get_max_trusted_hops(&self) -> usize
pub fn get_mut_max_trusted_hops(&mut self) -> &mut usize
pub fn set_max_trusted_hops(&mut self, val: usize) -> &mut Self
pub fn get_trust_forwarded_header(&self) -> bool
pub fn get_mut_trust_forwarded_header(&mut self) -> &mut bool
pub fn set_trust_forwarded_header(&mut self, val: bool) -> &mut Self
pub fn get_trust_x_real_ip(&self) -> bool
pub fn get_mut_trust_x_real_ip(&mut self) -> &mut bool
pub fn set_trust_x_real_ip(&mut self, val: bool) -> &mut Self
pub fn get_exempt_paths(&self) -> &Vec<String>
pub fn get_mut_exempt_paths(&mut self) -> &mut Vec<String>
pub fn set_exempt_paths(&mut self, val: Vec<String>) -> &mut Self
pub fn get_exempt_prefixes(&self) -> &Vec<String>
pub fn get_mut_exempt_prefixes(&mut self) -> &mut Vec<String>
pub fn set_exempt_prefixes(&mut self, val: Vec<String>) -> &mut Self
pub fn get_reject_status(&self) -> HttpStatus
pub fn get_mut_reject_status(&mut self) -> &mut HttpStatus
pub fn set_reject_status(&mut self, val: HttpStatus) -> &mut Self
pub fn get_reject_content_type(&self) -> &String
pub fn get_mut_reject_content_type(&mut self) -> &mut String
pub fn set_reject_content_type(&mut self, val: String) -> &mut Self
pub fn get_reject_body(&self) -> &Vec<u8> ⓘ
pub fn get_mut_reject_body(&mut self) -> &mut Vec<u8> ⓘ
pub fn set_reject_body(&mut self, val: Vec<u8>) -> &mut Self
Trait Implementations§
Source§impl Clone for IpFilterConfig
impl Clone for IpFilterConfig
Source§impl Debug for IpFilterConfig
impl Debug for IpFilterConfig
Source§impl Default for IpFilterConfig
Default construction for IpFilterConfig.
impl Default for IpFilterConfig
Default construction for IpFilterConfig.
Source§fn default() -> Self
fn default() -> Self
Constructs a permissive default IpFilterConfig with no trusted proxies and 403 Forbidden rejection.
§Returns
Self- Default configuration.
impl Eq for IpFilterConfig
Source§impl PartialEq for IpFilterConfig
impl PartialEq for IpFilterConfig
impl StructuralPartialEq for IpFilterConfig
Auto Trait Implementations§
impl Forget for IpFilterConfig
impl Freeze for IpFilterConfigwhere
*const u8 is !null: Freeze,
PhantomData<IpNet>: Freeze,
PhantomData<String>: Freeze,
PhantomData<u8>: Freeze,
impl Move for IpFilterConfig
impl RefUnwindSafe for IpFilterConfig
impl Send for IpFilterConfigwhere
RawVecInner: Send,
impl Sync for IpFilterConfigwhere
RawVecInner: Sync,
impl Unpin for IpFilterConfig
impl UnsafeUnpin for IpFilterConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<IpNet>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for IpFilterConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.