-
Notifications
You must be signed in to change notification settings - Fork 310
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
Adds anonymous users #863
Adds anonymous users #863
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
#825 is now merged, so this can be rebased and continued now :) |
Hey, @vidartf thanks! This is ready for review. |
Codecov Report
@@ Coverage Diff @@
## main #863 +/- ##
==========================================
+ Coverage 72.22% 72.26% +0.04%
==========================================
Files 65 65
Lines 7985 7997 +12
Branches 1335 1335
==========================================
+ Hits 5767 5779 +12
Misses 1811 1811
Partials 407 407
Continue to review full report at Codecov.
|
jupyter_server/auth/utils.py
Outdated
|
||
|
||
# Using JupyterLab CSS variable because the colors may change with the theme | ||
user_colors = [ |
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.
Can we keep this JupyterLab-specific color list in the frontend code and sample it from there when the user is "anonymous", not in Jupyter Server? Jupyter Server should remain frontend-agnostic, but these css variables are specific to JupyterLab.
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.
Thanks for looking at this @Zsailer.
I just removed the list of colors, I will keep them on the frontend.
Thanks, @hbcarlos! Great stuff here! Just a minor comment about "who" is responsible for choosing colors. I think this should depend on the frontend, not server. |
The downstream tests in nbclassic is unrelated. Merging here after updating the branch. Thanks @hbcarlos! |
Thanks @Zsailer! |
* Adds anonymous users * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * removes unused import * Removes random colors Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zachary Sailer <zsailer@apple.com>
@@ -290,11 +292,28 @@ def user_to_cookie(self, user: User) -> str: | |||
Default is just the user's username. | |||
""" | |||
# default: username is enough |
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.
This comment and the docstring are now out of date :) I think also we should clarify whether this cookie format is now a required, de-facto standard by JupyterLab (will lab stop working if this cookie structure is broken?).
I created the PR starting from #825.
Adds the anonymous users logic used in JupyterLab. It stores the user info in the cookie to persist between sessions as was done with the user id.