authorization: Return more detail in "/access/users/list"

Return a list of objects with username and creation date fields.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-05-13 17:57:34 -04:00
parent e472fb6c1e
commit b3187710d0
1 changed files with 8 additions and 2 deletions

View File

@ -213,8 +213,14 @@ class Authorization:
return self._delete_jwt_user(web_request)
async def _handle_list_request(self, web_request):
user_list = list(self.users.keys())
user_list.remove(API_USER)
user_list = []
for user in self.users.values():
if user['username'] == API_USER:
continue
user_list.append({
'username': user['username'],
'created_on': user['created_on']
})
return {
'users': user_list
}