diff --git a/common_lib/utils/auth.py b/common_lib/utils/auth.py index 80f9d08..49cee6a 100644 --- a/common_lib/utils/auth.py +++ b/common_lib/utils/auth.py @@ -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") diff --git a/pyproject.toml b/pyproject.toml index 0aeccf6..d6d4c01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"