def _load_secrets():
secrets_path = _get_secrets_path()
if not path.isfile(secrets_path):
logging.getLogger(__name__).debug("No secrets file found")
return {}
f = Fernet(key)
with open(secrets_path, 'rb') as secrets_file:
try:
return json.loads(f.decrypt(secrets_file.read()).decode())
except InvalidToken:
logging.getLogger(__name__).critical("You entered the wrong password")
async_handler.shutdown()
return None
评论列表
文章目录