diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-07-25 10:59:48 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-07-25 10:59:48 +0200 |
commit | 17fba10d8ffe14bb47ae6389dbb28b012eac1b35 (patch) | |
tree | e9bb16c769d926985b7e1259626a284dce84d865 /src/login | |
parent | 24fed41288531bf3bf69657eaf3287ff545d0254 (diff) | |
download | aerogramme-17fba10d8ffe14bb47ae6389dbb28b012eac1b35.tar.gz aerogramme-17fba10d8ffe14bb47ae6389dbb28b012eac1b35.zip |
replacing mail_parser by eml_codec, first iteration
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/mod.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/login/mod.rs b/src/login/mod.rs index 6d2ec71..9df640b 100644 --- a/src/login/mod.rs +++ b/src/login/mod.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use anyhow::{anyhow, bail, Context, Result}; use async_trait::async_trait; use k2v_client::{ - BatchInsertOp, BatchReadOp, CausalValue, CausalityToken, Filter, K2vClient, K2vValue, + BatchInsertOp, BatchReadOp, CausalValue, CausalityToken, Filter, K2vClient, K2vValue, K2vClientConfig }; use rand::prelude::*; use rusoto_core::HttpClient; @@ -120,19 +120,16 @@ impl Credentials { impl StorageCredentials { pub fn k2v_client(&self) -> Result<K2vClient> { - let aws_creds = AwsCredentials::new( - self.aws_access_key_id.clone(), - self.aws_secret_access_key.clone(), - None, - None, - ); - - Ok(K2vClient::new( - self.k2v_region.as_rusoto_region(), - self.bucket.clone(), - aws_creds, - None, - )?) + let config = K2vClientConfig { + endpoint: self.k2v_region.endpoint.clone(), + region: self.k2v_region.name.clone(), + aws_access_key_id: self.aws_access_key_id.clone(), + aws_secret_access_key: self.aws_secret_access_key.clone(), + bucket: self.bucket.clone(), + user_agent: None, + }; + + Ok(K2vClient::new(config)?) } pub fn s3_client(&self) -> Result<S3Client> { |