Skip to content

Commit

Permalink
Update jupyterhub to version 1.0.0 (#609)
Browse files Browse the repository at this point in the history
* MAINT: update jupyterhub version to 1.0.0

* DEV: use JupyterHub.shutdown_on_logout configuration

* TST: fix mocking failures on unit tests

* CLN: remove SimphonyRemoteAuthMixin class since it is no longer requried to close user sessions upon logout
  • Loading branch information
flongford committed Jun 29, 2022
1 parent 405125c commit 510430b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 54 deletions.
4 changes: 4 additions & 0 deletions jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
# Choose between system-user mode and virtual-user mode
setting_mode = ('system_user', 'virtual_user')[1]

# Ensures user sessions are closed upon logout - this is especially
# useful for admin users to switch between user and admin apps
c.JupyterHub.shutdown_on_logout = True

if setting_mode == 'virtual_user':
c.JupyterHub.spawner_class = ('remoteappmanager.jupyterhub.spawners.'
'VirtualUserSpawner')
Expand Down
1 change: 0 additions & 1 deletion remoteappmanager/jupyterhub/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .world_authenticator import WorldAuthenticator # noqa
from .basic_authenticator import BasicAuthenticator # noqa
from .github_whitelist_authenticator import GitHubWhitelistAuthenticator # noqa
from .simphony_remote_auth_mixin import SimphonyRemoteAuthMixin # noqa
4 changes: 1 addition & 3 deletions remoteappmanager/jupyterhub/auth/basic_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
from jupyterhub.auth import Authenticator
from traitlets import Dict

from .simphony_remote_auth_mixin import SimphonyRemoteAuthMixin


class BasicAuthenticator(SimphonyRemoteAuthMixin, Authenticator):
class BasicAuthenticator(Authenticator):
""" Simple authenticator based on a fixed set of users"""

#: Dictionary of regular username: password keys allowed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from traitlets.config import LoggingConfigurable
from traitlets import Unicode, Float, Set

from .simphony_remote_auth_mixin import SimphonyRemoteAuthMixin


class FileWhitelistMixin(LoggingConfigurable):
"""
Expand Down Expand Up @@ -61,8 +59,7 @@ def whitelist(self, value):
pass


class GitHubWhitelistAuthenticator(
SimphonyRemoteAuthMixin, FileWhitelistMixin, GitHubOAuthenticator):
class GitHubWhitelistAuthenticator(FileWhitelistMixin, GitHubOAuthenticator):
"""A github authenticator that also verifies that the
user belongs to a specified whitelisted user as provided
by an external file (so that we don't have to restart
Expand Down
42 changes: 0 additions & 42 deletions remoteappmanager/jupyterhub/auth/simphony_remote_auth_mixin.py

This file was deleted.

4 changes: 1 addition & 3 deletions remoteappmanager/jupyterhub/auth/world_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

from jupyterhub.auth import Authenticator

from .simphony_remote_auth_mixin import SimphonyRemoteAuthMixin


class WorldAuthenticator(SimphonyRemoteAuthMixin, Authenticator):
class WorldAuthenticator(Authenticator):
""" This authenticator authenticates everyone """

@gen.coroutine
Expand Down
1 change: 1 addition & 0 deletions remoteappmanager/jupyterhub/tests/test_spawners.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def new_spawner(spawner_class):
# Mock user
user = mock.Mock()
user.name = username()
user.escaped_name = user.name
user.url = 'http://my-callback.com'
user.admin = False
user.state = None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tornado==5.1.1
requests==2.20.0
docker==2.2
escapism==0.0.1
jupyterhub==0.9.6
jupyterhub==1.0.0
jupyter_client>=4.3.0
click==6.6
tabulate==0.7.5
Expand Down

0 comments on commit 510430b

Please sign in to comment.