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 a
CsrfStore
implementation that stores the CSRF secret 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.
Find token from http request url query string.
SessionStore
session-store
CookieStore is a
CsrfStore
implementation that stores the CSRF secret in a session.Constants
key used to insert auth decoded data to depot.
Traits
Generate secret and token and valid token.
Extesion for Depot.
Store secret.
CsrfTokenFinder
Functions
aes_gcm_cookie_csrf
aes-gcm-cipher
and cookie-store
Helper function to create a
Csrf
use AesGcmCipher
and CookieStore
.aes_gcm_csrf
aes-gcm-cipher
Helper function to create a
Csrf
use AesGcmCipher
.aes_gcm_session_csrf
aes-gcm-cipher
and session-store
Helper function to create a
Csrf
use AesGcmCipher
and SessionStore
.bcrypt_cookie_csrf
bcrypt-cipher
and cookie-store
Helper function to create a
Csrf
use BcryptCipher
and CookieStore
.bcrypt_csrf
bcrypt-cipher
Helper function to create a
Csrf
use BcryptCipher
.bcrypt_session_csrf
bcrypt-cipher
and session-store
Helper function to create a
Csrf
use BcryptCipher
and SessionStore
.ccp_cookie_csrf
ccp-cipher
and cookie-store
Helper function to create a
Csrf
use CcpCipher
and CookieStore
.ccp_csrf
ccp-cipher
Helper function to create a
Csrf
use CcpCipher
.ccp_session_csrf
ccp-cipher
and session-store
Helper function to create a
Csrf
use CcpCipher
and SessionStore
.cookie_store
cookie-store
Helper function to create a
CookieStore
.hmac_cookie_csrf
hmac-cipher
and cookie-store
Helper function to create a
Csrf
use HmacCipher
and CookieStore
.hmac_csrf
hmac-cipher
Helper function to create a
Csrf
use HmacCipher
.hmac_session_csrf
hmac-cipher
and session-store
Helper function to create a
Csrf
use HmacCipher
and SessionStore
.session_store
session-store
Helper function to create a
SessionStore
.