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

Add allowedGroups check #277

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Add allowedGroups check #277

wants to merge 8 commits into from

Conversation

tomrf1
Copy link
Member

@tomrf1 tomrf1 commented Dec 20, 2024

The requiredGroups parameter is used to ensure a user is in all groups in the set.

It would also be useful to be able to check if a user is in at least one of the groups in a set.

This PR refactors the group checking logic in processOauth2Callback, to optionally support both:

  • requiredGroups, with the existing behaviour
  • allowedGroups, of which a user must be in a least one group

*/
def processOauth2Callback(requiredGoogleGroups: Set[String], groupChecker: GoogleGroupChecker)
def processOauth2Callback(groupCheckConfig: GroupCheckConfig, groupChecker: GoogleGroupChecker)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of changing the signature of this method, I would be inclined to add a new method with this new signature, and keep the old method but marked as deprecated. Should hopefully make upgrades easier for other teams.

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

Successfully merging this pull request may close these issues.

2 participants