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

explicitly require groups in auth model when Authenticator.manage_groups is enabled #4645

Merged
merged 1 commit into from Dec 4, 2023

Conversation

minrk
Copy link
Member

@minrk minrk commented Nov 28, 2023

avoids the experience of silently ignored config for Authenticators that don't support manage_groups, which leads to confusion like jupyterhub/oauthenticator#706.

technically breaking, because the previously unspecified behavior allowed Authenticators to omit the groups field which is interpreted as "no change to group membership." That will no longer be allowed.

…ups is enabled

avoids the experience of silently ignored config for Authenticators that don't support manage_groups
@minrk minrk added the breaking Contains breaking changes or DB upgrades label Nov 28, 2023
Comment on lines +832 to 834
group_names = authenticated["groups"]
if group_names is not None:
user.sync_groups(group_names)
Copy link
Member

Choose a reason for hiding this comment

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

Should authenticated["groups"] be allowed to be None - if it is, then its currently treated differently from [], where setting it to None means its not getting synced, while setting it to [] means its getting synced to no groups.

            - `groups`, the list of group names the user should be a member of,
             if Authenticator.manage_groups is True.

The above was from the authenticate docstring, and it didnt' mention anything about groups being allowed to be None.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's explicitly "no change" if None. I'll add that to the doc.

I'm mostly thinking of refresh_user here, where it may not have what it needs to refresh group membership, in which case 'no change' is still okay, but it should be explicit.

@minrk minrk merged commit fca5e93 into jupyterhub:main Dec 4, 2023
18 checks passed
@minrk minrk deleted the manage-groups-required branch December 4, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Contains breaking changes or DB upgrades
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants