mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
use wrapper on /user endpoints
This commit is contained in:
parent
7c489856e3
commit
8cce7d2df1
1 changed files with 14 additions and 2 deletions
|
@ -29,6 +29,10 @@ from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
|
||||||
from litellm.proxy.management_endpoints.key_management_endpoints import (
|
from litellm.proxy.management_endpoints.key_management_endpoints import (
|
||||||
generate_key_helper_fn,
|
generate_key_helper_fn,
|
||||||
)
|
)
|
||||||
|
from litellm.proxy.management_helpers.utils import (
|
||||||
|
add_new_member,
|
||||||
|
management_endpoint_wrapper,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
@ -39,7 +43,10 @@ router = APIRouter()
|
||||||
dependencies=[Depends(user_api_key_auth)],
|
dependencies=[Depends(user_api_key_auth)],
|
||||||
response_model=NewUserResponse,
|
response_model=NewUserResponse,
|
||||||
)
|
)
|
||||||
async def new_user(data: NewUserRequest):
|
@management_endpoint_wrapper
|
||||||
|
async def new_user(
|
||||||
|
data: NewUserRequest,
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Use this to create a new INTERNAL user with a budget.
|
Use this to create a new INTERNAL user with a budget.
|
||||||
Internal Users can access LiteLLM Admin UI to make keys, request access to models.
|
Internal Users can access LiteLLM Admin UI to make keys, request access to models.
|
||||||
|
@ -254,6 +261,7 @@ async def ui_get_available_role(
|
||||||
tags=["Internal User management"],
|
tags=["Internal User management"],
|
||||||
dependencies=[Depends(user_api_key_auth)],
|
dependencies=[Depends(user_api_key_auth)],
|
||||||
)
|
)
|
||||||
|
@management_endpoint_wrapper
|
||||||
async def user_info(
|
async def user_info(
|
||||||
user_id: Optional[str] = fastapi.Query(
|
user_id: Optional[str] = fastapi.Query(
|
||||||
default=None, description="User ID in the request parameters"
|
default=None, description="User ID in the request parameters"
|
||||||
|
@ -441,7 +449,10 @@ async def user_info(
|
||||||
tags=["Internal User management"],
|
tags=["Internal User management"],
|
||||||
dependencies=[Depends(user_api_key_auth)],
|
dependencies=[Depends(user_api_key_auth)],
|
||||||
)
|
)
|
||||||
async def user_update(data: UpdateUserRequest):
|
@management_endpoint_wrapper
|
||||||
|
async def user_update(
|
||||||
|
data: UpdateUserRequest,
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Example curl
|
Example curl
|
||||||
|
|
||||||
|
@ -683,6 +694,7 @@ async def get_users(
|
||||||
tags=["Internal User management"],
|
tags=["Internal User management"],
|
||||||
dependencies=[Depends(user_api_key_auth)],
|
dependencies=[Depends(user_api_key_auth)],
|
||||||
)
|
)
|
||||||
|
@management_endpoint_wrapper
|
||||||
async def delete_user(
|
async def delete_user(
|
||||||
data: DeleteUserRequest,
|
data: DeleteUserRequest,
|
||||||
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue