From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 9D9ED1FF15E for ; Mon, 29 Sep 2025 17:48:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6C66F16F2C; Mon, 29 Sep 2025 17:49:04 +0200 (CEST) From: Christian Ebner To: pdm-devel@lists.proxmox.com Date: Mon, 29 Sep 2025 17:48:18 +0200 Message-ID: <20250929154820.892720-5-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250929154820.892720-1-c.ebner@proxmox.com> References: <20250929154820.892720-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759160890779 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.043 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager 1/3] server: adapt to proxmox-client compat mode changes X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Adapt to the method name and type changes for setting the client login compatibility mode. Signed-off-by: Christian Ebner --- server/src/connection.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/server/src/connection.rs b/server/src/connection.rs index 2eda452..5530812 100644 --- a/server/src/connection.rs +++ b/server/src/connection.rs @@ -19,7 +19,9 @@ use openssl::x509::X509StoreContextRef; use serde::Serialize; use proxmox_acme_api::CertificateInfo; -use proxmox_client::{Client, HttpApiClient, HttpApiResponse, HttpApiResponseStream, TlsOptions}; +use proxmox_client::{ + Client, CompatMode, HttpApiClient, HttpApiResponse, HttpApiResponseStream, TlsOptions, +}; use pdm_api_types::remotes::{NodeUrl, Remote, RemoteType, TlsProbeOutcome}; use pve_api_types::client::PveClientImpl; @@ -32,21 +34,21 @@ static INSTANCE: OnceLock> = OnceLock::new( struct ConnectInfo { prefix: String, perl_compat: bool, - pve_compat: bool, + compat_mode: CompatMode, default_port: u16, } impl ConnectInfo { fn for_remote(remote: &Remote) -> Self { - let (prefix, perl_compat, pve_compat) = match remote.ty { - RemoteType::Pve => ("PVEAPIToken".to_string(), true, true), - RemoteType::Pbs => ("PBSAPIToken".to_string(), false, false), + let (prefix, perl_compat, compat_mode) = match remote.ty { + RemoteType::Pve => ("PVEAPIToken".to_string(), true, CompatMode::PveTfa), + RemoteType::Pbs => ("PBSAPIToken".to_string(), false, CompatMode::Generic), }; ConnectInfo { prefix, perl_compat, - pve_compat, + compat_mode, default_port: remote.ty.default_port(), } } @@ -56,7 +58,7 @@ impl ConnectInfo { fn prepare_connect_client_to_node( node: &NodeUrl, default_port: u16, - pve_compat: bool, + compat_mode: CompatMode, ) -> Result { let mut options = TlsOptions::default(); @@ -75,7 +77,7 @@ fn prepare_connect_client_to_node( let mut client = proxmox_client::Client::with_options(uri.clone(), options, Default::default())?; - client.set_pve_compatibility(pve_compat); + client.set_compatibility(compat_mode); Ok(client) } @@ -99,7 +101,7 @@ fn prepare_connect_client( let info = ConnectInfo::for_remote(remote); - let client = prepare_connect_client_to_node(node, info.default_port, info.pve_compat)?; + let client = prepare_connect_client_to_node(node, info.default_port, info.compat_mode)?; Ok((client, info)) } @@ -135,7 +137,7 @@ fn prepare_connect_multi_client(remote: &Remote) -> Result<(MultiClient, Connect client: Arc::new(prepare_connect_client_to_node( node, info.default_port, - info.pve_compat, + info.compat_mode, )?), hostname: node.hostname.clone(), }); -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel