Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pub use aws-sdk client #566

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions crates/esthri-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ tokio = { version = "1.23.0", features = ["rt-multi-thread", "signal", "sync"] }
tokio-util = { version = "0.7.8", features = ["compat", "codec"] }
warp = "0.3"

aws-sdk-s3 = { workspace = true }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you would remove this as a workspace dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we pull in esthri, we can remove aws-sdk-s3 dependency.
I'm thinking since esthri is tightly coupled with aws-sdk-s3 basically building on top of that, we should maybe export that to tightly couple the version as well for people using this library

[dev-dependencies]
esthri = { path = "../esthri", default-features = false, features=["blocking"] }
esthri-test = { path = "../esthri-test" }
Expand Down
5 changes: 2 additions & 3 deletions crates/esthri-cli/src/cli_opts.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::path::PathBuf;

use aws_sdk_s3::types::StorageClass as S3StorageClass;
use clap::Args;
use esthri::aws_sdk::StorageClass as S3StorageClass;
use esthri::{opts::*, S3PathParam};
use glob::Pattern;
use std::path::PathBuf;

// Esthri does this by default (and can currently only do this), exposing this
// as an option just ensures that Esthri will still be able to handle the case
Expand Down
15 changes: 7 additions & 8 deletions crates/esthri-cli/src/cli_utils.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
use std::{
env,
ffi::OsStr,
path::Path,
process::{Command, Stdio},
};

use anyhow::{bail, Result};
use aws_sdk_s3::Client as S3Client;
use clap::ArgMatches;
use esthri::aws_sdk::Client as S3Client;
use esthri::{AwsCredProvider, GlobFilter};
use glob::Pattern;
use log::*;
use log_derive::logfn;
use std::{
env,
ffi::OsStr,
path::Path,
process::{Command, Stdio},
};

// Environment variable that can be set to set the path to the aws tool that esthri falls back to
const REAL_AWS_EXECUTABLE_ENV_NAME: &str = "ESTHRI_AWS_PATH";
Expand Down
2 changes: 1 addition & 1 deletion crates/esthri-cli/src/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use async_zip::{
write::{EntryOptions, ZipFileWriter},
Compression,
};
use aws_sdk_s3::Client as S3Client;
use bytes::{Bytes, BytesMut};
use esthri::aws_sdk::Client as S3Client;
use futures::stream::{Stream, StreamExt, TryStreamExt};
use hyper::header::{CONTENT_ENCODING, LOCATION};
use log::*;
Expand Down
9 changes: 4 additions & 5 deletions crates/esthri-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ mod cli_utils;

use anyhow::Result;
use clap::{CommandFactory, Parser, Subcommand};
use glob::Pattern;
use log::*;
use tokio::runtime::Builder;

use aws_sdk_s3::Client as S3Client;
use cli_opts::*;
use cli_utils::*;
use esthri::aws_sdk::Client as S3Client;
use esthri::{self, GlobFilter, PendingUpload};
use glob::Pattern;
use log::*;
use tokio::runtime::Builder;

#[derive(Debug, Parser)]
#[clap(name = "esthri", about = "Simple S3 file transfer utility.", version)]
Expand Down
6 changes: 4 additions & 2 deletions crates/esthri/src/aws_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ use aws_sdk_s3::operation::create_multipart_upload::CreateMultipartUploadOutput;
use aws_sdk_s3::operation::get_object::GetObjectOutput;
use aws_sdk_s3::operation::head_object::{HeadObjectError, HeadObjectOutput};
use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::{CompletedMultipartUpload, CompletedPart, StorageClass};
use aws_sdk_s3::Client;
use aws_sdk_s3::types::{CompletedMultipartUpload, CompletedPart};
use aws_smithy_types_convert::date_time::DateTimeExt;
use bytes::Bytes;
use chrono::{DateTime, Utc};
use futures::Stream;

use crate::{Error, Result};

pub use aws_sdk_s3::types::StorageClass;
pub use aws_sdk_s3::Client;

/// The data returned from a head object request
#[derive(Debug)]
pub struct HeadObjectInfo {
Expand Down
3 changes: 1 addition & 2 deletions crates/esthri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ pub use presign::{
};

pub use aws_sdk::HeadObjectInfo;
use aws_sdk_s3::Client;
use aws_smithy_client::hyper_ext;
pub use aws_smithy_client::hyper_ext;
pub use types::{S3ListingItem, S3Object, S3PathParam};

pub use esthri_internals::new_https_connector;
Expand Down