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: boolrequire_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: boolenable_suspicious_detection (the reference default True).
require_referrer: Option<Vec<String>>require_referrer.
api_key_required: boolapi_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.
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
impl RouteConfig
Sourcepub fn rate_limits(
&self,
) -> Result<Option<RouteRateLimits>, RateLimitConfigError>
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).
Sourcepub fn detection_exclusions(&self) -> RouteDetectionExclusions
pub fn detection_exclusions(&self) -> RouteDetectionExclusions
The detection view (the five exclusion/enablement knobs): the
carrier the crate::detection_exclusions seam consumes.