aboutsummaryrefslogtreecommitdiff
path: root/src/login/ldap_provider.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-18 17:09:44 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-18 17:09:44 +0100
commit3d41f40dc8cd6bdfa7a9279ab1959564d06eefaf (patch)
treefff5d16e266788b28e812c24669f50118831512b /src/login/ldap_provider.rs
parent684f4de225c44464abcb6a9cb2ef6dcae90537a8 (diff)
downloadaerogramme-3d41f40dc8cd6bdfa7a9279ab1959564d06eefaf.tar.gz
aerogramme-3d41f40dc8cd6bdfa7a9279ab1959564d06eefaf.zip
Storage trait new implementation
Diffstat (limited to 'src/login/ldap_provider.rs')
-rw-r--r--src/login/ldap_provider.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/login/ldap_provider.rs b/src/login/ldap_provider.rs
index 4e3af3c..009605d 100644
--- a/src/login/ldap_provider.rs
+++ b/src/login/ldap_provider.rs
@@ -85,11 +85,11 @@ impl LdapLoginProvider {
})
}
- fn storage_creds_from_ldap_user(&self, user: &SearchEntry) -> Result<Builders> {
- let storage: Builders = match &self.storage_specific {
- StorageSpecific::InMemory => Box::new(storage::in_memory::FullMem::new(
+ fn storage_creds_from_ldap_user(&self, user: &SearchEntry) -> Result<Builder> {
+ let storage: Builder = match &self.storage_specific {
+ StorageSpecific::InMemory => storage::in_memory::MemBuilder::new(
&get_attr(user, &self.username_attr)?
- )),
+ ),
StorageSpecific::Garage { from_config, bucket_source } => {
let aws_access_key_id = get_attr(user, &from_config.aws_access_key_id_attr)?;
let aws_secret_access_key = get_attr(user, &from_config.aws_secret_access_key_attr)?;
@@ -99,14 +99,14 @@ impl LdapLoginProvider {
};
- Box::new(storage::garage::GrgCreds {
+ storage::garage::GarageBuilder::new(storage::garage::GarageConf {
region: from_config.aws_region.clone(),
s3_endpoint: from_config.s3_endpoint.clone(),
k2v_endpoint: from_config.k2v_endpoint.clone(),
aws_access_key_id,
aws_secret_access_key,
- bucket
- })
+ bucket,
+ })?
},
};