Trait iron_csrf::CsrfProtection
[−]
[src]
pub trait CsrfProtection: Sized + Send + Sync { fn verify_token_pair(&self, token: &[u8], cookie: &[u8]) -> bool; fn generate_token_pair(&self,
ttl_seconds: i64)
-> Result<(CsrfToken, CsrfCookie), CsrfError>; }
Base trait that allows an iron
application to be wrapped with CSRF protection.
Required Methods
fn verify_token_pair(&self, token: &[u8], cookie: &[u8]) -> bool
Given the decoded bytes for the CSRF token and cookie, return whether or not the token is valid.
fn generate_token_pair(&self,
ttl_seconds: i64)
-> Result<(CsrfToken, CsrfCookie), CsrfError>
ttl_seconds: i64)
-> Result<(CsrfToken, CsrfCookie), CsrfError>
Create a CSRF token and cookie with the given TTL in seconds.
Implementors
impl CsrfProtection for ChaCha20Poly1305CsrfProtection