summaryrefslogtreecommitdiff
path: root/src/login/extract.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-19 01:25:31 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-20 23:55:22 -0400
commite5f72711c5a17c5db24e209b14f82d426eceb86e (patch)
tree04865172284c86549dd08d700c21a29c36f54005 /src/login/extract.rs
parent0079624488af334817f58e30dbc676d3adde8de6 (diff)
Write tests.
Diffstat (limited to 'src/login/extract.rs')
-rw-r--r--src/login/extract.rs9
1 files changed, 9 insertions, 0 deletions
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