Crate salvo_csrf
source ·Expand description
CSRF middleware for Savlo web server 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.
Structs
- AesGcmCipher
aes-gcm-cipher
AesGcmCipher is a CSRF protection implementation that uses HMAC. - BcryptCipher
bcrypt-cipher
BcryptCipher is a CSRF protection implementation that uses bcrypt. - CcpCipher
ccp-cipher
CcpCipher is a CSRF protection implementation that uses HMAC. - CookieStore
cookie-store
CookieStore is 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.
- HmacCipher
hmac-cipher
HmacCipher is a CSRF protection implementation that uses HMAC. - Find token from request json body.
- SessionStore
session-store
CookieStore is 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.
- CsrfTokenFinder
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
.