Skip to content

validator pkg: control when each validator is ran #266

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

Closed
wants to merge 1 commit into from

Conversation

Jusshersmith
Copy link
Contributor

@Jusshersmith Jusshersmith commented Nov 7, 2019

Problem

With the validator abstraction work that was recently done we inadvertently started to run group validations more than we used to.

Depending on the request volume flowing through SSO running the group check again can cause issues with upstream providers.

Solution

We don't need to validate the groups again here. This pull request adds a feature to the validator package that allows us to pass in a flag whenever calling the RunValidators() function that will determine which validators we want to run in that flow.

This gives us more flexibility to control when specific validators should or shouldn't be ran.

Notes

Now that the group membership check is an official 'validator' within sso-proxy it's ran each time we call RunValidators(), whereas before when running the equivalent function the group check wasn't part of this.

Specifically, here:

errors := options.RunValidators(p.Validators, session)

Previously, we were only checking email address/domains as the group check is ran just above that when refreshing or validating the session:

ok, err := p.provider.RefreshSession(session, allowedGroups)
&
ok := p.provider.ValidateSessionState(session, allowedGroups)

@Jusshersmith
Copy link
Contributor Author

Closing in favour of #267

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.

1 participant