graph: Allow provisioning users with legacy names (#5255)

Via configuration you can now configure to skip the validation of username and
instead decide to trust the upstream system that is adding users.
This commit is contained in:
Daniel Swärd
2023-01-18 12:25:53 +01:00
committed by Ralf Haferkamp
parent 7c9452768e
commit 96239af982
6 changed files with 90 additions and 9 deletions
+10
View File
@@ -52,5 +52,15 @@ func Validate(cfg *config.Config) error {
"graph", defaults2.BaseConfigPath())
}
switch cfg.API.UsernameMatch {
case "default", "none":
default:
return fmt.Errorf("The username match validator is invalid for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"the config/corresponding environment variable).",
"graph", defaults2.BaseConfigPath())
}
return nil
}