Skip to content

Commit

Permalink
chore: upgrade reqwest to 0.12 and remove direct deb of http (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Threated authored Jul 28, 2024
1 parent b921140 commit 998967f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ license = "Apache-2.0"

[dependencies]
base64 = "0.22.1"
http = "0.2"
reqwest = { version = "0.11", default-features = false, features = ["json", "default-tls"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "default-tls"] }
serde = { version = "1.0.152", features = ["serde_derive"] }
serde_json = "1.0"
thiserror = "1.0.38"
Expand Down
2 changes: 1 addition & 1 deletion src/beam.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Duration;

use beam_lib::{TaskResult, BeamClient, BlockingOptions, MsgId, TaskRequest, RawString};
use http::StatusCode;
use reqwest::StatusCode;
use once_cell::sync::Lazy;
use serde::Serialize;
use tracing::{debug, warn, info};
Expand Down
2 changes: 1 addition & 1 deletion src/blaze.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use http::StatusCode;
use reqwest::StatusCode;
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
Expand Down
16 changes: 8 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

use beam_lib::AppId;
use clap::Parser;
use http::{HeaderValue, Uri};
use reqwest::{header::HeaderValue, Url};
use once_cell::sync::Lazy;
use reqwest::{Certificate, Client, Proxy};
use tracing::{debug, info, warn};
Expand Down Expand Up @@ -55,7 +55,7 @@ const CLAP_FOOTER: &str = "For proxy support, environment variables HTTP_PROXY,
struct CliArgs {
/// The beam proxy's base URL, e.g. https://proxy1.beam.samply.de
#[clap(long, env, value_parser)]
beam_proxy_url: Uri,
beam_proxy_url: Url,

/// This application's beam AppId, e.g. focus.proxy1.broker.samply.de
#[clap(long, env, value_parser)]
Expand All @@ -71,15 +71,15 @@ struct CliArgs {

/// The endpoint base URL, e.g. https://blaze.site/fhir/
#[clap(long, env, value_parser)]
endpoint_url: Option<Uri>,
endpoint_url: Option<Url>,

/// The endpoint base URL, e.g. https://blaze.site/fhir/, for the sake of backward compatibility, use endpoint_url instead
#[clap(long, env, value_parser)]
blaze_url: Option<Uri>,
blaze_url: Option<Url>,

/// The exporter URL, e.g. https://exporter.site/
#[clap(long, env, value_parser)]
exporter_url: Option<Uri>,
exporter_url: Option<Url>,

/// Type of the endpoint, e.g. "blaze", "omop"
#[clap(long, env, value_parser = clap::value_parser!(EndpointType), default_value = "blaze")]
Expand Down Expand Up @@ -164,12 +164,12 @@ struct CliArgs {
}

pub(crate) struct Config {
pub beam_proxy_url: Uri,
pub beam_proxy_url: Url,
pub beam_app_id_long: AppId,
pub api_key: String,
pub retry_count: usize,
pub endpoint_url: Uri,
pub exporter_url: Option<Uri>,
pub endpoint_url: Url,
pub exporter_url: Option<Url>,
pub endpoint_type: EndpointType,
pub obfuscate: Obfuscate,
pub obfuscate_zero: bool,
Expand Down
3 changes: 2 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use reqwest::header;
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down Expand Up @@ -55,7 +56,7 @@ pub enum FocusError {
#[error("Invalid date format: {0}")]
AstInvalidDateFormat(String),
#[error("Invalid Header Value: {0}")]
InvalidHeaderValue(http::header::InvalidHeaderValue),
InvalidHeaderValue(header::InvalidHeaderValue),
#[error("Missing Exporter Endpoint")]
MissingExporterEndpoint,
#[error("Missing Exporter Task Type")]
Expand Down
5 changes: 1 addition & 4 deletions src/exporter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use http::header;
use http::HeaderMap;
use http::HeaderValue;
use http::StatusCode;
use reqwest::{header::{self, HeaderMap, HeaderValue}, StatusCode};
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
Expand Down
5 changes: 1 addition & 4 deletions src/intermediate_rep.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use http::header;
use http::HeaderMap;
use http::HeaderValue;
use http::StatusCode;
use reqwest::{header::{self, HeaderMap, HeaderValue}, StatusCode};
use serde::Deserialize;
use serde::Serialize;
use tracing::{debug, warn};
Expand Down

0 comments on commit 998967f

Please sign in to comment.