Crate salvo_csrf
source ·Expand description
CSRF middleware for Savlo web framework.
CSRF middleware for Salvo that provides CSRF (Cross-Site Request Forgery) protection.
Data can be saved in Cookies via CookieStore
or in session
via SessionStore
. SessionStore
need to work with salvo-session
crate.
Read more: https://salvo.rs
Structs§
- AesGcm
Cipher aes-gcm-cipher
CSRF protection implementation that uses AES-GCM. - Bcrypt
Cipher bcrypt-cipher
CSRF protection implementation that uses bcrypt. - CcpCipher
ccp-cipher
CcpCipher is a CSRF protection implementation that usesChaCha20Poly1305
. - Cookie
Store cookie-store
ACsrfStore
implementation that stores the CSRF proof in a cookie. - Cross-Site Request Forgery (CSRF) protection middleware.
- Find token from request form body.
- Find token from http request header.
- Hmac
Cipher hmac-cipher
A CSRF protection implementation that uses HMAC. - Find token from request json body.
- Session
Store session-store
ACsrfStore
implementation that stores the CSRF proof in a session.
Constants§
- key used to insert auth decoded data to depot.
Traits§
- Generate token and proof and valid token.
- Extesion for Depot.
- Store proof.
- Used to find csrf token from request.
Functions§
- aes_
gcm_ cookie_ csrf aes-gcm-cipher
andcookie-store
Helper function to create aCsrf
useAesGcmCipher
andCookieStore
. - aes_
gcm_ csrf aes-gcm-cipher
Helper function to create aCsrf
useAesGcmCipher
. - aes_
gcm_ session_ csrf aes-gcm-cipher
andsession-store
Helper function to create aCsrf
useAesGcmCipher
andSessionStore
. - bcrypt_
cookie_ csrf bcrypt-cipher
andcookie-store
Helper function to create aCsrf
useBcryptCipher
andCookieStore
. - bcrypt_
csrf bcrypt-cipher
Helper function to create aCsrf
useBcryptCipher
. - bcrypt_
session_ csrf bcrypt-cipher
andsession-store
Helper function to create aCsrf
useBcryptCipher
andSessionStore
. - ccp_
cookie_ csrf ccp-cipher
andcookie-store
Helper function to create aCsrf
useCcpCipher
andCookieStore
. - ccp_
csrf ccp-cipher
Helper function to create aCsrf
useCcpCipher
. - ccp_
session_ csrf ccp-cipher
andsession-store
Helper function to create aCsrf
useCcpCipher
andSessionStore
. - cookie_
store cookie-store
Helper function to create aCookieStore
. - hmac_
cookie_ csrf hmac-cipher
andcookie-store
Helper function to create aCsrf
useHmacCipher
andCookieStore
. - hmac_
csrf hmac-cipher
Helper function to create aCsrf
useHmacCipher
. - hmac_
session_ csrf hmac-cipher
andsession-store
Helper function to create aCsrf
useHmacCipher
andSessionStore
. - session_
store session-store
Helper function to create aSessionStore
.