New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
singleuser auth as server extension #3888
Conversation
fafd565
to
8b03147
Compare
8b03147
to
7f0b269
Compare
7f0b269
to
243c1b8
Compare
c30e9f4
to
bbceb33
Compare
242e24c
to
a5c5e47
Compare
a5c5e47
to
77b4d89
Compare
41d45e9
to
f3afac7
Compare
mostly a copy (fork) of singleuser app using public APIs instead of lots of patching. opt-in via `JUPYTERHUB_SINGLEUSER_EXTENSION=1` related changes: - stop running a test single-user server in a thread. It's complicated and fragile. Instead, run it normally, and get the info we need from a custom handler registered via an extension via the `full_spawn` fixture
f3afac7
to
58dccdb
Compare
Finally got this working! (writing before CI is green, but I'm optimistic) Key changes:
The rest is just implementing the same behavior via standard server-2.0 public APIs instead of the monkeypatching. Questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work on this @minrk! I think it seems very thoroughly done!
My review notes mostly include details:
- request for additional details in docstrings
- questions about TODO notes
- small refactoring considerations for readability
- questions about things I don't understand
I've not reviewed things below line ~260 or so in the extension.py file, a bit into the code that you describe is copied from the mixin - everything else though!
@consideRatio thanks for the thoughtful review! I'll work on addressing the points now. |
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
had to re-sync with main to get the updated black config |
found some fixes required to run on ServerApp to affect extensions, which were not affected before
50bd251
to
9a49d06
Compare
- more thorough docstrings, comments - add missing `check_hub_version` call - remove duplicate HubAuth instance on authorizer
@consideRatio thanks for the suggestions! I've added detail where I could in docstrings and comments based on your review. I also updated the extension to be usd by default with Jupyter Server 2, which for JupyterHub 4 I think is the right thing to do. |
The new changes looks great to me! I really love the docstring additions!!! There is a timeout failure in the tests to resolve, but from what I could tell this looked good! |
6b6784f
to
5f9283c
Compare
Because this has been going for so long, I'm going to do the default-switch in its own PR, rather than tack on another change. I realize changing the default also means changing the test matrix to make sure the cases are still covered. |
f45178d
to
a43757b
Compare
@consideRatio good catch on the |
matches subclass log behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow amazing work on this!!! Super happy about how this is now an extension of jupyter-server!
This is a development branch, testing JupyterHub singleuser auth as a Jupyter Server extension
Jupyter Server 2.0 introduces two new APIs:
This PR aims to implement these APIs for JupyterHub, without (almost) any use of monkeypatching or private APIs.
So far, I've got ~everything working in manual tests, aside from disable_user_config. I'm not 100% sure how feasible that's going to be, but hopefully I can manage.
It doesn't remove or change SingleUserNotebookApp. It mostly copies code from there (essentially a fork of the singleuser code), so that the old code can be deprecated and removed at a later time.
Co-developing this with jupyter-server/jupyter_server#825 as a way to validate that everything JupyterHub needs to fit in a server extension is covered.
TODO: