mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 23:42:59 +00:00
Simplify NullAuthenticator, add test
This commit is contained in:
@@ -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 []
|
||||
|
Reference in New Issue
Block a user