Skip to content

Commit

Permalink
Bump AWS SDKs to latest version (#476)
Browse files Browse the repository at this point in the history
This removes webpki from our dependencies to fix this: https://rustsec.org/advisories/RUSTSEC-2023-0052

Signed-off-by: James Bornholt <[email protected]>
  • Loading branch information
jamesbornholt authored Aug 23, 2023
1 parent 5556377 commit b9f7e91
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 207 deletions.
306 changes: 133 additions & 173 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions mountpoint-s3-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ serde_json = "1.0.104"

[dev-dependencies]
anyhow = { version = "1.0.64", features = ["backtrace"] }
aws-config = "0.54.1"
aws-credential-types = "0.54.1"
aws-sdk-s3 = "0.24.0"
aws-sdk-sts = "0.24.0"
aws-config = "0.56.0"
aws-credential-types = "0.56.0"
aws-sdk-s3 = "0.29.0"
aws-sdk-sts = "0.29.0"
aws-smithy-runtime-api = "0.56.1"
bytes = "1.2.1"
clap = "4.1.9"
ctor = "0.1.23"
Expand Down
4 changes: 2 additions & 2 deletions mountpoint-s3-client/tests/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::option::Option::None;

use aws_config::default_provider::credentials::DefaultCredentialsChain;
use aws_credential_types::provider::ProvideCredentials;
use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::Region;
use aws_sdk_s3::config::Region;
use aws_sdk_s3::primitives::ByteStream;
use bytes::Bytes;
use common::*;
use futures::StreamExt;
Expand Down
12 changes: 8 additions & 4 deletions mountpoint-s3-client/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#![cfg(feature = "s3_tests")]

use aws_sdk_s3 as s3;
use aws_sdk_s3::config::Region;
use aws_sdk_s3::error::SdkError;
use aws_sdk_s3::operation::list_multipart_uploads::ListMultipartUploadsError;
use aws_sdk_s3::primitives::ByteStream;
use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
use bytes::Bytes;
use futures::{pin_mut, Stream, StreamExt};
use mountpoint_s3_client::{EndpointConfig, S3ClientConfig, S3CrtClient};
use mountpoint_s3_crt::common::rust_log_adapter::RustLogAdapter;
use rand::rngs::OsRng;
use rand::RngCore;
use s3::Region;
use std::ops::Range;

/// Enable tracing and CRT logging when running unit tests.
Expand Down Expand Up @@ -72,7 +76,7 @@ pub async fn create_objects_for_test(client: &s3::Client, bucket: &str, prefix:
.put_object()
.bucket(bucket)
.key(format!("{}{}", prefix, name.as_ref()))
.body(s3::types::ByteStream::from(Bytes::from_static(b".")))
.body(ByteStream::from(Bytes::from_static(b".")))
.send()
.await
.unwrap();
Expand All @@ -83,7 +87,7 @@ pub async fn get_mpu_count_for_key(
client: &s3::Client,
bucket: &str,
key: &str,
) -> Result<usize, aws_sdk_s3::types::SdkError<aws_sdk_s3::error::ListMultipartUploadsError>> {
) -> Result<usize, SdkError<ListMultipartUploadsError, HttpResponse>> {
let upload_count = client
.list_multipart_uploads()
.bucket(bucket)
Expand All @@ -105,7 +109,7 @@ async fn test_sdk_create_object() {
.put_object()
.bucket(bucket)
.key(format!("{prefix}hello"))
.body(s3::types::ByteStream::from(Bytes::from_static(b".")))
.body(ByteStream::from(Bytes::from_static(b".")))
.send()
.await
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3-client/tests/delete_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pub mod common;

use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::primitives::ByteStream;
use bytes::Bytes;
use common::*;
use mountpoint_s3_client::{DeleteObjectError, ObjectClientError, S3CrtClient, S3RequestError};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3-client/tests/endpoint_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pub mod common;

use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::primitives::ByteStream;
use bytes::Bytes;
use common::*;
use mountpoint_s3_client::{AddressingStyle, EndpointConfig, ObjectClient, S3ClientConfig, S3CrtClient};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3-client/tests/get_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::ops::Range;
use std::option::Option::None;
use std::str::FromStr;

use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::primitives::ByteStream;
use bytes::Bytes;
use common::*;
use futures::stream::StreamExt;
Expand Down
6 changes: 3 additions & 3 deletions mountpoint-s3-client/tests/get_object_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pub mod common;

use aws_sdk_s3::model::{ChecksumAlgorithm, CompletedMultipartUpload, CompletedPart};
use aws_sdk_s3::output::CompleteMultipartUploadOutput;
use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::operation::complete_multipart_upload::CompleteMultipartUploadOutput;
use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::{ChecksumAlgorithm, CompletedMultipartUpload, CompletedPart};
use bytes::Bytes;
use common::*;
use mountpoint_s3_client::{GetObjectAttributesError, ObjectAttribute, ObjectClientError, S3CrtClient, S3RequestError};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3-client/tests/head_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pub mod common;

use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::primitives::ByteStream;
use bytes::Bytes;
use common::*;
use mountpoint_s3_client::{HeadObjectError, ObjectClientError, S3CrtClient, S3RequestError};
Expand Down
4 changes: 2 additions & 2 deletions mountpoint-s3-client/tests/put_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async fn test_put_checksums() {
.get_object_attributes()
.bucket(bucket)
.key(key)
.object_attributes(aws_sdk_s3::model::ObjectAttributes::ObjectParts)
.object_attributes(aws_sdk_s3::types::ObjectAttributes::ObjectParts)
.send()
.await
.unwrap();
Expand Down Expand Up @@ -319,7 +319,7 @@ async fn test_put_object_storage_class(storage_class: &str) {
.get_object_attributes()
.bucket(bucket)
.key(key)
.object_attributes(aws_sdk_s3::model::ObjectAttributes::StorageClass)
.object_attributes(aws_sdk_s3::types::ObjectAttributes::StorageClass)
.send()
.await
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions mountpoint-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ procfs = { version = "0.15.1", default-features = false }
[dev-dependencies]
assert_cmd = "2.0.6"
assert_fs = "1.0.9"
aws-config = "0.54.1"
aws-sdk-s3 = "0.24.0"
aws-sdk-sts = "0.24.0"
aws-config = "0.56.0"
aws-sdk-s3 = "0.29.0"
aws-sdk-sts = "0.29.0"
base16ct = { version = "0.1.1", features = ["alloc"] }
ctor = "0.1.23"
filetime = "0.2.21"
Expand Down
4 changes: 2 additions & 2 deletions mountpoint-s3/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use aws_sdk_s3::types::ByteStream;
use aws_sdk_s3::Region;
use aws_sdk_s3::config::Region;
use aws_sdk_s3::primitives::ByteStream;
use fuser::{FileAttr, FileType};
use futures::executor::ThreadPool;
use mountpoint_s3::fs::{self, DirectoryReplier, ReadReplier, ToErrno};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3/tests/fuse_tests/fork_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg(feature = "s3_tests")]

use assert_cmd::prelude::*;
use aws_sdk_sts::Region;
use aws_sdk_sts::config::Region;
use std::fs;
use std::io::{BufRead, BufReader};
use std::process::Stdio;
Expand Down
16 changes: 7 additions & 9 deletions mountpoint-s3/tests/fuse_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ mod s3_session {

use std::future::Future;

use aws_sdk_s3::error::HeadObjectErrorKind;
use aws_sdk_s3::model::ChecksumAlgorithm;
use aws_sdk_s3::Region;
use aws_sdk_s3::{error::HeadObjectError, types::ByteStream, Client};
use aws_sdk_s3::config::Region;
use aws_sdk_s3::operation::head_object::HeadObjectError;
use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::ChecksumAlgorithm;
use aws_sdk_s3::Client;
use mountpoint_s3_client::{EndpointConfig, S3ClientConfig, S3CrtClient};

/// Create a FUSE mount backed by a real S3 client
Expand Down Expand Up @@ -309,10 +310,7 @@ mod s3_session {
match result {
Ok(_) => Ok(true),
Err(e) => match e.into_service_error() {
HeadObjectError {
kind: HeadObjectErrorKind::NotFound(_),
..
} => Ok(false),
HeadObjectError::NotFound(_) => Ok(false),
err => Err(Box::new(err) as Box<dyn std::error::Error>),
},
}
Expand All @@ -338,7 +336,7 @@ mod s3_session {
.get_object_attributes()
.bucket(&self.bucket)
.key(full_key)
.object_attributes(aws_sdk_s3::model::ObjectAttributes::StorageClass)
.object_attributes(aws_sdk_s3::types::ObjectAttributes::StorageClass)
.send(),
)
.map(|output| output.storage_class().map(|s| s.as_str().to_string()))
Expand Down

0 comments on commit b9f7e91

Please sign in to comment.