-
Notifications
You must be signed in to change notification settings - Fork 367
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
[All] breaking, add allow_all config defaulting to False (CILogon: require allowed_idps) #625
[All] breaking, add allow_all config defaulting to False (CILogon: require allowed_idps) #625
Conversation
…name_claims These are now all deprecated and will error if configured for CILogonOAuthenticator. When allowed_idps is configured the claim config is bypassed by the IdP specific username_claim anyhow, and shown_idps should really be allowed_idps instead.
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.
Thank you very much @consideRatio! This looks very good and describing what each commit did, was very helpful ❤️
Thank you soo much for reviewing @GeorgianaElena!!!! I pushed three commits, where e7f864d was not directly related to your review comments. When documenting GenericOAuthenticator, I concluded that it wad adding functionality in username_claim that the base class didn't have, and that it duplicated things done in the base class besides checking if |
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 is amazing @consideRatio ❤️ Thank you very much for all this work and for making the review so straightforward. This is ready to be merged IMO 🚀
WIEEEEE thank you @GeorgianaElena !!! |
A breaking change in oauthenticator that went unnoticed: jupyterhub/oauthenticator#625
[All]
allow_all
configWhen setting up a JupyterHub you may with a minimal config using an OAuthenticator based Authenticator end up allowing all authenticated users. Even if they were allowed for a brief amount of time, they can have ended up creating a user for access after login is restricted. This PR addresses this situation by defaulting to not allowing all authenticated users.
Example use
Related
[CILogon]
allowed_idps
requiredFor CILogon, it was hard to add the
allow_all
functionality independently from the planned change of makingCILogonOAuthenticator.allowed_idps
to be required. Due to that, that change is bundled in this PR.WIth
CILogonOAuthenticator.allowed_idps
required, it made sense to also stop usingCILogonOAuthenticator
'susername_claim
,additional_username_claims
, andshown_idps
, so use of them is now also causing loud errors. The main motivation for erroring loudly instead of providing a warning is that a misconfiguration here can be a security issue.Related
allowed_idps
? #615For the reviewer
This is a humongous PR as it was hard to avoid it but I hope you don't panic! I've thought a lot on the commits I've made, making a few relatively small commits with actual changes free from updates to comments and tests which instead are put in other larger commits. With this in mind, I recommend reviewing this commit by commit.
Here are the commits, and only three contain relevant changes, and two of those are cilogon specific changes. That makes this PR include one key commit to review (223c89b - all, breaking change: add allow_all config, default to False). When reviewing that commit, I recommend starting by looking at the oauth2.py file's changes as the other changes build on logic changed in the OAuthenticator base class.
Post review update
Following review, I've made the following commits so far.
About changes in tests
allowed_all
and otherallow_...
config by using@pytest.mark.parametrize
one test per authenticator to run with a lot of differentallow_
config. This parametrized test could largely be re-used across authenticators with small tweaks.