From a4d5b65545e9505c95b4e00b18fb8063b0d328d4 Mon Sep 17 00:00:00 2001 From: rajashree Date: Mon, 23 Jul 2018 15:36:08 -0700 Subject: [PATCH] Add ADFS provider --- apis/management.cattle.io/v3/authn_types.go | 12 ++++++++---- apis/management.cattle.io/v3/schema/schema.go | 12 ++++++++++++ apis/management.cattle.io/v3public/authn_types.go | 4 ++++ .../v3public/schema/public_schema.go | 11 +++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/apis/management.cattle.io/v3/authn_types.go b/apis/management.cattle.io/v3/authn_types.go index aa0a094d..440a22db 100644 --- a/apis/management.cattle.io/v3/authn_types.go +++ b/apis/management.cattle.io/v3/authn_types.go @@ -285,10 +285,6 @@ type SamlConfig struct { RancherAPIHost string `json:"rancherApiHost" norman:"required"` } -type PingConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` -} - type SamlConfigTestInput struct { FinalRedirectURL string `json:"finalRedirectUrl"` } @@ -296,3 +292,11 @@ type SamlConfigTestInput struct { type SamlConfigTestOutput struct { IdpRedirectURL string `json:"idpRedirectUrl"` } + +type PingConfig struct { + SamlConfig `json:",inline" mapstructure:",squash"` +} + +type ADFSConfig struct { + SamlConfig `json:",inline" mapstructure:",squash"` +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index d4138eb9..9ecae767 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -428,6 +428,18 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { schema.CollectionMethods = []string{} schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} }). + MustImportAndCustomize(&Version, v3.ADFSConfig{}, func(schema *types.Schema) { + schema.BaseType = "authConfig" + schema.ResourceActions = map[string]types.Action{ + "disable": {}, + "testAndEnable": { + Input: "samlConfigTestInput", + Output: "samlConfigTestOutput", + }, + } + schema.CollectionMethods = []string{} + schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} + }). MustImport(&Version, v3.SamlConfigTestInput{}). MustImport(&Version, v3.SamlConfigTestOutput{}) } diff --git a/apis/management.cattle.io/v3public/authn_types.go b/apis/management.cattle.io/v3public/authn_types.go index 03b40686..d8c1973a 100644 --- a/apis/management.cattle.io/v3public/authn_types.go +++ b/apis/management.cattle.io/v3public/authn_types.go @@ -87,6 +87,10 @@ type PingProvider struct { SamlProvider `json:",inline"` } +type ADFSProvider struct { + SamlProvider `json:",inline"` +} + type SamlLoginInput struct { FinalRedirectURL string `json:"finalRedirectUrl"` } diff --git a/apis/management.cattle.io/v3public/schema/public_schema.go b/apis/management.cattle.io/v3public/schema/public_schema.go index d109198d..97af2369 100644 --- a/apis/management.cattle.io/v3public/schema/public_schema.go +++ b/apis/management.cattle.io/v3public/schema/public_schema.go @@ -93,6 +93,17 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas { schema.CollectionMethods = []string{} schema.ResourceMethods = []string{http.MethodGet} }). + MustImportAndCustomize(&PublicVersion, v3public.ADFSProvider{}, func(schema *types.Schema) { + schema.BaseType = "authProvider" + schema.ResourceActions = map[string]types.Action{ + "login": { + Input: "samlLoginInput", + Output: "samlLoginOutput", + }, + } + schema.CollectionMethods = []string{} + schema.ResourceMethods = []string{http.MethodGet} + }). MustImport(&PublicVersion, v3public.SamlLoginInput{}). MustImport(&PublicVersion, v3public.SamlLoginOutput{}). // OpenLdap provider