Merge pull request #2787 from BerriAI/litellm_optional_team_jwt_claim

fix(proxy_server.py): don't require scope for team-based jwt access
This commit is contained in:
Krish Dholakia 2024-04-01 19:16:39 -07:00 committed by GitHub
commit da85384649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 7 deletions

View file

@ -385,12 +385,6 @@ async def user_api_key_auth(
raise Exception(
f"Admin not allowed to access this route. Route={route}, Allowed Routes={actual_routes}"
)
# check if team in scopes
is_team = jwt_handler.is_team(scopes=scopes)
if is_team == False:
raise Exception(
f"Missing both Admin and Team scopes from token. Either is required. Admin Scope={jwt_handler.litellm_jwtauth.admin_jwt_scope}, Team Scope={jwt_handler.litellm_jwtauth.team_jwt_scope}"
)
# get team id
team_id = jwt_handler.get_team_id(token=valid_token, default_value=None)