mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 13:03:01 +00:00
allow check_whitelist
to be a coroutine
Some authenticators may have whitelist checking that requires async operations.
This commit is contained in:
@@ -132,7 +132,9 @@ class Authenticator(LoggingConfigurable):
|
||||
if not self.validate_username(username):
|
||||
self.log.warning("Disallowing invalid username %r.", username)
|
||||
return
|
||||
if self.check_whitelist(username):
|
||||
|
||||
whitelist_pass = yield gen.maybe_future(self.check_whitelist(username))
|
||||
if whitelist_pass:
|
||||
return username
|
||||
else:
|
||||
self.log.warning("User %r not in whitelist.", username)
|
||||
|
Reference in New Issue
Block a user