delete token from internal

This commit is contained in:
unknown 2025-10-20 22:54:57 +03:00
parent c2405f1326
commit d25d1bb8b3
2 changed files with 3 additions and 5 deletions

View File

@ -27,12 +27,11 @@ from common_lib.utils.http_client import client
# except httpx.RequestError: # except httpx.RequestError:
# raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable") # raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable")
async def get_profile_by_user_id(user_id: UUID, current_user: UUID, token: str) -> dict: async def get_profile_by_user_id(user_id: UUID, current_user: UUID) -> dict:
try: try:
# async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client: # async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client:
response = await client.post( response = await client.post(
f"{settings.PROFILE_SERVICE}/user_id/internal", f"{settings.PROFILE_SERVICE}/user_id/internal",
headers={"Authorization": f"Bearer {token}"},
json={"user_id": str(user_id), json={"user_id": str(user_id),
"current_user": str(current_user)}) "current_user": str(current_user)})
@ -49,12 +48,11 @@ async def get_profile_by_user_id(user_id: UUID, current_user: UUID, token: str)
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}") raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}")
async def get_profiles_by_user_ids(user_ids: List[UUID], token: str, user_id: UUID) -> Dict[str, dict]: async def get_profiles_by_user_ids(user_ids: List[UUID], user_id: UUID) -> Dict[str, dict]:
try: try:
# async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client: # async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client:
response = await client.post( response = await client.post(
f"{settings.PROFILE_SERVICE}/user_ids/internal", f"{settings.PROFILE_SERVICE}/user_ids/internal",
headers={"Authorization": f"Bearer {token}"},
json={"user_ids": [str(uid) for uid in user_ids], json={"user_ids": [str(uid) for uid in user_ids],
"user_id": str(user_id)}) "user_id": str(user_id)})

View File

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