Working on user module

This commit is contained in:
Scott Idem
2021-03-18 22:42:25 +00:00
parent 7682c7d080
commit c620ce5f18
2 changed files with 12 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ def mk_resp(
elif status_code == 408: response.status_code = status.HTTP_408_REQUEST_TIMEOUT elif status_code == 408: response.status_code = status.HTTP_408_REQUEST_TIMEOUT
elif status_code == 429: response.status_code = status.HTTP_429_TOO_MANY_REQUESTS elif status_code == 429: response.status_code = status.HTTP_429_TOO_MANY_REQUESTS
elif status_code == 500: response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR elif status_code == 500: response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
elif status_code == 501: response.status_code = status.HTTP_501_NOT_IMPLEMENTED
elif status_code == 502: response.status_code = status.HTTP_502_BAD_GATEWAY elif status_code == 502: response.status_code = status.HTTP_502_BAD_GATEWAY
elif status_code == 503: response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE elif status_code == 503: response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
elif status_code == 504: response.status_code = status.HTTP_504_GATEWAY_TIMEOUT elif status_code == 504: response.status_code = status.HTTP_504_GATEWAY_TIMEOUT

View File

@@ -327,6 +327,17 @@ async def lookup_username_obj(
return mk_resp(data=data) return mk_resp(data=data)
# Authenticate a username and password
@router.get('/authenticate', response_model=Resp_Body_Base)
async def user_authenticate(
username: str = Query(..., min_length=2, max_length=50),
password: str = Query(..., min_length=6, max_length=50),
x_account_id: str = Header(...),
):
return mk_resp(data=None, status_code=501) # Not Implemented
@router.get('/{obj_id}', response_model=Resp_Body_Base) @router.get('/{obj_id}', response_model=Resp_Body_Base)
async def get_user_obj( async def get_user_obj(
obj_id: str = Query(..., min_length=1, max_length=22), obj_id: str = Query(..., min_length=1, max_length=22),