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

chore(deps): update reqwest #769

Closed
wants to merge 2 commits into from
Closed
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
574 changes: 437 additions & 137 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ skip = [
# tokio and mio are bringing in older versions of windows libraries while other
# libraries, are bringing in newer versions
{ name = "windows-sys", version = "=0.48" },
{ name = "windows-sys", version = "=0.52" },
{ name = "windows-targets", version = "=0.48" },
{ name = "windows_aarch64_gnullvm", version = "=0.48" },
{ name = "windows_aarch64_msvc", version = "=0.48" },
Expand All @@ -85,6 +86,22 @@ skip = [
{ name = "windows_x86_64_gnu", version = "=0.48" },
{ name = "windows_x86_64_gnullvm", version = "=0.48" },
{ name = "windows_x86_64_msvc", version = "=0.48" },
# aws-smithy-runtime v1.5.4 is using old versions of these libraries
{ name = "tokio-rustls", version = "=0.24.1" },
{ name = "regex-syntax", version = "=0.6.29" },
{ name = "half", version = "=1.8.3" },
{ name = "hyper-rustls", version = "=0.24.2" },
{ name = "hyper", version = "=0.14.30" },
{ name = "http-body", version = "=0.4.6" },
{ name = "h2", version = "=0.3.26" },
# toktio-rustls 0.24.1 is using an old version of rustls-webpki
{ name = "rustls-webpki", version = "=0.101.7" },
# noxious-client is using an old versions of these libraries
{ name = "winreg", version = "=0.50.0" },
{ name = "reqwest", version = "=0.11.27" },
{ name = "rustls-pemfile", version = "= 1.0.4" },
# building with the old version of reqwest (feature "http") brings older versions of these libraries
{ name = "sync_wrapper", version = "=0.1.2" },
]

skip-tree = [
Expand Down
4 changes: 3 additions & 1 deletion tough/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ olpc-cjson = { version = "0.1", path = "../olpc-cjson" }
pem = "3"
percent-encoding = "2"
reqwest = { version = "0.11", optional = true, default-features = false, features = ["stream"] }
reqwest-hyper-v1 = { package = "reqwest", version = "0.12", optional = true, default-features = false, features = ["stream"] }
ring = { version = "0.17", features = ["std"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand All @@ -39,13 +40,14 @@ walkdir = "2"
[dev-dependencies]
failure-server = { path = "../integ/failure-server" }
hex-literal = "0.4"
httptest = "0.15"
httptest = "0.16"
maplit = "1"
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
tokio-test = "0.4"

[features]
http = ["reqwest"]
http-v1 = ["reqwest-hyper-v1"]

# The `integ` feature enables integration tests. These tests require `noxious-server` to be installed on the host.
integ = []
4 changes: 4 additions & 0 deletions tough/src/http.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! The `http` module provides `HttpTransport` which enables `Repository` objects to be
//! loaded over HTTP

#[cfg(feature = "http-v1")]
use reqwest_hyper_v1 as reqwest;

use crate::transport::TransportStream;
use crate::{Transport, TransportError, TransportErrorKind};
use async_trait::async_trait;
Expand Down
4 changes: 2 additions & 2 deletions tough/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mod datastore;
pub mod editor;
pub mod error;
mod fetch;
#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
pub mod http;
mod io;
pub mod key_source;
Expand All @@ -49,7 +49,7 @@ use crate::datastore::Datastore;
use crate::error::Result;
use crate::fetch::{fetch_max_size, fetch_sha256};
/// An HTTP transport that includes retries.
#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
pub use crate::http::{HttpTransport, HttpTransportBuilder};
use crate::io::is_dir;
use crate::schema::{
Expand Down
12 changes: 6 additions & 6 deletions tough/src/transport.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::SafeUrlPath;
#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
use crate::{HttpTransport, HttpTransportBuilder};
use async_trait::async_trait;
use bytes::Bytes;
Expand Down Expand Up @@ -220,15 +220,15 @@ impl Transport for FilesystemTransport {
#[derive(Debug, Clone, Copy)]
pub struct DefaultTransport {
file: FilesystemTransport,
#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
http: HttpTransport,
}

impl Default for DefaultTransport {
fn default() -> Self {
Self {
file: FilesystemTransport,
#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
http: HttpTransport::default(),
}
}
Expand All @@ -241,7 +241,7 @@ impl DefaultTransport {
}
}

#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
impl DefaultTransport {
/// Create a new `DefaultTransport` with potentially customized settings.
pub fn new_with_http_settings(builder: HttpTransportBuilder) -> Self {
Expand All @@ -267,7 +267,7 @@ impl Transport for DefaultTransport {
}

impl DefaultTransport {
#[cfg(not(feature = "http"))]
#[cfg(not(any(feature = "http", feature = "http-v1")))]
#[allow(clippy::trivially_copy_pass_by_ref, clippy::unused_self)]
async fn handle_http(&self, url: Url) -> Result<TransportStream, TransportError> {
Err(TransportError::new_with_cause(
Expand All @@ -277,7 +277,7 @@ impl DefaultTransport {
))
}

#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
async fn handle_http(&self, url: Url) -> Result<TransportStream, TransportError> {
self.http.fetch(url).await
}
Expand Down
6 changes: 3 additions & 3 deletions tough/tests/http.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod test_utils;

/// Instead of guarding every individual thing with `#[cfg(feature = "http")]`, use a module.
#[cfg(feature = "http")]
/// Instead of guarding every individual thing with `#[cfg(any(feature = "http", feature = "http-v1"))]`, use a module.
#[cfg(any(feature = "http", feature = "http-v1"))]
mod http_happy {
use crate::test_utils::{read_to_end, test_data};
use httptest::{matchers::*, responders::*, Expectation, Server};
Expand Down Expand Up @@ -93,7 +93,7 @@ mod http_happy {
}
}

#[cfg(feature = "http")]
#[cfg(any(feature = "http", feature = "http-v1"))]
#[cfg(feature = "integ")]
mod http_integ {
use crate::test_utils::test_data;
Expand Down
2 changes: 1 addition & 1 deletion tough/tests/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod test_utils;

/// If the `http` feature is not enabled, we should get an error message indicating that the feature
/// is not enabled.
#[cfg(not(feature = "http"))]
#[cfg(not(any(feature = "http", feature = "http-v1")))]
#[tokio::test]
async fn default_transport_error_no_http() {
let transport = DefaultTransport::new();
Expand Down
2 changes: 2 additions & 0 deletions tuftool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ simplelog = "0.12"
snafu = { version = "0.8", features = ["backtraces-impl-backtrace-crate"] }
tempfile = "3"
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
# Cannot use "http-v1" feature until aws-smithy-runtime moves to hyper v1
tough = { version = "0.18", path = "../tough", features = ["http"] }
tough-kms = { version = "0.10", path = "../tough-kms" }
tough-ssm = { version = "0.13", path = "../tough-ssm" }
Expand All @@ -44,4 +45,5 @@ walkdir = "2"
assert_cmd = "2"
futures = "0.3"
futures-core = "0.3"
# Cannot upgrade to httptest >= 0.16 until the move to hyper v1 is done
httptest = "0.15"