mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix: handle direct get_config() calls without UserAPIKeyAuth
When get_config() is called directly (not via FastAPI HTTP router), the user_api_key_dict parameter defaults to the Depends() marker object rather than a resolved UserAPIKeyAuth. Guard the role check with an isinstance check so internal/direct callers are treated as full admin.
This commit is contained in:
parent
fb9489ec72
commit
201aa389f2
1 changed files with 4 additions and 1 deletions
|
|
@ -14645,7 +14645,10 @@ async def get_config(
|
|||
_failure_callbacks = normalize_callback(_failure_callbacks)
|
||||
_success_and_failure_callbacks = normalize_callback(_success_and_failure_callbacks)
|
||||
|
||||
is_full_admin = user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN
|
||||
is_full_admin = (
|
||||
not isinstance(user_api_key_dict, UserAPIKeyAuth)
|
||||
or user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN
|
||||
)
|
||||
|
||||
_all_callbacks = [
|
||||
*((cb, "success") for cb in _success_callbacks),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue