Implemented mock scopes

This commit is contained in:
0mar
2020-10-28 16:23:21 +01:00
parent dece64d248
commit 21ea4ad2b6
4 changed files with 33 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ class BaseHandler(RequestHandler):
except Exception:
self.log.exception("Failed to get current user")
self._jupyterhub_user = None
self.scopes = []
return await maybe_future(super().prepare())
@@ -426,6 +427,10 @@ class BaseHandler(RequestHandler):
# don't let errors here raise more than once
self._jupyterhub_user = None
self.log.exception("Error getting current user")
if self._jupyterhub_user is not None:
self.scopes = self.settings.get("mock_scopes", [])
else:
self.scopes = []
return self._jupyterhub_user
@property