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

Given the decoded bytes for the CSRF token and cookie, return whether or not the token is valid.

Create a CSRF token and cookie with the given TTL in seconds.

Implementors