Skip to content

Add Spawner options to enable admins to spawn user sessions#598

Merged
flongford merged 19 commits into
masterfrom
enh/admin-spawner-options
Apr 20, 2022
Merged

Add Spawner options to enable admins to spawn user sessions#598
flongford merged 19 commits into
masterfrom
enh/admin-spawner-options

Conversation

@flongford

@flongford flongford commented Apr 14, 2022

Copy link
Copy Markdown
Contributor

Closes #592

Makes use of JupyterHub's extendable spawner options form to provide admin users with the ability to spawn either "Admin" (remoteappadmin) or "User" (remoteappmanager) sessions when they login.

Notes

The existing session must be closed before the options form will be shown again. For JupyterHub < 1.0.0, the only way to do this is by navigating to https://<simphony-remote>/hub/admin or https://<simphony-remote>/hub/home whilst logged in and selecting the "Stop My Sever" option.

Therefore (for now) we include the SimphonyRemoteAuthMixin class, providing a logout handler that automatically closes admin user servers upon a sign out. This has no effect on the functionality of the application since any Simphony-Remote applications will continue to run even if the JupyterHub server is shut down.

For versions of JupyterHub >= 1.0.0, we can simply configure the shutdown_on_logout option to do this instead.

@flongford flongford changed the title Add admin session Spawner options to enable spawning user sessions Add Spawner options to enable admins to spawn user sessions Apr 14, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #598 (1ca6c84) into master (2f6e719) will decrease coverage by 0.32%.
The diff coverage is 68.00%.

@@            Coverage Diff             @@
##           master     #598      +/-   ##
==========================================
- Coverage   95.35%   95.03%   -0.33%     
==========================================
  Files          92       93       +1     
  Lines        4305     4348      +43     
  Branches      422      429       +7     
==========================================
+ Hits         4105     4132      +27     
- Misses        140      156      +16     
  Partials       60       60              
Impacted Files Coverage Δ
...ager/jupyterhub/auth/simphony_remote_auth_mixin.py 31.57% <31.57%> (ø)
remoteappmanager/jupyterhub/spawners.py 88.54% <81.25%> (-1.71%) ⬇️
...eappmanager/jupyterhub/auth/basic_authenticator.py 87.50% <100.00%> (+0.83%) ⬆️
.../jupyterhub/auth/github_whitelist_authenticator.py 100.00% <100.00%> (ø)
...eappmanager/jupyterhub/auth/world_authenticator.py 100.00% <100.00%> (ø)
remoteappmanager/jupyterhub/tests/test_spawners.py 92.81% <100.00%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f6e719...1ca6c84. Read the comment docs.

@flongford flongford marked this pull request as ready for review April 20, 2022 17:08
@flongford flongford merged commit 5cc033c into master Apr 20, 2022
@flongford flongford deleted the enh/admin-spawner-options branch April 20, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow admin users to also open the user portal

2 participants