mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-11 20:13:02 +00:00
Changed error code of UserTokenListAPIHandler back to 403
This commit is contained in:
@@ -336,7 +336,7 @@ class UserTokenListAPIHandler(APIHandler):
|
|||||||
scope_filter = self.get_scope_filter('users:tokens')
|
scope_filter = self.get_scope_filter('users:tokens')
|
||||||
if user is None or not scope_filter(user, kind):
|
if user is None or not scope_filter(user, kind):
|
||||||
raise web.HTTPError(
|
raise web.HTTPError(
|
||||||
404,
|
403,
|
||||||
f"{kind.title()} {user_name} not found or no permissions to generate tokens",
|
f"{kind.title()} {user_name} not found or no permissions to generate tokens",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -1310,8 +1310,8 @@ async def test_get_new_token(app, headers, status, note, expires_in):
|
|||||||
"as_user, for_user, status",
|
"as_user, for_user, status",
|
||||||
[
|
[
|
||||||
('admin', 'other', 200),
|
('admin', 'other', 200),
|
||||||
('admin', 'missing', 404),
|
('admin', 'missing', 403),
|
||||||
('user', 'other', 404),
|
('user', 'other', 403),
|
||||||
('user', 'user', 200),
|
('user', 'user', 200),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user