Expand description
CSRF middleware for Salvo 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 uses
ChaCha20Poly1305
. - Cookie
Store cookie-store
- A
CsrfStore
implementation that stores the CSRF proof in a cookie. - Csrf
- Cross-Site Request Forgery (CSRF) protection middleware.
- Form
Finder - Find token from request form body.
- Header
Finder - Find token from http request header.
- Hmac
Cipher hmac-cipher
- A CSRF protection implementation that uses HMAC.
- Json
Finder - Find token from request json body.
- Session
Store session-store
- A
CsrfStore
implementation that stores the CSRF proof in a session.
Constants§
- CSRF_
TOKEN_ KEY - key used to insert auth decoded data to depot.
Traits§
- Csrf
Cipher - Generate token and proof and valid token.
- Csrf
Depot Ext - Extesion for Depot.
- Csrf
Store - Store proof.
- Csrf
Token Finder - Used to find csrf token from request.
Functions§
- aes_
gcm_ cookie_ csrf aes-gcm-cipher
andcookie-store
- Helper function to create a
Csrf
useAesGcmCipher
andCookieStore
. - aes_
gcm_ csrf aes-gcm-cipher
- Helper function to create a
Csrf
useAesGcmCipher
. - aes_
gcm_ session_ csrf aes-gcm-cipher
andsession-store
- Helper function to create a
Csrf
useAesGcmCipher
andSessionStore
. - bcrypt_
cookie_ csrf bcrypt-cipher
andcookie-store
- Helper function to create a
Csrf
useBcryptCipher
andCookieStore
. - bcrypt_
csrf bcrypt-cipher
- Helper function to create a
Csrf
useBcryptCipher
. - bcrypt_
session_ csrf bcrypt-cipher
andsession-store
- Helper function to create a
Csrf
useBcryptCipher
andSessionStore
. - ccp_
cookie_ csrf ccp-cipher
andcookie-store
- Helper function to create a
Csrf
useCcpCipher
andCookieStore
. - ccp_
csrf ccp-cipher
- Helper function to create a
Csrf
useCcpCipher
. - ccp_
session_ csrf ccp-cipher
andsession-store
- Helper function to create a
Csrf
useCcpCipher
andSessionStore
. - cookie_
store cookie-store
- Helper function to create a
CookieStore
. - hmac_
cookie_ csrf hmac-cipher
andcookie-store
- Helper function to create a
Csrf
useHmacCipher
andCookieStore
. - hmac_
csrf hmac-cipher
- Helper function to create a
Csrf
useHmacCipher
. - hmac_
session_ csrf hmac-cipher
andsession-store
- Helper function to create a
Csrf
useHmacCipher
andSessionStore
. - session_
store session-store
- Helper function to create a
SessionStore
.