Struct iron_csrf::CsrfConfigBuilder
[−]
[src]
pub struct CsrfConfigBuilder { /* fields omitted */ }
A utility to help build a CsrfConfig
in an API backwards compatible way.
Methods
impl CsrfConfigBuilder
[src]
fn ttl_seconds(self, ttl_seconds: i64) -> Self
Set the TTL in seconds for CSRF cookies and tokens.
Default: 3600
fn protected_methods(self, protected_methods: HashSet<Method>) -> Self
Set the HTTP methods that are require CSRF protection.
Default: POST
, PUT
, PATCH
, DELETE
Set the Secure
flag on the CSRF cookie. If this is set to true, then user agents will
only send the cookie over HTTPS.
Default: false/absent.
fn finish(self) -> Result<CsrfConfig, CsrfConfigError>
Validate and build the CsrfConfig
.