aws: Update to AWS SDK 0.53/0.23

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1047>
This commit is contained in:
Sebastian Dröge 2023-01-14 18:58:30 +02:00
parent f5e01b9196
commit 0c954135a3
5 changed files with 16 additions and 67 deletions

View file

@ -16,13 +16,14 @@ futures = "0.3"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
aws-config = "0.52.0"
aws-sdk-s3 = "0.22.0"
aws-sdk-transcribe = "0.22.0"
aws-types = "0.52.0"
aws-sig-auth = "0.52.0"
aws-smithy-http = { version = "0.52.0", features = [ "rt-tokio" ] }
aws-smithy-types = "0.52.0"
aws-config = "0.53.0"
aws-sdk-s3 = "0.23.0"
aws-sdk-transcribe = "0.23.0"
aws-types = "0.53.0"
aws-credential-types = "0.53.0"
aws-sig-auth = "0.53.0"
aws-smithy-http = { version = "0.53.0", features = [ "rt-tokio" ] }
aws-smithy-types = "0.53.0"
http = "0.2.7"
chrono = "0.4"
url = "2"

View file

@ -14,11 +14,11 @@ use gst::{element_imp_error, error_msg, loggable_error};
use std::default::Default;
use aws_config::default_provider::credentials::DefaultCredentialsChain;
use aws_credential_types::{provider::ProvideCredentials, Credentials};
use aws_sig_auth::signer::{self, HttpSignatureType, OperationSigningConfig, RequestConfig};
use aws_smithy_http::body::SdkBody;
use aws_types::credentials::ProvideCredentials;
use aws_types::region::{Region, SigningRegion};
use aws_types::{Credentials, SigningService};
use aws_types::SigningService;
use std::time::{Duration, SystemTime};
use chrono::prelude::*;

View file

@ -22,10 +22,8 @@ use gst::{element_imp_error, glib, prelude::*, subclass::prelude::*};
use aws_sdk_s3::config;
use aws_sdk_s3::model::ObjectCannedAcl;
use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::Endpoint;
use aws_sdk_s3::{config::retry::RetryConfig, Client, Credentials, Region};
use aws_types::sdk_config::SdkConfig;
use http::Uri;
use crate::s3utils;
@ -376,29 +374,13 @@ impl S3HlsSink {
}
let sdk_config = settings.config.as_ref().expect("SDK config must be set");
let endpoint_uri = match &settings.endpoint_uri {
Some(endpoint) => match endpoint.parse::<Uri>() {
Ok(uri) => Some(uri),
Err(e) => {
element_imp_error!(
self,
gst::ResourceError::Settings,
["Invalid S3 endpoint uri. Error: {}", e]
);
None
}
},
None => None,
};
let config_builder = config::Builder::from(sdk_config)
.region(settings.s3_region.clone())
.retry_config(RetryConfig::standard().with_max_attempts(settings.retry_attempts));
let config = if let Some(uri) = endpoint_uri {
config_builder
.endpoint_resolver(Endpoint::mutable_uri(uri).expect("Failed to parse endpoint"))
.build()
let config = if let Some(ref uri) = settings.endpoint_uri {
config_builder.endpoint_url(uri).build()
} else {
config_builder.build()
};

View file

@ -17,9 +17,7 @@ use aws_sdk_s3::client::fluent_builders::{
use aws_sdk_s3::config;
use aws_sdk_s3::model::{CompletedMultipartUpload, CompletedPart};
use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::Endpoint;
use aws_sdk_s3::{config::retry::RetryConfig, Client, Credentials, Region};
use http::Uri;
use futures::future;
use once_cell::sync::Lazy;
@ -517,26 +515,11 @@ impl S3Sink {
}
})?;
let endpoint_uri = match &settings.endpoint_uri {
Some(endpoint) => match endpoint.parse::<Uri>() {
Ok(uri) => Some(uri),
Err(e) => {
return Err(gst::error_msg!(
gst::ResourceError::Settings,
["Invalid S3 endpoint uri. Error: {}", e]
));
}
},
None => None,
};
let config_builder = config::Builder::from(&sdk_config)
.retry_config(RetryConfig::standard().with_max_attempts(settings.retry_attempts));
let config = if let Some(uri) = endpoint_uri {
config_builder
.endpoint_resolver(Endpoint::mutable_uri(uri).expect("Failed to parse endpoint"))
.build()
let config = if let Some(ref uri) = settings.endpoint_uri {
config_builder.endpoint_url(uri).build()
} else {
config_builder.build()
};

View file

@ -13,9 +13,7 @@ use std::sync::Mutex;
use std::time::Duration;
use aws_sdk_s3::config;
use aws_sdk_s3::Endpoint;
use aws_sdk_s3::{config::retry::RetryConfig, Client, Credentials};
use http::Uri;
use gst::glib;
use gst::prelude::*;
@ -130,26 +128,11 @@ impl S3Src {
}
})?;
let endpoint_uri = match &settings.endpoint_uri {
Some(endpoint) => match endpoint.parse::<Uri>() {
Ok(uri) => Some(uri),
Err(e) => {
return Err(gst::error_msg!(
gst::ResourceError::Settings,
["Invalid S3 endpoint uri. Error: {}", e]
));
}
},
None => None,
};
let config_builder = config::Builder::from(&sdk_config)
.retry_config(RetryConfig::standard().with_max_attempts(settings.retry_attempts));
let config = if let Some(uri) = endpoint_uri {
config_builder
.endpoint_resolver(Endpoint::mutable_uri(uri).expect("Failed to parse endpoint"))
.build()
let config = if let Some(ref uri) = settings.endpoint_uri {
config_builder.endpoint_url(uri).build()
} else {
config_builder.build()
};