sso_*: allow group validator to be used standalone #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We require either
allowed_email_addresses
orallowed_email_domains
to be passed in either as a default or for each upstream, however this limits the usability of email groups as a functional validator. It's difficult to validate a user based on groups alone if you also have to specify email addresses or email domains, for example -- it requires work arounds which should be avoided.Solution
Require
allowed_email_addresses
,allowed_email_domains
ORallowed_groups
instead. This means the email group validator can still be used simultaneously with others, but also standalone which allows for a sometimes more expected workflow.Notes
This PR also removes functionality that means if an empty list of groups is passed in to the validator then the user is automatically 'valid' per the group validator. If a group validator can be the only validator, I don't think this logic makes sense (however there may be other historic reasons why this was allowed that I'm unaware of)