Crate salvo_csrf

Source
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§

AesGcmCipheraes-gcm-cipher
CSRF protection implementation that uses AES-GCM.
BcryptCipherbcrypt-cipher
CSRF protection implementation that uses bcrypt.
CcpCipherccp-cipher
CcpCipher is a CSRF protection implementation that uses ChaCha20Poly1305.
CookieStorecookie-store
A CsrfStore implementation that stores the CSRF proof in a cookie.
Csrf
Cross-Site Request Forgery (CSRF) protection middleware.
FormFinder
Find token from request form body.
HeaderFinder
Find token from http request header.
HmacCipherhmac-cipher
A CSRF protection implementation that uses HMAC.
JsonFinder
Find token from request json body.
SessionStoresession-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§

CsrfCipher
Generate token and proof and valid token.
CsrfDepotExt
Extesion for Depot.
CsrfStore
Store proof.
CsrfTokenFinder
Used to find csrf token from request.

Functions§

aes_gcm_cookie_csrfaes-gcm-cipher and cookie-store
Helper function to create a Csrf use AesGcmCipher and CookieStore.
aes_gcm_csrfaes-gcm-cipher
Helper function to create a Csrf use AesGcmCipher.
aes_gcm_session_csrfaes-gcm-cipher and session-store
Helper function to create a Csrf use AesGcmCipher and SessionStore.
bcrypt_cookie_csrfbcrypt-cipher and cookie-store
Helper function to create a Csrf use BcryptCipher and CookieStore.
bcrypt_csrfbcrypt-cipher
Helper function to create a Csrf use BcryptCipher.
bcrypt_session_csrfbcrypt-cipher and session-store
Helper function to create a Csrf use BcryptCipher and SessionStore.
ccp_cookie_csrfccp-cipher and cookie-store
Helper function to create a Csrf use CcpCipher and CookieStore.
ccp_csrfccp-cipher
Helper function to create a Csrf use CcpCipher.
ccp_session_csrfccp-cipher and session-store
Helper function to create a Csrf use CcpCipher and SessionStore.
cookie_storecookie-store
Helper function to create a CookieStore.
hmac_cookie_csrfhmac-cipher and cookie-store
Helper function to create a Csrf use HmacCipher and CookieStore.
hmac_csrfhmac-cipher
Helper function to create a Csrf use HmacCipher.
hmac_session_csrfhmac-cipher and session-store
Helper function to create a Csrf use HmacCipher and SessionStore.
session_storesession-store
Helper function to create a SessionStore.