mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(pass_through_endpoints): support bedrock agents via pass through (#5527)
This commit is contained in:
parent
1e7e538261
commit
ca37bb9de5
4 changed files with 24 additions and 16 deletions
|
@ -387,9 +387,16 @@ async def user_api_key_auth(
|
|||
)
|
||||
#### ELSE ####
|
||||
## CHECK PASS-THROUGH ENDPOINTS ##
|
||||
is_mapped_pass_through_route: bool = False
|
||||
for mapped_route in LiteLLMRoutes.mapped_pass_through_routes.value:
|
||||
if route.startswith(mapped_route):
|
||||
is_mapped_pass_through_route = True
|
||||
if is_mapped_pass_through_route:
|
||||
if request.headers.get("litellm_user_api_key") is not None:
|
||||
api_key = request.headers.get("litellm_user_api_key") or ""
|
||||
if pass_through_endpoints is not None:
|
||||
for endpoint in pass_through_endpoints:
|
||||
if endpoint.get("path", "") == route:
|
||||
if isinstance(endpoint, dict) and endpoint.get("path", "") == route:
|
||||
## IF AUTH DISABLED
|
||||
if endpoint.get("auth") is not True:
|
||||
return UserAPIKeyAuth()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue