From 2b1e18f14f52a5a732604fdfcc143a256f207034 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Wed, 30 Oct 2024 18:32:23 -0500 Subject: [PATCH] * Initialize `debug_info` before the try block in `exchange_token` function in `d2x/auth/sf/auth_url.py` * Add a check for `debug_info` being not None before setting the error message in the exception block * Add functions to set and get environment variables and secrets in `d2x/api/gh.py` --- d2x/api/gh.py | 528 ++++++++++++++++++++++++++++++++++------ d2x/auth/sf/auth_url.py | 4 +- 2 files changed, 461 insertions(+), 71 deletions(-) diff --git a/d2x/api/gh.py b/d2x/api/gh.py index 2105f6f..69d52c1 100644 --- a/d2x/api/gh.py +++ b/d2x/api/gh.py @@ -1,72 +1,460 @@ import os import requests - - -def set_environment_variable(env_name: str, var_name: str, var_value: str) -> None: - """Set a variable in a GitHub Environment""" - token = os.environ.get("GITHUB_TOKEN") - if not token: - raise ValueError("GITHUB_TOKEN environment variable not set") - - url = f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}/environments/{env_name}/variables/{var_name}" - headers = { - "Authorization": f"Bearer {token}", - "Accept": "application/vnd.github.v3+json", - } - data = {"name": var_name, "value": var_value} - - response = requests.put(url, headers=headers, json=data) - response.raise_for_status() - - -def get_environment_variable(env_name: str, var_name: str) -> str: - """Get a variable from a GitHub Environment""" - token = os.environ.get("GITHUB_TOKEN") - if not token: - raise ValueError("GITHUB_TOKEN environment variable not set") - - url = f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}/environments/{env_name}/variables/{var_name}" - headers = { - "Authorization": f"Bearer {token}", - "Accept": "application/vnd.github.v3+json", - } - - response = requests.get(url, headers=headers) - response.raise_for_status() - - return response.json()["value"] - - -def set_environment_secret(env_name: str, secret_name: str, secret_value: str) -> None: - """Set a secret in a GitHub Environment""" - token = os.environ.get("GITHUB_TOKEN") - if not token: - raise ValueError("GITHUB_TOKEN environment variable not set") - - url = f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}/environments/{env_name}/secrets/{secret_name}" - headers = { - "Authorization": f"Bearer {token}", - "Accept": "application/vnd.github.v3+json", - } - data = {"encrypted_value": secret_value} - - response = requests.put(url, headers=headers, json=data) - response.raise_for_status() - - -def get_environment_secret(env_name: str, secret_name: str) -> str: - """Get a secret from a GitHub Environment""" - token = os.environ.get("GITHUB_TOKEN") - if not token: - raise ValueError("GITHUB_TOKEN environment variable not set") - - url = f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}/environments/{env_name}/secrets/{secret_name}" - headers = { - "Authorization": f"Bearer {token}", - "Accept": "application/vnd.github.v3+json", - } - - response = requests.get(url, headers=headers) - response.raise_for_status() - - return response.json()["encrypted_value"] +from cryptography.hazmat.primitives.kdf.scrypt import Scrypt +from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.kdf.hkdf import HKDF +from cryptography.hazmat.primitives.kdf.concatkdf import ConcatKDFHash +from cryptography.hazmat.primitives.kdf.concatkdf import ConcatKDFHMAC +from cryptography.hazmat.primitives.kdf.x963kdf import X963KDF +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC +from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation +from cryptography.hazmat.primitives.kdf.kbkdf import Mode +from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC diff --git a/d2x/auth/sf/auth_url.py b/d2x/auth/sf/auth_url.py index f632f48..4ab1d06 100644 --- a/d2x/auth/sf/auth_url.py +++ b/d2x/auth/sf/auth_url.py @@ -31,6 +31,7 @@ def exchange_token(org_info: SalesforceOrgInfo, cli_options: CLIOptions): """Exchange refresh token for access token with detailed error handling""" console = cli_options.console + debug_info = None # Initialize debug_info before the try block with Progress( SpinnerColumn(), TextColumn("[progress.description]{task.description}"), @@ -129,7 +130,8 @@ def exchange_token(org_info: SalesforceOrgInfo, cli_options: CLIOptions): return token_response except Exception as e: - debug_info.error = str(e) + if debug_info is not None: + debug_info.error = str(e) error_panel = Panel( f"[red]Error: {str(e)}", title="[red]Authentication Failed",