mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 23:13:00 +00:00
refresh_user: add handler parameter
The current request handler might be needed to determine if the auth data needs to be refreshed. Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
This commit is contained in:
@@ -307,7 +307,7 @@ class Authenticator(LoggingConfigurable):
|
||||
self.log.warning("User %r not in whitelist.", username)
|
||||
return
|
||||
|
||||
async def refresh_user(self, user):
|
||||
async def refresh_user(self, user, handler=None):
|
||||
"""Refresh auth data for a given user
|
||||
|
||||
Allows refreshing or invalidating auth data.
|
||||
@@ -319,6 +319,7 @@ class Authenticator(LoggingConfigurable):
|
||||
|
||||
Args:
|
||||
user (User): the user to refresh
|
||||
handler (tornado.web.RequestHandler or None): the current request handler
|
||||
Returns:
|
||||
auth_data (bool or dict):
|
||||
Return **True** if auth data for the user is up-to-date
|
||||
|
@@ -262,7 +262,7 @@ class BaseHandler(RequestHandler):
|
||||
self._refreshed_users.add(user.name)
|
||||
|
||||
self.log.debug("Refreshing auth for %s", user.name)
|
||||
auth_info = await self.authenticator.refresh_user(user)
|
||||
auth_info = await self.authenticator.refresh_user(user, self)
|
||||
|
||||
if not auth_info:
|
||||
self.log.warning(
|
||||
|
Reference in New Issue
Block a user