From 869c2927d30844f49d442fa6bd0648f3d8174774 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sat, 18 Apr 2026 15:43:11 +0200 Subject: [PATCH] add allow_prompt parameter to get_secret to support non-interactive secret retrieval --- wrapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wrapper.py b/wrapper.py index 1a26537..e07a452 100755 --- a/wrapper.py +++ b/wrapper.py @@ -224,7 +224,7 @@ def detect_launch_command(): return commands -def get_secret(config, config_path): +def get_secret(config, config_path, allow_prompt=True): """ Retrieves the OTP secret in the following priority: 1. System Keyring (SERVICE_NAME, USERNAME) - if available @@ -266,6 +266,9 @@ def get_secret(config, config_path): # No keyring, just use config return secret + if not allow_prompt: + return None + # 3. Prompt User if HAS_KEYRING: print("\nOTP Secret not found in keyring.")