1
0
mirror of https://github.com/rancher/types.git synced 2025-09-02 05:35:16 +00:00

Add google oauth schema

This commit is contained in:
rajashree
2019-05-22 16:42:41 -07:00
committed by Alena Prokharchyk
parent 264466fb30
commit 9125ab265f
4 changed files with 67 additions and 1 deletions

View File

@@ -162,6 +162,28 @@ type GithubConfigApplyInput struct {
Enabled bool `json:"enabled,omitempty"`
}
type GoogleOauthConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline" mapstructure:",squash"`
OauthCredential string `json:"oauthCredential,omitempty" norman:"required"`
ServiceAccountCredential string `json:"serviceAccountCredential,omitempty"`
AdminEmail string `json:"adminEmail,omitempty"`
Hostname string `json:"hostname,omitempty" norman:"required"`
UserInfoEndpoint string `json:"userInfoEndpoint" norman:"default=https://openidconnect.googleapis.com/v1/userinfo,required,notnullable"`
}
type GoogleOauthConfigTestOutput struct {
RedirectURL string `json:"redirectUrl"`
}
type GoogleOauthConfigApplyInput struct {
GoogleOauthConfig GoogleOauthConfig `json:"googleOauthConfig,omitempty"`
Code string `json:"code,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
type AzureADConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

View File

@@ -506,7 +506,25 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
MustImportAndCustomize(&Version, v3.KeyCloakConfig{}, configSchema).
MustImportAndCustomize(&Version, v3.OKTAConfig{}, configSchema).
MustImport(&Version, v3.SamlConfigTestInput{}).
MustImport(&Version, v3.SamlConfigTestOutput{})
MustImport(&Version, v3.SamlConfigTestOutput{}).
//GoogleOAuth Config
MustImportAndCustomize(&Version, v3.GoogleOauthConfig{}, func(schema *types.Schema) {
schema.BaseType = "authConfig"
schema.ResourceActions = map[string]types.Action{
"disable": {},
"configureTest": {
Input: "googleOauthConfig",
Output: "googleOauthConfigTestOutput",
},
"testAndApply": {
Input: "googleOauthConfigApplyInput",
},
}
schema.CollectionMethods = []string{}
schema.ResourceMethods = []string{http.MethodGet, http.MethodPut}
}).
MustImport(&Version, v3.GoogleOauthConfigApplyInput{}).
MustImport(&Version, v3.GoogleOauthConfigTestOutput{})
}
func configSchema(schema *types.Schema) {