pub struct CsrfMiddlewareConfig {Show 13 fields
pub pattern: CsrfPattern,
pub manual_multipart: bool,
pub session_id_cookie_name: String,
pub token_cookie_name: String,
pub anon_token_cookie_name: String,
pub token_form_field: String,
pub token_header_name: String,
pub token_cookie_config: Option<CsrfDoubleSubmitCookie>,
pub secret_key: Vec<u8>,
pub skip_for: Vec<String>,
pub enforce_origin: bool,
pub allowed_origins: Vec<String>,
pub max_body_bytes: usize,
}
Fields§
§pattern: CsrfPattern
§manual_multipart: bool
Authorized (session-bound) tokens
Anonymous (pre-session) tokens
token_form_field: String
§token_header_name: String
§secret_key: Vec<u8>
§skip_for: Vec<String>
§enforce_origin: bool
Enforce Origin/Referer checks for mutating requests
allowed_origins: Vec<String>
Allowed origins (scheme://host[:port]) when enforce_origin = true
max_body_bytes: usize
Maximum allowed body bytes to read when extracting CSRF tokens from body (POST/PUT/PATCH/DELETE)
Implementations§
Source§impl CsrfMiddlewareConfig
impl CsrfMiddlewareConfig
pub fn with_multipart(self, multipart: bool) -> Self
pub fn with_max_body_bytes(self, limit: usize) -> Self
pub fn with_skip_for(self, patches: Vec<String>) -> Self
pub fn with_enforce_origin(self, enforce: bool, allowed: Vec<String>) -> Self
Trait Implementations§
Source§impl Clone for CsrfMiddlewareConfig
impl Clone for CsrfMiddlewareConfig
Source§fn clone(&self) -> CsrfMiddlewareConfig
fn clone(&self) -> CsrfMiddlewareConfig
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 moreAuto Trait Implementations§
impl Freeze for CsrfMiddlewareConfig
impl RefUnwindSafe for CsrfMiddlewareConfig
impl Send for CsrfMiddlewareConfig
impl Sync for CsrfMiddlewareConfig
impl Unpin for CsrfMiddlewareConfig
impl UnwindSafe for CsrfMiddlewareConfig
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