From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 7285A1FF153 for ; Mon, 06 Jul 2026 10:03:28 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B5B2F2145F; Mon, 06 Jul 2026 10:03:27 +0200 (CEST) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Subject: [PATCH backup v4 4/4] client: Rename get_secret_impl method Date: Mon, 6 Jul 2026 10:02:44 +0200 Message-ID: <20260706080246.108256-5-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260706080246.108256-1-m.sandoval@proxmox.com> References: <20260706080246.108256-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783324991944 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YUWBTGLKKHST7MN5PVRKC74B76NRWDXH X-Message-ID-Hash: YUWBTGLKKHST7MN5PVRKC74B76NRWDXH X-MailFrom: m.sandoval@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: To get_secret_string to reflect this is a unicode string. Signed-off-by: Maximiliano Sandoval --- pbs-client/src/tools/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pbs-client/src/tools/mod.rs b/pbs-client/src/tools/mod.rs index d99215c44..778c301c6 100644 --- a/pbs-client/src/tools/mod.rs +++ b/pbs-client/src/tools/mod.rs @@ -166,7 +166,7 @@ fn get_secret_from_env(base_name: &str) -> Result, Error> { /// is UTF-8 encoded. /// /// [credential]: https://systemd.io/CREDENTIALS/ -fn get_secret_impl(env_variable: &str, credential_name: &str) -> Result, Error> { +fn get_secret_string(env_variable: &str, credential_name: &str) -> Result, Error> { if let Some(password) = get_secret_from_env(env_variable)? { Ok(Some(password)) } else if let Some(blob) = get_credential(credential_name)? { @@ -188,7 +188,7 @@ fn get_secret_impl(env_variable: &str, credential_name: &str) -> Result Result, Error> { - get_secret_impl(ENV_VAR_PBS_PASSWORD, CRED_PBS_PASSWORD) + get_secret_string(ENV_VAR_PBS_PASSWORD, CRED_PBS_PASSWORD) .map(|opt| opt.map(|s| s.trim_end_matches('\n').to_string())) } @@ -204,14 +204,14 @@ pub fn get_password() -> Result, Error> { /// /// [credential]: https://systemd.io/CREDENTIALS/ pub fn get_encryption_password() -> Result, Error> { - get_secret_impl( + get_secret_string( ENV_VAR_PBS_ENCRYPTION_PASSWORD, CRED_PBS_ENCRYPTION_PASSWORD, ) } pub fn get_default_repository() -> Option { - get_secret_impl(ENV_VAR_PBS_REPOSITORY, CRED_PBS_REPOSITORY) + get_secret_string(ENV_VAR_PBS_REPOSITORY, CRED_PBS_REPOSITORY) .inspect_err(|err| { proxmox_log::error!("could not read default repository: {err:#}"); }) @@ -230,7 +230,7 @@ pub fn get_default_repository() -> Option { /// /// [credential]: https://systemd.io/CREDENTIALS/ pub fn get_fingerprint() -> Option { - get_secret_impl(ENV_VAR_PBS_FINGERPRINT, CRED_PBS_FINGERPRINT) + get_secret_string(ENV_VAR_PBS_FINGERPRINT, CRED_PBS_FINGERPRINT) .inspect_err(|err| { proxmox_log::error!("could not read fingerprint: {err:#}"); }) -- 2.47.3