Update services/security.py
This commit is contained in:
@@ -18,6 +18,7 @@ import logging
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
from getpass import getpass
|
||||
|
||||
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)
|
||||
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:
|
||||
configure_keyring_backend()
|
||||
|
||||
Reference in New Issue
Block a user