add more auth, post, and put tests

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2025-09-01 16:00:52 +07:00
parent 5b8284a10d
commit 11ae31625f
7 changed files with 140 additions and 36 deletions
+7
View File
@@ -49,6 +49,13 @@ async fn main() -> anyhow::Result<()> {
let postgres = postgres::pool().await?;
let s3 = s3::client().await;
match s3.head_bucket().bucket(&CONFIG.s3_bucket).send().await {
Ok(_) => info!("s3 bucket {} OK", &CONFIG.s3_bucket),
Err(e) => {
warn!("s3 bucket {} not available: {}", &CONFIG.s3_bucket, e);
}
}
let bind_to = SocketAddr::new(CONFIG.bind_host.as_str().parse()?, CONFIG.bind_port);
async fn auth(
+5 -1
View File
@@ -1,5 +1,5 @@
use anyhow::Result;
use aws_config::BehaviorVersion;
use aws_config::{BehaviorVersion, Region, default_provider::region};
use aws_sdk_s3::{
Config,
types::{CompletedMultipartUpload, CompletedPart},
@@ -19,6 +19,10 @@ pub async fn client() -> S3Client {
.into_builder()
.build();
let endpoint = sdk_config.endpoint_url().unwrap();
let region = sdk_config.region().unwrap();
tracing::debug!(endpoint, ?region, "s3 connection");
let s3_config = Config::from(sdk_config)
.to_builder()
.force_path_style(true)