This commit is contained in:
cheykrym 2025-07-10 01:49:05 +03:00
parent d3633a7b47
commit b0250a47aa
2 changed files with 6 additions and 3 deletions

View File

@ -27,7 +27,11 @@ async def _fetch_current_user(
user_agent = request.headers.get("User-Agent", "(unknown)")
try:
async with httpx.AsyncClient(verify=False) as client:
async with httpx.AsyncClient(
verify=settings.CA_CERT,
cert=(settings.CLIENT_FULLCHAIN, settings.CLIENT_PRIVKEY),
timeout=5.0
) as client:
response = await client.post(
f"{settings.TOKEN_SERVICE}/decode",
json={
@ -36,7 +40,6 @@ async def _fetch_current_user(
"user_agent": user_agent,
"require_permissions": require_permissions
},
timeout=5.0
)
except httpx.RequestError:
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable")

View File

@ -1,6 +1,6 @@
[project]
name = "common-lib"
version = "0.0.6"
version = "0.0.7"
description = "Библиотека общих компонентов для микросервисов yobble"
authors = [{ name = "cheykrym", email = "you@example.com" }]
license = "MIT"