diff --git a/requirements.txt b/requirements.txt index 07ae365..19b1237 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ certifi==2023.11.17 charset-normalizer==3.3.2 idna==3.4 +dotenv==1.0.1 requests==2.31.0 setuptools==69.0.0 six==1.16.0 diff --git a/resolved_task.py b/resolved_task.py index b67d2a5..1e71261 100644 --- a/resolved_task.py +++ b/resolved_task.py @@ -5,8 +5,11 @@ import sys import requests +from dotenv import load_dotenv from logging_config import setup_logging +load_dotenv() + logger = setup_logging(__name__) base_dir = os.path.dirname(os.path.realpath(__file__)) @@ -18,14 +21,14 @@ sys.stdout.reconfigure(encoding='utf-8') QUEUE_NAME = 'TESTIMPORT' - +TOKEN = os.getenv('TOKEN') def close_tasks_in_queue(queue_name): base_url = 'https://api.tracker.yandex.net/v2/issues/_search' # base_url = 'https://api.tracker.yandex.net/v2/issues/_search?expand=transitions' headers = { 'Host': 'api.tracker.yandex.net', - 'Authorization': 'OAuth y0_AgAEA7qkB3KjAArkXwAAAADzMlP9oR1lwMzBS2e94jHzdnII8Laxi7k', + 'Authorization': TOKEN, 'X-Org-ID': '7095769', 'Content-Type': 'application/json', }