diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-12-29 17:16:41 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-12-29 17:16:41 +0100 |
commit | 771c4eac799ec3d9f1e9c41ab1fdc75c1bcb4868 (patch) | |
tree | 9bea644618301be0a0eb1478e54e9e59f8690eda /src/login | |
parent | adb1a3b7c1cb24a773060f5944cdfe1ea7bd5816 (diff) | |
download | aerogramme-771c4eac799ec3d9f1e9c41ab1fdc75c1bcb4868.tar.gz aerogramme-771c4eac799ec3d9f1e9c41ab1fdc75c1bcb4868.zip |
covering imap commands
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/demo_provider.rs | 13 | ||||
-rw-r--r-- | src/login/mod.rs | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/login/demo_provider.rs b/src/login/demo_provider.rs index 0efb37c..11c7d54 100644 --- a/src/login/demo_provider.rs +++ b/src/login/demo_provider.rs @@ -1,14 +1,14 @@ use crate::login::*; use crate::storage::*; -pub struct DemoLoginProvider{ +pub struct DemoLoginProvider { keys: CryptoKeys, in_memory_store: in_memory::MemDb, } impl DemoLoginProvider { pub fn new() -> Self { - Self { + Self { keys: CryptoKeys::init(), in_memory_store: in_memory::MemDb::new(), } @@ -26,8 +26,8 @@ impl LoginProvider for DemoLoginProvider { if password != "hunter2" { bail!("wrong password"); - } - + } + let storage = self.in_memory_store.builder("alice").await; let keys = self.keys.clone(); @@ -43,6 +43,9 @@ impl LoginProvider for DemoLoginProvider { let storage = self.in_memory_store.builder("alice").await; let public_key = self.keys.public.clone(); - Ok(PublicCredentials { storage, public_key }) + Ok(PublicCredentials { + storage, + public_key, + }) } } diff --git a/src/login/mod.rs b/src/login/mod.rs index 6f2ca31..4a1dee1 100644 --- a/src/login/mod.rs +++ b/src/login/mod.rs @@ -1,6 +1,6 @@ +pub mod demo_provider; pub mod ldap_provider; pub mod static_provider; -pub mod demo_provider; use base64::Engine; use std::sync::Arc; |