pub enum HoopConfig {
Show 20 variants
RateLimit {
window: Duration,
max: u64,
burst: Option<u64>,
},
ForwardAuth {
url: String,
copy_headers: Vec<String>,
},
Encode {
encodings: Vec<String>,
level: Option<u32>,
},
Headers(HeadersConfig),
BasicAuth {
users: Vec<BasicAuthUser>,
brute_force_max: Option<u32>,
brute_force_window: Option<Duration>,
},
IpFilter {
allow: Vec<String>,
deny: Vec<String>,
forwarded_for: bool,
},
Rewrite {
strip_prefix: Option<String>,
uri: Option<String>,
regex_rules: Vec<(String, String)>,
if_not_file: bool,
if_not_dir: bool,
root: Option<String>,
normalize_slashes: bool,
},
Replace {
rules: Vec<(String, String)>,
once: bool,
},
Cache(CacheConfig),
Templates {
root: Option<String>,
},
BufferLimit {
max_request_body: Option<usize>,
max_response_body: Option<usize>,
},
Cors {
allow_origins: Vec<String>,
allow_methods: Vec<String>,
allow_headers: Vec<String>,
allow_credentials: bool,
expose_headers: Vec<String>,
max_age: Option<u64>,
},
Timeout {
duration: Duration,
},
RequestId {
header_name: Option<String>,
overwrite: bool,
},
ForceHttps {
https_port: Option<u16>,
},
TrailingSlash {
action: String,
},
Decompress {
max_size: Option<usize>,
},
ErrorPages {
pages: HashMap<u16, String>,
},
StreamReplace {
rules: Vec<(String, String)>,
once: bool,
},
Module {
name: String,
config: HashMap<String, String>,
},
}Expand description
Supported middleware configurations.
Variants§
RateLimit
Fields
ForwardAuth
Fields
Encode
Headers(HeadersConfig)
BasicAuth
Fields
§
users: Vec<BasicAuthUser>IpFilter
Fields
Rewrite
Fields
§
regex_rules: Vec<(String, String)>Regex rewrite rules: list of (pattern, replacement) pairs applied sequentially to the path.
§
if_not_file: boolOnly rewrite when the resolved path does NOT correspond to an
existing file on disk (requires root).
Replace
Fields
Cache(CacheConfig)
Templates
BufferLimit
Fields
Cors
Fields
Timeout
RequestId
Fields
ForceHttps
TrailingSlash
Decompress
Fields
ErrorPages
StreamReplace
Fields
Module
A module-provided middleware loaded via the plugin system.
Trait Implementations§
Source§impl Clone for HoopConfig
impl Clone for HoopConfig
Source§fn clone(&self) -> HoopConfig
fn clone(&self) -> HoopConfig
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 HoopConfig
impl Debug for HoopConfig
Auto Trait Implementations§
impl Freeze for HoopConfig
impl RefUnwindSafe for HoopConfig
impl Send for HoopConfig
impl Sync for HoopConfig
impl Unpin for HoopConfig
impl UnsafeUnpin for HoopConfig
impl UnwindSafe for HoopConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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