feat(proxy_server.py): support 'user_id_upsert' flag for jwt_auth

This commit is contained in:
Krrish Dholakia 2024-05-15 22:19:59 -07:00
parent 99653d2d3e
commit 600b6f7e1d
5 changed files with 74 additions and 29 deletions

View file

@ -484,11 +484,9 @@ async def user_api_key_auth(
user_id=user_id,
prisma_client=prisma_client,
user_api_key_cache=user_api_key_cache,
user_id_upsert=jwt_handler.is_upsert_user_id(),
)
# save the user object to cache
await user_api_key_cache.async_set_cache(
key=user_id, value=user_object
)
# [OPTIONAL] track spend against an external user - `LiteLLM_EndUserTable`
end_user_object = None
end_user_id = jwt_handler.get_end_user_id(