From 51f5acea228dd5fc28f74ade3503d4cfd5ec2fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 28 Oct 2020 12:36:24 +0100 Subject: [PATCH] rpcenv: rename user to auth_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since it does no longer store just a userid, but potentially an API token identifier as well Signed-off-by: Fabian Grünbichler Signed-off-by: Wolfgang Bumiller --- 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 4831e3fc..60852929 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 430f3a6c..0dc06d90 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) {