diff --git a/services/security.py b/services/security.py index 3bb7e05..d7f1bce 100644 --- a/services/security.py +++ b/services/security.py @@ -18,6 +18,7 @@ import logging import os import platform import re +import sys from getpass import getpass import keyring @@ -79,6 +80,20 @@ def retrieve_api_key(service: str, username: str, password: str) -> str: aesgcm = AESGCM(key) pt = aesgcm.decrypt(nonce, ct, associated_data=None) 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: