aboutsummaryrefslogtreecommitdiff
path: root/src/mailstore.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-15 18:44:58 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-15 18:44:58 +0200
commit5599901b3b99700bee872877f88c8100f5e3ff47 (patch)
tree509c6bf0c1a0e7e8ea06d213ab68a0e57012f0f7 /src/mailstore.rs
parent06145440cdd8098581b1ea7a6cae7fc8722a3a7d (diff)
downloadaerogramme-5599901b3b99700bee872877f88c8100f5e3ff47.tar.gz
aerogramme-5599901b3b99700bee872877f88c8100f5e3ff47.zip
Remove mailstore that is deprecated
Diffstat (limited to 'src/mailstore.rs')
-rw-r--r--src/mailstore.rs33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/mailstore.rs b/src/mailstore.rs
deleted file mode 100644
index 2bcc592..0000000
--- a/src/mailstore.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use std::sync::Arc;
-
-use anyhow::{bail, Result};
-use rusoto_signature::Region;
-
-use crate::config::*;
-use crate::login::{ldap_provider::*, static_provider::*, *};
-
-pub struct Mailstore {
- pub login_provider: Box<dyn LoginProvider + Send + Sync>,
-}
-impl Mailstore {
- pub fn new(config: Config) -> Result<Arc<Self>> {
- let s3_region = Region::Custom {
- name: config.aws_region.clone(),
- endpoint: config.s3_endpoint,
- };
- let k2v_region = Region::Custom {
- name: config.aws_region,
- endpoint: config.k2v_endpoint,
- };
- let login_provider: Box<dyn LoginProvider + Send + Sync> =
- match (config.login_static, config.login_ldap) {
- (Some(st), None) => Box::new(StaticLoginProvider::new(st, k2v_region, s3_region)?),
- (None, Some(ld)) => Box::new(LdapLoginProvider::new(ld, k2v_region, s3_region)?),
- (Some(_), Some(_)) => {
- bail!("A single login provider must be set up in config file")
- }
- (None, None) => bail!("No login provider is set up in config file"),
- };
- Ok(Arc::new(Self { login_provider }))
- }
-}