Skip to content

Commit

Permalink
chore: update reqwest to 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Jul 25, 2024
1 parent 3aa1f2e commit 4092dbd
Show file tree
Hide file tree
Showing 24 changed files with 706 additions and 413 deletions.
952 changes: 625 additions & 327 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ opt-level = 1
# Dependencies that should be kept in sync through the whole workspace
[workspace.dependencies]
anyhow = "1.0.71"
arrow-array = "50.0.0"
arrow = "52"
arrow-array = "52"
arc-swap = { version = "1.5.1", features = ["serde"] }
assert_cmd = "2.0.6"
async-graphql = "6.0.7"
Expand Down Expand Up @@ -387,18 +388,18 @@ ntest = "0.9.0"
num-bigint = "0.4.4"
num_cpus = "1.15.0"
num_enum = "0.6.1"
object_store = { version = "0.7", features = ["aws", "gcp", "azure", "http"] }
object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] }
once_cell = "1.18.0"
ouroboros = "0.17"
parking_lot = "0.12.1"
parquet = "50.0.0"
parquet = "52"
pkcs8 = { version = "0.9.0", features = ["std"] }
pprof = { version = "0.11.0", features = ["cpp", "frame-pointer"] }
pretty_assertions = "1.3.0"
prettytable-rs = "0.10.0"
proc-macro2 = "1.0.47"
prometheus = "0.13.3"
prometheus-http-query = { version = "0.6.6", default_features = false, features = [
prometheus-http-query = { version = "0.8", default_features = false, features = [
"rustls-tls",
] }
prometheus-parse = { git = "https://github.com/asonnino/prometheus-parser.git", rev = "75334db" }
Expand All @@ -414,7 +415,7 @@ rand = "0.8.5"
rayon = "1.5.3"
rcgen = "0.9.2"
regex = "1.7.1"
reqwest = { version = "0.11.20", default_features = false, features = [
reqwest = { version = "0.12", default_features = false, features = [
"blocking",
"json",
"rustls-tls",
Expand Down Expand Up @@ -465,6 +466,7 @@ similar = "2.4.0"
slip10_ed25519 = "0.1.3"
smallvec = "1.10.0"
snap = "1.1.0"
snowflake-api = "0.9.0"
static_assertions = "1.1.0"
strum = { version = "0.24", features = ["derive"] }
strum_macros = "0.24.3"
Expand Down Expand Up @@ -506,7 +508,6 @@ tower-http = { version = "0.3.4", features = [
"set-header",
"propagate-header",
] }
# tower-http = { version="0.4", features = ["trace"] }
tower-layer = "0.3.2"
twox-hash = "1.6.3"
tracing = "0.1.37"
Expand Down Expand Up @@ -565,10 +566,10 @@ move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract-
move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" }
move-analyzer = { path = "external-crates/move/crates/move-analyzer" }

fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", package = "fastcrypto-zkp" }
fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", features = ["experimental"] }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", package = "fastcrypto-zkp" }
fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = ["experimental"] }
passkey-types = { version = "0.2.0" }
passkey-client = { version = "0.2.0" }
passkey-authenticator = { version = "0.2.0" }
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-analytics-indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ move-bytecode-utils.workspace = true
sui-json-rpc-types.workspace = true
sui-package-resolver.workspace = true
simulacrum.workspace = true
arrow = { version = "50.0.0"}
arrow.workspace = true
gcp-bigquery-client = "0.18.0"
snowflake-api = { version = "0.7.0" }
tap = { version = "1.0.1", features = [] }
snowflake-api.workspace = true
tap.workspace = true

[dev-dependencies]

Expand Down
4 changes: 2 additions & 2 deletions crates/sui-data-ingestion/src/workers/archival.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl ArchivalWorker {

let bytes = finalize_manifest(manifest)?;
self.remote_store
.put(&Path::from("MANIFEST"), bytes)
.put(&Path::from("MANIFEST"), bytes.into())
.await?;
Ok(())
}
Expand All @@ -133,7 +133,7 @@ impl ArchivalWorker {
let mut cursor = Cursor::new(buffer);
compress(&mut cursor, &mut compressed_buffer)?;
self.remote_store
.put(&location, Bytes::from(compressed_buffer.clone()))
.put(&location, Bytes::from(compressed_buffer.clone()).into())
.await?;
Ok(Bytes::from(compressed_buffer))
}
Expand Down
4 changes: 3 additions & 1 deletion crates/sui-data-ingestion/src/workers/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ impl Worker for BlobWorker {
"{}.chk",
checkpoint.checkpoint_summary.sequence_number
));
self.remote_store.put(&location, Bytes::from(bytes)).await?;
self.remote_store
.put(&location, Bytes::from(bytes).into())
.await?;
Ok(())
}
}
2 changes: 1 addition & 1 deletion crates/sui-graphql-rpc-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use async_graphql::Value;
use hyper::header::ToStrError;
use reqwest::header::ToStrError;
use serde_json::Number;

pub mod response;
Expand Down
13 changes: 6 additions & 7 deletions crates/sui-graphql-rpc-client/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

use super::ClientError;
use async_graphql::{Response, ServerError, Value};
use axum::http::HeaderName;
use hyper::HeaderMap;
use reqwest::header::{HeaderMap, HeaderName};
use reqwest::Response as ReqwestResponse;
use serde_json::json;
use std::{collections::BTreeMap, net::SocketAddr};
Expand All @@ -14,8 +13,8 @@ use sui_graphql_rpc_headers::VERSION_HEADER;
pub struct GraphqlResponse {
headers: HeaderMap,
remote_address: Option<SocketAddr>,
http_version: hyper::Version,
status: hyper::StatusCode,
http_version: reqwest::Version,
status: reqwest::StatusCode,
full_response: Response,
}

Expand All @@ -39,7 +38,7 @@ impl GraphqlResponse {
pub fn graphql_version(&self) -> Result<String, ClientError> {
Ok(self
.headers
.get(&VERSION_HEADER)
.get(VERSION_HEADER.as_str())
.ok_or(ClientError::ServiceVersionHeaderNotFound)?
.to_str()
.map_err(|e| ClientError::ServiceVersionHeaderValueInvalidString { error: e })?
Expand All @@ -58,11 +57,11 @@ impl GraphqlResponse {
serde_json::to_string_pretty(&self.full_response).unwrap()
}

pub fn http_status(&self) -> hyper::StatusCode {
pub fn http_status(&self) -> reqwest::StatusCode {
self.status
}

pub fn http_version(&self) -> hyper::Version {
pub fn http_version(&self) -> reqwest::Version {
self.http_version
}

Expand Down
9 changes: 6 additions & 3 deletions crates/sui-graphql-rpc-client/src/simple_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

use crate::ClientError;
use axum::http::HeaderValue;
use hyper::header;
use reqwest::header;
use reqwest::header::HeaderValue;
use reqwest::Response;
use serde_json::Value;
use std::collections::BTreeMap;
Expand Down Expand Up @@ -52,7 +52,10 @@ impl SimpleClient {
mut headers: Vec<(header::HeaderName, header::HeaderValue)>,
) -> Result<GraphqlResponse, ClientError> {
if get_usage {
headers.push((LIMITS_HEADER.clone(), HeaderValue::from_static("true")));
headers.push((
LIMITS_HEADER.clone().as_str().try_into().unwrap(),
HeaderValue::from_static("true"),
));
}
GraphqlResponse::from_resp(self.execute_impl(query, variables, headers, false).await?).await
}
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-graphql-rpc/src/server/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,10 @@ pub mod tests {
server_builder.build_schema();

let resp = reqwest::get(&url).await.unwrap();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.status(), reqwest::StatusCode::OK);

let url_with_param = format!("{}?max_checkpoint_lag_ms=1", url);
let resp = reqwest::get(&url_with_param).await.unwrap();
assert_eq!(resp.status(), StatusCode::GATEWAY_TIMEOUT);
assert_eq!(resp.status(), reqwest::StatusCode::GATEWAY_TIMEOUT);
}
}
2 changes: 1 addition & 1 deletion crates/sui-graphql-rpc/tests/e2e_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
.unwrap();

assert_eq!(res.http_status().as_u16(), 200);
assert_eq!(res.http_version(), hyper::Version::HTTP_11);
assert_eq!(res.http_version(), reqwest::Version::HTTP_11);
assert!(res.graphql_version().unwrap().len() >= 5);
assert!(res.errors().is_empty());

Expand Down
6 changes: 3 additions & 3 deletions crates/sui-metric-checker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ pub fn fails_threshold_condition(
}

fn unix_seconds_to_timestamp_string(unix_seconds: i64) -> String {
let datetime = NaiveDateTime::from_timestamp_opt(unix_seconds, 0);
let timestamp: DateTime<Utc> = DateTime::from_naive_utc_and_offset(datetime.unwrap(), Utc);
timestamp.to_string()
DateTime::from_timestamp(unix_seconds, 0)
.unwrap()
.to_string()
}

#[cfg(test)]
Expand Down
3 changes: 1 addition & 2 deletions crates/sui-node/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use axum::http::header;
use mysten_network::metrics::MetricsCallbackProvider;
use prometheus::{
register_histogram_vec_with_registry, register_int_counter_vec_with_registry,
Expand Down Expand Up @@ -105,7 +104,7 @@ pub fn start_metrics_push_task(config: &sui_config::NodeConfig, registry: Regist
.client()
.post(url.to_owned())
.header(reqwest::header::CONTENT_ENCODING, "snappy")
.header(header::CONTENT_TYPE, PROTOBUF_FORMAT)
.header(reqwest::header::CONTENT_TYPE, PROTOBUF_FORMAT)
.body(compressed)
.send()
.await?;
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ prometheus = "0.13.3"
tokio = { workspace = true, features = ["full"] }
tracing = "0.1.36"
once_cell.workspace = true
reqwest = { version = "0.11.13", default_features = false, features = ["blocking", "json", "rustls-tls"] }
reqwest.workspace = true
serde = { version = "1.0.144", features = ["derive", "rc"] }
serde_json = { version = "1.0.1" }
jsonpath_lib = "0.3.0"
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mod tests {
use crate::prom_to_mimir::tests::*;

use crate::{admin::CertKeyPair, config::RemoteWriteConfig, peers::SuiNodeProvider};
use axum::http::{header, StatusCode};
use axum::http::StatusCode;
use axum::routing::post;
use axum::Router;
use multiaddr::Multiaddr;
Expand Down Expand Up @@ -170,14 +170,14 @@ mod tests {

let res = client
.post(&server_url)
.header(header::CONTENT_TYPE, PROTOBUF_FORMAT)
.header(reqwest::header::CONTENT_TYPE, PROTOBUF_FORMAT)
.body(buf)
.send()
.await
.expect("expected a successful post with a self-signed certificate");
let status = res.status();
let body = res.text().await.unwrap();
assert_eq!("created", body);
assert_eq!(status, StatusCode::CREATED);
assert_eq!(status, reqwest::StatusCode::CREATED);
}
}
3 changes: 1 addition & 2 deletions crates/sui-rest-api/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

use axum::{
extract::State,
http::HeaderMap,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
};
use reqwest::StatusCode;

use crate::{
content_type::ContentType,
Expand Down
3 changes: 2 additions & 1 deletion crates/sui-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ impl SuiClientBuilder {
let auth = base64::engine::general_purpose::STANDARD
.encode(format!("{}:{}", username, password));
headers.insert(
reqwest::header::AUTHORIZATION,
"authorization",
// reqwest::header::AUTHORIZATION,
HeaderValue::from_str(&format!("Basic {}", auth)).unwrap(),
);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-security-watchdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tokio.workspace = true
tracing.workspace = true
anyhow.workspace = true
chrono.workspace = true
snowflake-api = { version = "0.7.0"}
snowflake-api.workspace = true
tokio-cron-scheduler = "0.10.0"
clap.workspace = true
prometheus.workspace = true
Expand All @@ -24,4 +24,4 @@ async-trait.workspace = true
uuid.workspace = true
lexical-util = "0.8.5"
reqwest = { workspace = true, features = ["json"] }
env_logger = "0.11.3"
env_logger = "0.11.3"
2 changes: 1 addition & 1 deletion crates/sui-source-validation-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tower-http.workspace = true
[dev-dependencies]
expect-test = "1.4.0"
fs_extra = "1.3.0"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] }
reqwest.workspace = true

sui.workspace = true
sui-move = { workspace = true, features = ["all"] }
Expand Down
Loading

0 comments on commit 4092dbd

Please sign in to comment.