Skip to content
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

[Google] Add include_nested_groups config #763

Merged
merged 19 commits into from
Oct 1, 2024

Conversation

jrdnbradford
Copy link
Contributor

@jrdnbradford jrdnbradford commented Sep 22, 2024

First go at this, closes #762.

_fetch_user_groups is now _fetch_member_groups since it now checks user and group memberships in groups. I've updated some of the variable names from user_* to member_* to reflect this. Whether nested groups are taken into account is set by a new allow_nested_groups config option.

The Google Python APIs for this are quite limited and this causes some slowness in the login experience for those who are members of a lot of groups.

I couldn't find where to update the docs for this authenticator. When I try to suggest an edit on that page it goes to reference/api/gen/oauthenticator.google.rst which doesn't exist, I assume it's built elsewhere. If there's anywhere I can update this, let me know.

I am also not entirely sure how to go about adding a mock test for this case.

I'd love feedback on how to make this better. Thanks! 🚀

Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jrdnbradford for working this!!! Let's go for a merge once the my final review comments are addressed, sorry for being indecisive about the naming!

oauthenticator/tests/test_google.py Outdated Show resolved Hide resolved
oauthenticator/google.py Outdated Show resolved Hide resolved
oauthenticator/google.py Outdated Show resolved Hide resolved
oauthenticator/google.py Outdated Show resolved Hide resolved
@jrdnbradford
Copy link
Contributor Author

Awesome, thanks @consideRatio! Let me make these changes and test. I'll request another review when ready. Also, don't feel pressure to get this merged. No rush.

@jrdnbradford
Copy link
Contributor Author

Changes made. Thanks for your time and help on this, @consideRatio.

@consideRatio consideRatio changed the title Allow auth via nested Google Groups [Google] Add include_nested_groups config Oct 1, 2024
Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string splitting at the @ character and keeping track of a user domain etc is a bit confusing, but it was confusing before this PR was made as well though. Lets go for a merge though, i think this should be an improvement.

@consideRatio consideRatio merged commit f4da2e8 into jupyterhub:main Oct 1, 2024
11 checks passed
@consideRatio
Copy link
Member

Thank you for working this thoroughly @jrdnbradford!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow authentication via nested groups for Google OAuthenticator
2 participants