parent
f7efbfcfc5
commit
cba04e4249
1 changed files with 32 additions and 16 deletions
|
|
@ -23,7 +23,11 @@ router = APIRouter(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/self/claims", response_model=OIDCClaims, status_code=status.HTTP_200_OK, responses={
|
@router.get("/self/claims",
|
||||||
|
summary="Get current user OIDC claims.",
|
||||||
|
response_model=OIDCClaims,
|
||||||
|
status_code=status.HTTP_200_OK,
|
||||||
|
responses={
|
||||||
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
||||||
})
|
})
|
||||||
async def current_user_claims(user: claims_dependency):
|
async def current_user_claims(user: claims_dependency):
|
||||||
|
|
@ -34,7 +38,11 @@ async def current_user_claims(user: claims_dependency):
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
||||||
@router.get("/self/db", response_model=UserResponse, status_code=status.HTTP_200_OK, responses={
|
@router.get("/self/db",
|
||||||
|
summary="Get current user hub details.",
|
||||||
|
response_model=UserResponse,
|
||||||
|
status_code=status.HTTP_200_OK,
|
||||||
|
responses={
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
||||||
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
||||||
})
|
})
|
||||||
|
|
@ -45,7 +53,11 @@ async def current_user(user_model: user_model_claims_dependency):
|
||||||
return user_model
|
return user_model
|
||||||
|
|
||||||
|
|
||||||
@router.get("/", response_model=UserResponse, status_code=status.HTTP_200_OK, responses={
|
@router.get("/",
|
||||||
|
summary="Get user hub details by ID.",
|
||||||
|
response_model=UserResponse,
|
||||||
|
status_code=status.HTTP_200_OK,
|
||||||
|
responses={
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
||||||
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
|
||||||
})
|
})
|
||||||
|
|
@ -56,11 +68,15 @@ async def get_user_by_id(user_model: user_model_query_dependency, su: super_admi
|
||||||
return user_model
|
return user_model
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/", status_code=status.HTTP_204_NO_CONTENT, responses={
|
@router.delete("/",
|
||||||
|
summary="Delete user from hub by ID.",
|
||||||
|
status_code=status.HTTP_204_NO_CONTENT,
|
||||||
|
responses={
|
||||||
status.HTTP_204_NO_CONTENT: {"description": "User deleted"},
|
status.HTTP_204_NO_CONTENT: {"description": "User deleted"},
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "User not found"},
|
||||||
})
|
})
|
||||||
async def delete_user_by_id(db: db_dependency, user_model: user_model_body_dependency, su: super_admin_dependency, request_model: UserDeleteUserRequest):
|
async def delete_user_by_id(db: db_dependency, user_model: user_model_body_dependency, su: super_admin_dependency,
|
||||||
|
request_model: UserDeleteUserRequest):
|
||||||
"""
|
"""
|
||||||
Deletes the user with the provided ID from the database. This will not remove them from OIDC, and they will be automatically readded on next login.
|
Deletes the user with the provided ID from the database. This will not remove them from OIDC, and they will be automatically readded on next login.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue