refactor(resolved_tasks):add secrets to the .env

This commit is contained in:
Ангелина Тингаева 2024-03-27 12:51:11 +05:00
parent d73a2da3e6
commit 27166314af
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
certifi==2023.11.17 certifi==2023.11.17
charset-normalizer==3.3.2 charset-normalizer==3.3.2
idna==3.4 idna==3.4
dotenv==1.0.1
requests==2.31.0 requests==2.31.0
setuptools==69.0.0 setuptools==69.0.0
six==1.16.0 six==1.16.0

View File

@ -5,8 +5,11 @@ import sys
import requests import requests
from dotenv import load_dotenv
from logging_config import setup_logging from logging_config import setup_logging
load_dotenv()
logger = setup_logging(__name__) logger = setup_logging(__name__)
base_dir = os.path.dirname(os.path.realpath(__file__)) base_dir = os.path.dirname(os.path.realpath(__file__))
@ -18,14 +21,14 @@ sys.stdout.reconfigure(encoding='utf-8')
QUEUE_NAME = 'TESTIMPORT' QUEUE_NAME = 'TESTIMPORT'
TOKEN = os.getenv('TOKEN')
def close_tasks_in_queue(queue_name): 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'
# base_url = 'https://api.tracker.yandex.net/v2/issues/_search?expand=transitions' # base_url = 'https://api.tracker.yandex.net/v2/issues/_search?expand=transitions'
headers = { headers = {
'Host': 'api.tracker.yandex.net', 'Host': 'api.tracker.yandex.net',
'Authorization': 'OAuth y0_AgAEA7qkB3KjAArkXwAAAADzMlP9oR1lwMzBS2e94jHzdnII8Laxi7k', 'Authorization': TOKEN,
'X-Org-ID': '7095769', 'X-Org-ID': '7095769',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
} }