mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
bcc2409564
* wip * Update validation * Chore: Remove InputControl usage * Fixes, validation * Remove empty option * Validation changes * Add tests, rename * lint --------- Co-authored-by: Clarity-89 <homes89@ukr.net>
25 lines
931 B
Go
25 lines
931 B
Go
package ssosettings
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/util/errutil"
|
|
)
|
|
|
|
var (
|
|
errNotFoundBase = errutil.NotFound("sso.notFound", errutil.WithPublicMessage("The provider was not found."))
|
|
ErrNotFound = errNotFoundBase.Errorf("not found")
|
|
|
|
ErrNotConfigurable = errNotFoundBase.Errorf("not configurable")
|
|
|
|
ErrBaseInvalidOAuthConfig = errutil.ValidationFailed("sso.invalidOauthConfig")
|
|
|
|
ErrInvalidOAuthConfig = func(msg string) error {
|
|
base := ErrBaseInvalidOAuthConfig.Errorf("OAuth settings are invalid")
|
|
base.PublicMessage = msg
|
|
return base
|
|
}
|
|
|
|
ErrInvalidProvider = errutil.ValidationFailed("sso.invalidProvider", errutil.WithPublicMessage("Provider is invalid"))
|
|
ErrInvalidSettings = errutil.ValidationFailed("sso.settings", errutil.WithPublicMessage("Settings field is invalid"))
|
|
ErrEmptyClientId = errutil.ValidationFailed("sso.emptyClientId", errutil.WithPublicMessage("ClientId cannot be empty"))
|
|
)
|