Restricted Allowlist listing to show only those allowlists applied to the selected policy

This commit is contained in:
2025-10-06 17:22:41 -04:00
parent 89db386ffe
commit bec051b240
7 changed files with 21 additions and 10 deletions
+9 -3
View File
@@ -118,10 +118,16 @@ def getAPI(USERNAME, SERVICE_NAME):
raise ValueError("Failed to retrieve API key after 3 incorrect attempts.")
else:
logging.warning(f"No API key found for user '{USERNAME}' in service '{SERVICE_NAME}'.")
api_key = input(f"🔑 No API key found. Please enter your API key for '{SERVICE_NAME}': ").strip()
api_key = getpass(f"🔑 No API key found. Please enter your API key for '{SERVICE_NAME}': ").strip()
while True:
password = getpass("🔐 Create a password to encrypt your API key: ")
confirm_password = getpass("🔐 Confirm your password: ")
if password != confirm_password:
logging.warning("❌ Passwords do not match. Try again.")
continue
if check_password_complexity(password):
try:
store_api_key(SERVICE_NAME, USERNAME, api_key, password)
@@ -131,8 +137,8 @@ def getAPI(USERNAME, SERVICE_NAME):
logging.error(f"Failed to store API key: {e}")
break
else:
print("❌ Password does not meet complexity requirements. Try again.")
return api_key
logging.warning("❌ Password does not meet complexity requirements. Try again.")
class APIKeyManager:
_api_key = None