mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 19:44:57 +02:00
add more auth, post, and put tests
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user