patch
This commit is contained in:
		
							parent
							
								
									d3633a7b47
								
							
						
					
					
						commit
						b0250a47aa
					
				@ -27,7 +27,11 @@ async def _fetch_current_user(
 | 
				
			|||||||
    user_agent = request.headers.get("User-Agent", "(unknown)")
 | 
					    user_agent = request.headers.get("User-Agent", "(unknown)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    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(
 | 
					            response = await client.post(
 | 
				
			||||||
                f"{settings.TOKEN_SERVICE}/decode",
 | 
					                f"{settings.TOKEN_SERVICE}/decode",
 | 
				
			||||||
                json={
 | 
					                json={
 | 
				
			||||||
@ -36,7 +40,6 @@ async def _fetch_current_user(
 | 
				
			|||||||
                    "user_agent": user_agent,
 | 
					                    "user_agent": user_agent,
 | 
				
			||||||
                    "require_permissions": require_permissions
 | 
					                    "require_permissions": require_permissions
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                timeout=5.0
 | 
					 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
    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")
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
[project]
 | 
					[project]
 | 
				
			||||||
name = "common-lib"
 | 
					name = "common-lib"
 | 
				
			||||||
version = "0.0.6"
 | 
					version = "0.0.7"
 | 
				
			||||||
description = "Библиотека общих компонентов для микросервисов yobble"
 | 
					description = "Библиотека общих компонентов для микросервисов yobble"
 | 
				
			||||||
authors = [{ name = "cheykrym", email = "you@example.com" }]
 | 
					authors = [{ name = "cheykrym", email = "you@example.com" }]
 | 
				
			||||||
license = "MIT"
 | 
					license = "MIT"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user