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/demo_provider.rs | |
parent | adb1a3b7c1cb24a773060f5944cdfe1ea7bd5816 (diff) | |
download | aerogramme-771c4eac799ec3d9f1e9c41ab1fdc75c1bcb4868.tar.gz aerogramme-771c4eac799ec3d9f1e9c41ab1fdc75c1bcb4868.zip |
covering imap commands
Diffstat (limited to 'src/login/demo_provider.rs')
-rw-r--r-- | src/login/demo_provider.rs | 13 |
1 files changed, 8 insertions, 5 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, + }) } } |