From b3187710d00aaeca8c19a0029b03a665c53d5913 Mon Sep 17 00:00:00 2001 From: Arksine Date: Thu, 13 May 2021 17:57:34 -0400 Subject: [PATCH] authorization: Return more detail in "/access/users/list" Return a list of objects with username and creation date fields. Signed-off-by: Eric Callahan --- moonraker/components/authorization.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/moonraker/components/authorization.py b/moonraker/components/authorization.py index fba7663..f08acff 100644 --- a/moonraker/components/authorization.py +++ b/moonraker/components/authorization.py @@ -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 }