From e5f72711c5a17c5db24e209b14f82d426eceb86e Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 19 Sep 2024 01:25:31 -0400 Subject: Write tests. --- src/login/extract.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/login/extract.rs') diff --git a/src/login/extract.rs b/src/login/extract.rs index 735bc22..bda55cd 100644 --- a/src/login/extract.rs +++ b/src/login/extract.rs @@ -7,11 +7,20 @@ use axum_extra::extract::cookie::{Cookie, CookieJar}; // The usage pattern here - receive the extractor as an argument, return it in // the response - is heavily modelled after CookieJar's own intended usage. +#[derive(Clone, Debug)] pub struct IdentityToken { cookies: CookieJar, } impl IdentityToken { + /// Creates a new, unpopulated identity token store. + #[cfg(test)] + pub fn new() -> Self { + Self { + cookies: CookieJar::new(), + } + } + /// Get the identity secret sent in the request, if any. If the identity /// was not sent, or if it has previously been [clear]ed, then this will /// return [None]. If the identity has previously been [set], then this -- cgit v1.2.3