diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-02-23 17:01:51 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-02-23 17:01:51 +0100 |
commit | 02a8537556236437d905cefe8aa2c5d0a96f129a (patch) | |
tree | 823c209287b2bd5373bf941ea5362e7f97eb94f6 /src/login/static_provider.rs | |
parent | a579382042e0e1af95a00e97647a2cc3794fb108 (diff) | |
download | aerogramme-02a8537556236437d905cefe8aa2c5d0a96f129a.tar.gz aerogramme-02a8537556236437d905cefe8aa2c5d0a96f129a.zip |
Replace with a single AWS HTTP client
Diffstat (limited to 'src/login/static_provider.rs')
-rw-r--r-- | src/login/static_provider.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/login/static_provider.rs b/src/login/static_provider.rs index 1e1ecbf..e190a91 100644 --- a/src/login/static_provider.rs +++ b/src/login/static_provider.rs @@ -25,6 +25,7 @@ pub struct UserDatabase { pub struct StaticLoginProvider { user_db: watch::Receiver<UserDatabase>, in_memory_store: storage::in_memory::MemDb, + garage_store: storage::garage::GarageRoot, } pub async fn update_user_list(config: PathBuf, up: watch::Sender<UserDatabase>) -> Result<()> { @@ -84,6 +85,7 @@ impl StaticLoginProvider { Ok(Self { user_db: rx, in_memory_store: storage::in_memory::MemDb::new(), + garage_store: storage::garage::GarageRoot::new(), }) } } @@ -109,7 +111,7 @@ impl LoginProvider for StaticLoginProvider { let storage: storage::Builder = match &user.config.storage { StaticStorage::InMemory => self.in_memory_store.builder(username).await, StaticStorage::Garage(grgconf) => { - storage::garage::GarageBuilder::new(storage::garage::GarageConf { + self.garage_store.user(storage::garage::GarageConf { region: grgconf.aws_region.clone(), k2v_endpoint: grgconf.k2v_endpoint.clone(), s3_endpoint: grgconf.s3_endpoint.clone(), @@ -140,7 +142,7 @@ impl LoginProvider for StaticLoginProvider { let storage: storage::Builder = match &user.config.storage { StaticStorage::InMemory => self.in_memory_store.builder(&user.username).await, StaticStorage::Garage(grgconf) => { - storage::garage::GarageBuilder::new(storage::garage::GarageConf { + self.garage_store.user(storage::garage::GarageConf { region: grgconf.aws_region.clone(), k2v_endpoint: grgconf.k2v_endpoint.clone(), s3_endpoint: grgconf.s3_endpoint.clone(), |