pub enum CsrfPattern {
DoubleSubmitCookie,
}
Expand description
CSRF defense patterns supported by CsrfMiddleware
.
CsrfPattern::DoubleSubmitCookie
: Stores an HMAC-protected token in a cookie and expects the client to echo it back via header or form/json field. Does not require server-side session storage.- [
CsrfPattern::SynchronizerToken
]: Stores a random token server-side in a session (requiresactix-session
) and expects the client to send back the same value.
See CsrfMiddlewareConfig
constructors for examples.
Variants§
DoubleSubmitCookie
Store tokens client-side in cookies and verify with HMAC
Trait Implementations§
Source§impl Clone for CsrfPattern
impl Clone for CsrfPattern
Source§fn clone(&self) -> CsrfPattern
fn clone(&self) -> CsrfPattern
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 PartialEq for CsrfPattern
impl PartialEq for CsrfPattern
impl StructuralPartialEq for CsrfPattern
Auto Trait Implementations§
impl Freeze for CsrfPattern
impl RefUnwindSafe for CsrfPattern
impl Send for CsrfPattern
impl Sync for CsrfPattern
impl Unpin for CsrfPattern
impl UnwindSafe for CsrfPattern
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