Simplify NullAuthenticator, add test

This commit is contained in:
Simon Li
2021-09-27 23:05:53 +01:00
parent 8a6b364ca5
commit 28f56ba510
4 changed files with 32 additions and 31 deletions

View File

@@ -1173,3 +1173,22 @@ class DummyAuthenticator(Authenticator):
return data['username']
return None
return data['username']
class NullAuthenticator(Authenticator):
"""Null Authenticator for JupyterHub
For cases where authentication should be disabled,
e.g. only allowing access via API tokens.
.. versionadded:: 2.0
"""
# auto_login skips 'Login with...' page on Hub 0.8
auto_login = True
# for Hub 0.7, show 'login with...'
login_service = 'null'
def get_handlers(self, app):
return []