Update services/security.py

This commit is contained in:
2025-10-16 16:55:37 -04:00
parent 5343b27533
commit efe14760b6
+15
View File
@@ -18,6 +18,7 @@ import logging
import os import os
import platform import platform
import re import re
import sys
from getpass import getpass from getpass import getpass
import keyring import keyring
@@ -80,6 +81,20 @@ def retrieve_api_key(service: str, username: str, password: str) -> str:
pt = aesgcm.decrypt(nonce, ct, associated_data=None) pt = aesgcm.decrypt(nonce, ct, associated_data=None)
return pt.decode() return pt.decode()
logger.debug(f"API key for service '{service}' and user '{username}' stored successfully.")
print("\n✅ API key stored securely.")
print("️ The program will now exit. Press Enter to continue...")
try:
_ = input()
except Exception:
pass
_ = None
sys.exit(0)
def api_key_exists(service: str, username: str) -> bool: def api_key_exists(service: str, username: str) -> bool:
configure_keyring_backend() configure_keyring_backend()