diff --git a/Cargo.toml b/Cargo.toml index 5e4e1627..f50111b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,7 +93,7 @@ zstd = { version = "0.6", features = [ "bindgen" ] } pathpatterns = "0.1.2" pxar = { version = "0.10.1", features = [ "tokio-io" ] } -proxmox-http = { version = "0.6.4", features = [ "client", "client-trait", "http-helpers", "proxmox-async", "websocket" ] } +proxmox-http = { version = "0.7", features = [ "client", "client-trait", "http-helpers", "proxmox-async", "websocket" ] } proxmox-io = "1" proxmox-lang = "1.1" proxmox-metrics = "0.2" diff --git a/debian/control b/debian/control index 5fd3014d..11002722 100644 --- a/debian/control +++ b/debian/control @@ -47,12 +47,12 @@ Build-Depends: debhelper (>= 12), librust-proxmox-borrow-1+default-dev, librust-proxmox-compression-0.1+default-dev (>= 0.1.1-~~), librust-proxmox-fuse-0.1+default-dev (>= 0.1.3-~~), - librust-proxmox-http-0.6+client-dev (>= 0.6.4-~~), - librust-proxmox-http-0.6+client-trait-dev (>= 0.6.4-~~), - librust-proxmox-http-0.6+default-dev (>= 0.6.4-~~), - librust-proxmox-http-0.6+http-helpers-dev (>= 0.6.4-~~), - librust-proxmox-http-0.6+proxmox-async-dev (>= 0.6.4-~~), - librust-proxmox-http-0.6+websocket-dev (>= 0.6.4-~~), + librust-proxmox-http-0.7+client-dev, + librust-proxmox-http-0.7+client-trait-dev, + librust-proxmox-http-0.7+default-dev, + librust-proxmox-http-0.7+http-helpers-dev, + librust-proxmox-http-0.7+proxmox-async-dev, + librust-proxmox-http-0.7+websocket-dev, librust-proxmox-io-1+default-dev (>= 1.0.1-~~), librust-proxmox-io-1+tokio-dev (>= 1.0.1-~~), librust-proxmox-lang-1+default-dev (>= 1.1-~~), diff --git a/pbs-client/Cargo.toml b/pbs-client/Cargo.toml index 74cb311d..6c61cec3 100644 --- a/pbs-client/Cargo.toml +++ b/pbs-client/Cargo.toml @@ -36,7 +36,7 @@ pathpatterns = "0.1.2" proxmox-async = "0.4" proxmox-compression = "0.1.1" proxmox-fuse = "0.1.3" -proxmox-http = { version = "0.6.4", features = [ "client", "http-helpers", "websocket" ] } +proxmox-http = { version = "0.7", features = [ "client", "http-helpers", "websocket" ] } proxmox-io = { version = "1.0.1", features = [ "tokio" ] } proxmox-lang = "1.1" proxmox-router = { version = "1.2.4", features = [ "cli" ] } diff --git a/proxmox-rest-server/Cargo.toml b/proxmox-rest-server/Cargo.toml index 97400a2b..74cdbea4 100644 --- a/proxmox-rest-server/Cargo.toml +++ b/proxmox-rest-server/Cargo.toml @@ -36,7 +36,7 @@ proxmox-async = "0.4" proxmox-compression = "0.1.1" proxmox-io = "1" proxmox-lang = "1.1" -proxmox-http = { version = "0.6.4", features = [ "client" ] } +proxmox-http = { version = "0.7", features = [ "client" ] } proxmox-router = "1.2.4" proxmox-schema = { version = "1.3.1", features = [ "api-macro", "upid-api-impl" ] } proxmox-time = "1" diff --git a/src/acme/client.rs b/src/acme/client.rs index 886be3e3..46566210 100644 --- a/src/acme/client.rs +++ b/src/acme/client.rs @@ -15,7 +15,7 @@ use proxmox_acme_rs::account::AccountData as AcmeAccountData; use proxmox_acme_rs::order::{Order, OrderData}; use proxmox_acme_rs::Request as AcmeRequest; use proxmox_acme_rs::{Account, Authorization, Challenge, Directory, Error, ErrorResponse}; -use proxmox_http::client::SimpleHttp; +use proxmox_http::client::Client; use proxmox_sys::fs::{replace_file, CreateOptions}; use crate::api2::types::AcmeAccountName; @@ -59,7 +59,7 @@ pub struct AcmeClient { account: Option, directory: Option, nonce: Option, - http_client: SimpleHttp, + http_client: Client, } impl AcmeClient { @@ -480,7 +480,7 @@ impl AcmeResponse { impl AcmeClient { /// Non-self-borrowing run_request version for borrow workarounds. async fn execute( - http_client: &mut SimpleHttp, + http_client: &mut Client, request: AcmeRequest, nonce: &mut Option, ) -> Result { @@ -584,7 +584,7 @@ impl AcmeClient { } async fn get_directory<'a, 'b>( - http_client: &mut SimpleHttp, + http_client: &mut Client, directory_url: &str, directory: &'a mut Option, nonce: &'b mut Option, @@ -617,7 +617,7 @@ impl AcmeClient { /// Like `get_directory`, but if the directory provides no nonce, also performs a `HEAD` /// request on the new nonce URL. async fn get_dir_nonce<'a, 'b>( - http_client: &mut SimpleHttp, + http_client: &mut Client, directory_url: &str, directory: &'a mut Option, nonce: &'b mut Option, @@ -637,7 +637,7 @@ impl AcmeClient { } async fn get_nonce<'a>( - http_client: &mut SimpleHttp, + http_client: &mut Client, nonce: &'a mut Option, new_nonce_url: &str, ) -> Result<&'a str, Error> { diff --git a/src/api2/node/subscription.rs b/src/api2/node/subscription.rs index e266302f..7d9678fc 100644 --- a/src/api2/node/subscription.rs +++ b/src/api2/node/subscription.rs @@ -1,7 +1,8 @@ use anyhow::{bail, format_err, Error}; use serde_json::Value; -use proxmox_http::client::{SimpleHttp, SimpleHttpOptions}; +use proxmox_http::client::Client; +use proxmox_http::HttpOptions; use proxmox_router::{Permission, Router, RpcEnvironment}; use proxmox_schema::api; use proxmox_subscription::{SubscriptionInfo, SubscriptionStatus}; @@ -42,7 +43,7 @@ fn check_and_write_subscription(key: String, server_id: String) -> Result<(), Er None }; - let client = SimpleHttp::with_options(SimpleHttpOptions { + let client = Client::with_options(HttpOptions { proxy_config, user_agent: Some(DEFAULT_USER_AGENT_STRING.to_string()), tcp_keepalive: Some(PROXMOX_BACKUP_TCP_KEEPALIVE_TIME), diff --git a/src/tools/mod.rs b/src/tools/mod.rs index fadb55ef..27278e64 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -5,7 +5,7 @@ use std::any::Any; use anyhow::{bail, Error}; -use proxmox_http::{client::SimpleHttp, client::SimpleHttpOptions, ProxyConfig}; +use proxmox_http::{client::Client, HttpOptions, ProxyConfig}; pub mod apt; pub mod config; @@ -58,15 +58,15 @@ impl AsAny for T { pub const PROXMOX_BACKUP_TCP_KEEPALIVE_TIME: u32 = 120; pub const DEFAULT_USER_AGENT_STRING: &str = "proxmox-backup-client/1.0"; -/// Returns a new instance of `SimpleHttp` configured for PBS usage. -pub fn pbs_simple_http(proxy_config: Option) -> SimpleHttp { - let options = SimpleHttpOptions { +/// Returns a new instance of [`Client`](proxmox_http::client::Client) configured for PBS usage. +pub fn pbs_simple_http(proxy_config: Option) -> Client { + let options = HttpOptions { proxy_config, user_agent: Some(DEFAULT_USER_AGENT_STRING.to_string()), tcp_keepalive: Some(PROXMOX_BACKUP_TCP_KEEPALIVE_TIME), }; - SimpleHttp::with_options(options) + Client::with_options(options) } pub fn setup_safe_path_env() {