[−][src]Struct csrf::MultiCsrfProtection
This is used when one wants to rotate keys or switch from implementation to another. It accepts
1 + N
instances of CsrfProtection
and uses only the first to generate tokens and cookies.
The N
remaining instances are used only for parsing.
Implementations
impl MultiCsrfProtection
[src]
pub fn new(
current: Box<dyn CsrfProtection>,
previous: Vec<Box<dyn CsrfProtection>>
) -> Self
[src]
current: Box<dyn CsrfProtection>,
previous: Vec<Box<dyn CsrfProtection>>
) -> Self
Create a new MultiCsrfProtection
from one current CsrfProtection
and some N
previous
instances of CsrfProtection
.
Trait Implementations
impl CsrfProtection for MultiCsrfProtection
[src]
fn generate_cookie(
&self,
token_value: &[u8; 64],
ttl_seconds: i64
) -> Result<CsrfCookie, CsrfError>
[src]
&self,
token_value: &[u8; 64],
ttl_seconds: i64
) -> Result<CsrfCookie, CsrfError>
fn generate_token(&self, token_value: &[u8; 64]) -> Result<CsrfToken, CsrfError>
[src]
fn parse_cookie(
&self,
cookie: &[u8]
) -> Result<UnencryptedCsrfCookie, CsrfError>
[src]
&self,
cookie: &[u8]
) -> Result<UnencryptedCsrfCookie, CsrfError>
fn parse_token(&self, token: &[u8]) -> Result<UnencryptedCsrfToken, CsrfError>
[src]
fn verify_token_pair(
&self,
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie
) -> bool
[src]
&self,
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie
) -> bool
fn random_bytes(&self, buf: &mut [u8]) -> Result<(), CsrfError>
[src]
fn generate_token_pair(
&self,
previous_token_value: Option<&[u8; 64]>,
ttl_seconds: i64
) -> Result<(CsrfToken, CsrfCookie), CsrfError>
[src]
&self,
previous_token_value: Option<&[u8; 64]>,
ttl_seconds: i64
) -> Result<(CsrfToken, CsrfCookie), CsrfError>
Auto Trait Implementations
impl !RefUnwindSafe for MultiCsrfProtection
impl Send for MultiCsrfProtection
impl Sync for MultiCsrfProtection
impl Unpin for MultiCsrfProtection
impl !UnwindSafe for MultiCsrfProtection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,