Trait iron_csrf::CsrfProtection [] [src]

pub trait CsrfProtection: Sized + Send + Sync {
    fn parse_token(&self, bytes: &[u8]) -> Result<CsrfTokenTransport, CsrfError>;
    fn parse_cookie(&self,
                    bytes: &[u8])
                    -> Result<CsrfCookieTransport, CsrfError>; fn generate_token_pair(&self,
                           previous_token: Option<Vec<u8>>,
                           ttl_seconds: i64)
                           -> Result<(CsrfToken, CsrfCookie), CsrfError>; fn verify_token_pair(&self,
                         token: &CsrfTokenTransport,
                         cookie: &CsrfCookieTransport)
                         -> bool { ... } }

Base trait that allows an iron application to be wrapped with CSRF protection.

Required Methods

Returns the internal representation of a CSRF token given a slice of decoded bytes.

Returns the internal representation of a CSRF cookie given a slice of decoded bytes.

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

Provided Methods

Returns whether

Implementors