fix(backend): use certifi for ssl store
This commit is contained in:
parent
01114692dc
commit
53f257bc4b
2 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
|||
import aiohttp
|
||||
import certifi
|
||||
import ssl
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
@ -14,7 +16,8 @@ def reformat_reject_date(date: str):
|
|||
@router.get('/reject')
|
||||
async def reject_proxy(date: str, time: str, activity: str, space: str):
|
||||
"""We proxy the rejectdopamine API to maintain user pivacy (the extension does not transmit user IP addresses to third-party services)"""
|
||||
async with aiohttp.ClientSession(headers={'User-Agent': 'Mozilla 5.0 (compatible); aci-backend/1.0 (+https://git.ashhhleyyy.dev/ash/aci)'}) as session:
|
||||
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||
async with aiohttp.ClientSession(headers={'User-Agent': 'Mozilla 5.0 (compatible); aci-backend/1.0 (+https://git.ashhhleyyy.dev/ash/aci)'}, connector=aiohttp.TCPConnector(ssl=ssl_context)) as session:
|
||||
async with session.get('https://rejectdopamine.com/api/app/active/yrk/cs/1') as resp:
|
||||
response = await resp.json()
|
||||
activities = []
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
fastapi
|
||||
uvicorn
|
||||
aiohttp
|
||||
certifi
|
||||
python-lsp-server
|
||||
];
|
||||
version = self.shortRev or self.dirtyShortDev or "dirty-inputs";
|
||||
|
|
Loading…
Reference in a new issue