You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
829 B
26 lines
829 B
use aws_config::{AppName, BehaviorVersion};
|
|
use tokio::sync::OnceCell;
|
|
|
|
use crate::http_client::aws::AwsReqwestConnector;
|
|
|
|
fn aws_reqwest_connector() -> AwsReqwestConnector {
|
|
let reqwest_client = reqwest::Client::builder().build().expect("Failed to build reqwest client");
|
|
|
|
AwsReqwestConnector {
|
|
client: reqwest_client,
|
|
}
|
|
}
|
|
|
|
pub(crate) async fn aws_sdk_config() -> &'static aws_config::SdkConfig {
|
|
static AWS_CONFIG: OnceCell<aws_config::SdkConfig> = OnceCell::const_new();
|
|
|
|
AWS_CONFIG
|
|
.get_or_init(async || {
|
|
aws_config::defaults(BehaviorVersion::latest())
|
|
.app_name(AppName::new("vaultwarden").expect("Failed to build AWS app name"))
|
|
.http_client(aws_reqwest_connector())
|
|
.load()
|
|
.await
|
|
})
|
|
.await
|
|
}
|
|
|