From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9E43A62E07 for ; Wed, 28 Oct 2020 12:37:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 948621E807 for ; Wed, 28 Oct 2020 12:36:41 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id EC88E1E7F2 for ; Wed, 28 Oct 2020 12:36:40 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B9D1845E4A for ; Wed, 28 Oct 2020 12:36:40 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Wed, 28 Oct 2020 12:36:24 +0100 Message-Id: <20201028113632.814586-4-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028113632.814586-1-f.gruenbichler@proxmox.com> References: <20201028113632.814586-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [environment.rs] Subject: [pbs-devel] [PATCH proxmox] rpcenv: rename user to auth_id X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 11:37:11 -0000 since it does no longer store just a userid, but potentially an API token identifier as well Signed-off-by: Fabian Grünbichler --- proxmox/src/api/cli/environment.rs | 10 +++++----- proxmox/src/api/rpc_environment.rs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/proxmox/src/api/cli/environment.rs b/proxmox/src/api/cli/environment.rs index 4831e3f..6085292 100644 --- a/proxmox/src/api/cli/environment.rs +++ b/proxmox/src/api/cli/environment.rs @@ -6,7 +6,7 @@ use crate::api::{RpcEnvironment, RpcEnvironmentType}; #[derive(Default)] pub struct CliEnvironment { result_attributes: Value, - user: Option, + auth_id: Option, } impl CliEnvironment { @@ -28,11 +28,11 @@ impl RpcEnvironment for CliEnvironment { RpcEnvironmentType::CLI } - fn set_user(&mut self, user: Option) { - self.user = user; + fn set_auth_id(&mut self, auth_id: Option) { + self.auth_id = auth_id; } - fn get_user(&self) -> Option { - self.user.clone() + fn get_auth_id(&self) -> Option { + self.auth_id.clone() } } diff --git a/proxmox/src/api/rpc_environment.rs b/proxmox/src/api/rpc_environment.rs index 430f3a6..0dc06d9 100644 --- a/proxmox/src/api/rpc_environment.rs +++ b/proxmox/src/api/rpc_environment.rs @@ -14,11 +14,11 @@ pub trait RpcEnvironment: std::any::Any + AsAny + Send { /// The environment type fn env_type(&self) -> RpcEnvironmentType; - /// Set user name - fn set_user(&mut self, user: Option); + /// Set authentication id + fn set_auth_id(&mut self, user: Option); - /// Get user name - fn get_user(&self) -> Option; + /// Get authentication id + fn get_auth_id(&self) -> Option; /// Set the client IP, should be re-set if a proxied connection was detected fn set_client_ip(&mut self, _client_ip: Option) { -- 2.20.1