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

[installer]: validate the AuthProvider config value #6753

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions installer/pkg/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type Config struct {

Workspace Workspace `json:"workspace" validate:"required"`

AuthProviders []AuthProviderConfigs `json:"authProviders"`
AuthProviders []AuthProviderConfigs `json:"authProviders" validate:"dive"`
kylos101 marked this conversation as resolved.
Show resolved Hide resolved
BlockNewUsers BlockNewUsers `json:"blockNewUsers"`
}

Expand Down Expand Up @@ -224,9 +224,12 @@ const (

// todo(sje): I don't know if we want to put this in the config YAML
type AuthProviderConfigs struct {
ID string `json:"id" validate:"required"`
Host string `json:"host" validate:"required"`
Type string `json:"type" validate:"required"`
BuiltIn string `json:"builtin"`
Verified string `json:"verified"`
OAuth OAuth `json:"oauth"`
OAuth OAuth `json:"oauth" validate:"required"`
Params map[string]string `json:"params"`
HiddenOnDashboard bool `json:"hiddenOnDashboard"`
LoginContextMatcher string `json:"loginContextMatcher"`
Expand All @@ -242,9 +245,9 @@ type BlockNewUsers struct {
}

type OAuth struct {
ClientId string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
CallBackUrl string `json:"callBackUrl"`
ClientId string `json:"clientId" validate:"required"`
ClientSecret string `json:"clientSecret" validate:"required"`
CallBackUrl string `json:"callBackUrl" validate:"required"`
AuthorizationUrl string `json:"authorizationUrl"`
TokenUrl string `json:"tokenUrl"`
Scope string `json:"scope"`
Expand Down