Support arbitrary authenticators

- Removes all need for special casing authenticators.
- Install them in hub environment, directly start using them.
- Consider if we should special case any *at all*
This commit is contained in:
yuvipanda
2018-07-16 12:03:45 -07:00
parent 66de7bb038
commit 2c7f99b57c
2 changed files with 31 additions and 4 deletions

View File

@@ -125,3 +125,21 @@ def test_auth_firstuse():
})
assert c.JupyterHub.authenticator_class == 'firstuseauthenticator.FirstUseAuthenticator'
assert c.FirstUseAuthenticator.create_users
def test_auth_github():
"""
Test using GitHub authenticator, which is not explicitly special cased.
"""
c = apply_mock_config({
'auth': {
'type': 'oauthenticator.github.GitHubOAuthenticator',
'GitHubOAuthenticator': {
'client_id': 'something',
'client_secret': 'something-else'
}
}
})
assert c.JupyterHub.authenticator_class == 'oauthenticator.github.GitHubOAuthenticator'
assert c.GitHubOAuthenticator.client_id == 'something'
assert c.GitHubOAuthenticator.client_secret == 'something-else'