Skip to main content

RouteConfig

Struct RouteConfig 

Source
pub struct RouteConfig {
Show 31 fields pub rate_limit: Option<u32>, pub rate_limit_window: Option<u64>, pub ip_whitelist: Option<Vec<String>>, pub ip_blacklist: Option<Vec<String>>, pub blocked_countries: Option<Vec<String>>, pub whitelist_countries: Option<Vec<String>>, pub bypassed_checks: BTreeSet<String>, pub require_https: bool, pub auth_required: Option<String>, pub custom_validators: Vec<CustomValidatorFn>, pub blocked_user_agents: Vec<String>, pub required_headers: BTreeMap<String, String>, pub behavior_rules: Vec<BehaviorRule>, pub block_cloud_providers: BTreeSet<String>, pub max_request_size: Option<u64>, pub allowed_content_types: Option<Vec<String>>, pub time_restrictions: Option<BTreeMap<String, String>>, pub enable_suspicious_detection: bool, pub require_referrer: Option<Vec<String>>, pub api_key_required: bool, pub auth_verifier: Option<AuthVerifier>, pub api_key_verifier: Option<AuthVerifier>, pub api_key_header: Option<String>, pub authorization_header_required: Option<String>, pub geo_rate_limits: Option<BTreeMap<String, (u32, u64)>>, pub excluded_detection_headers: Option<BTreeSet<String>>, pub excluded_semantic_detection_headers: Option<BTreeSet<String>>, pub excluded_detection_params: Option<BTreeSet<String>>, pub excluded_detection_body_fields: Option<BTreeSet<String>>, pub enabled_detection_categories: Option<BTreeSet<String>>, pub detection_scan_body: Option<bool>,
}
Expand description

The per-route configuration carrier (the reference RouteConfig’s 30 knobs). None/empty inherits the global config for that knob.

Fields§

§rate_limit: Option<u32>

rate_limit: the route’s request count per window.

§rate_limit_window: Option<u64>

rate_limit_window: the route’s window (seconds).

§ip_whitelist: Option<Vec<String>>

ip_whitelist: the route’s allow list.

§ip_blacklist: Option<Vec<String>>

ip_blacklist: the route’s deny list.

§blocked_countries: Option<Vec<String>>

blocked_countries.

§whitelist_countries: Option<Vec<String>>

whitelist_countries.

§bypassed_checks: BTreeSet<String>

bypassed_checks: the check names this route skips.

§require_https: bool

require_https.

§auth_required: Option<String>

auth_required: the authentication scheme the route demands.

§custom_validators: Vec<CustomValidatorFn>

custom_validators: the route’s validator functions.

§blocked_user_agents: Vec<String>

blocked_user_agents.

§required_headers: BTreeMap<String, String>

required_headers: header name to exact value.

§behavior_rules: Vec<BehaviorRule>

behavior_rules: the route’s behavior rules.

§block_cloud_providers: BTreeSet<String>

block_cloud_providers.

§max_request_size: Option<u64>

max_request_size (bytes).

§allowed_content_types: Option<Vec<String>>

allowed_content_types.

§time_restrictions: Option<BTreeMap<String, String>>

time_restrictions.

§enable_suspicious_detection: bool

enable_suspicious_detection (the reference default True).

§require_referrer: Option<Vec<String>>

require_referrer.

§api_key_required: bool

api_key_required.

§auth_verifier: Option<AuthVerifier>

auth_verifier: the route’s authentication verifier.

§api_key_verifier: Option<AuthVerifier>

api_key_verifier: the route’s API-key verifier.

§api_key_header: Option<String>

api_key_header.

§authorization_header_required: Option<String>

authorization_header_required.

§geo_rate_limits: Option<BTreeMap<String, (u32, u64)>>

geo_rate_limits: country code to (count, window seconds).

§excluded_detection_headers: Option<BTreeSet<String>>

excluded_detection_headers.

§excluded_semantic_detection_headers: Option<BTreeSet<String>>

excluded_semantic_detection_headers.

§excluded_detection_params: Option<BTreeSet<String>>

excluded_detection_params.

§excluded_detection_body_fields: Option<BTreeSet<String>>

excluded_detection_body_fields.

§enabled_detection_categories: Option<BTreeSet<String>>

enabled_detection_categories.

§detection_scan_body: Option<bool>

detection_scan_body.

Implementations§

Source§

impl RouteConfig

Source

pub fn rate_limits( &self, ) -> Result<Option<RouteRateLimits>, RateLimitConfigError>

The rate-limit view (rate_limit + rate_limit_window + geo_rate_limits): the carrier the engine’s route-rate resolver seam consumes, None when the route sets no rate-limit override. Err on a zero limit or window (the engine’s validated constructor).

Source

pub fn detection_exclusions(&self) -> RouteDetectionExclusions

The detection view (the five exclusion/enablement knobs): the carrier the crate::detection_exclusions seam consumes.

Trait Implementations§

Source§

impl Clone for RouteConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for RouteConfig

Source§

fn default() -> Self

The reference defaults: every override None/empty, the two explicit booleans at their reference values.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.