forked from phoenix/litellm-mirror
fix(proxy_server.py): don't cache request on key generate - misses the team related data
This commit is contained in:
parent
f86ab19067
commit
d0c205fcd1
2 changed files with 1 additions and 9 deletions
|
@ -1902,14 +1902,6 @@ async def generate_key_helper_fn(
|
||||||
saved_token["expires"], datetime
|
saved_token["expires"], datetime
|
||||||
):
|
):
|
||||||
saved_token["expires"] = saved_token["expires"].isoformat()
|
saved_token["expires"] = saved_token["expires"].isoformat()
|
||||||
if key_data["token"] is not None and isinstance(key_data["token"], str):
|
|
||||||
hashed_token = hash_token(key_data["token"])
|
|
||||||
saved_token["token"] = hashed_token
|
|
||||||
user_api_key_cache.set_cache(
|
|
||||||
key=hashed_token,
|
|
||||||
value=LiteLLM_VerificationToken(**saved_token), # type: ignore
|
|
||||||
ttl=600,
|
|
||||||
)
|
|
||||||
if prisma_client is not None:
|
if prisma_client is not None:
|
||||||
## CREATE USER (If necessary)
|
## CREATE USER (If necessary)
|
||||||
verbose_proxy_logger.debug(f"prisma_client: Creating User={user_data}")
|
verbose_proxy_logger.debug(f"prisma_client: Creating User={user_data}")
|
||||||
|
|
|
@ -1241,7 +1241,7 @@ async def test_call_with_key_never_over_budget(prisma_client):
|
||||||
|
|
||||||
# use generated key to auth in
|
# use generated key to auth in
|
||||||
result = await user_api_key_auth(request=request, api_key=bearer_token)
|
result = await user_api_key_auth(request=request, api_key=bearer_token)
|
||||||
print("result from user auth with new key", result)
|
print("result from user auth with new key: {result}")
|
||||||
|
|
||||||
# update spend using track_cost callback, make 2nd request, it should fail
|
# update spend using track_cost callback, make 2nd request, it should fail
|
||||||
from litellm.proxy.proxy_server import (
|
from litellm.proxy.proxy_server import (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue