mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
style(keys): fix ruff format and drop comment that restates the call
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
062e17a7ac
commit
2542b9cfe8
2 changed files with 8 additions and 5 deletions
|
|
@ -2240,8 +2240,13 @@ async def generate_service_account_key_fn(
|
|||
)
|
||||
|
||||
if data.metadata is None or data.metadata.get("service_account_id") is None:
|
||||
service_account_id: Final = (data.metadata or {}).get("service_account_id") or data.key_alias or str(uuid.uuid4())
|
||||
data.metadata = {**(data.metadata or {}), "service_account_id": service_account_id} # rebind-ok: stamping the generated service_account_id onto the request model so it persists on the key
|
||||
service_account_id: Final = (
|
||||
(data.metadata or {}).get("service_account_id") or data.key_alias or str(uuid.uuid4())
|
||||
)
|
||||
data.metadata = { # rebind-ok: stamping the generated service_account_id onto the request model so it persists on the key
|
||||
**(data.metadata or {}),
|
||||
"service_account_id": service_account_id,
|
||||
}
|
||||
|
||||
verbose_proxy_logger.debug("entered /key/generate")
|
||||
|
||||
|
|
|
|||
|
|
@ -85,10 +85,9 @@ class TeamMemberPermissionChecks:
|
|||
check_db_only=True,
|
||||
)
|
||||
|
||||
# 4. Resolve the caller's role in the key's team (service accounts act as "user")
|
||||
caller_team_role: Final = _get_caller_team_role(team_table=team_table, user_api_key_dict=user_api_key_dict)
|
||||
|
||||
# 5. Check if the team member has permissions for the endpoint
|
||||
# 4. Check if the team member has permissions for the endpoint
|
||||
has_permission: Final = TeamMemberPermissionChecks.does_team_member_have_permissions_for_endpoint(
|
||||
team_member_role=caller_team_role,
|
||||
team_table=team_table,
|
||||
|
|
@ -224,7 +223,6 @@ class TeamMemberPermissionChecks:
|
|||
check_db_only=True,
|
||||
)
|
||||
|
||||
# 4. Resolve the caller's role in the key's team (service accounts act as "user")
|
||||
caller_team_role: Final = _get_caller_team_role(team_table=team_table, user_api_key_dict=user_api_key_dict)
|
||||
return caller_team_role is not None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue