From 5eb3931b41a6f8ddc313406f305121e456b02869 Mon Sep 17 00:00:00 2001 From: rajashree Date: Fri, 20 Jul 2018 12:16:01 -0700 Subject: [PATCH] Change Saml-Ping testAndEnable and login output Change name of redirectURL --- apis/management.cattle.io/v3/authn_types.go | 4 ++++ apis/management.cattle.io/v3/schema/schema.go | 6 ++++-- apis/management.cattle.io/v3public/authn_types.go | 6 +++++- apis/management.cattle.io/v3public/schema/public_schema.go | 7 ++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apis/management.cattle.io/v3/authn_types.go b/apis/management.cattle.io/v3/authn_types.go index b68e6dc0..aa0a094d 100644 --- a/apis/management.cattle.io/v3/authn_types.go +++ b/apis/management.cattle.io/v3/authn_types.go @@ -292,3 +292,7 @@ type PingConfig struct { type SamlConfigTestInput struct { FinalRedirectURL string `json:"finalRedirectUrl"` } + +type SamlConfigTestOutput struct { + IdpRedirectURL string `json:"idpRedirectUrl"` +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index e1a685c9..28164835 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -421,13 +421,15 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { schema.ResourceActions = map[string]types.Action{ "disable": {}, "testAndEnable": { - Input: "samlConfigTestInput", + Input: "samlConfigTestInput", + Output: "samlConfigTestOutput", }, } schema.CollectionMethods = []string{} schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} }). - MustImport(&Version, v3.SamlConfigTestInput{}) + MustImport(&Version, v3.SamlConfigTestInput{}). + MustImport(&Version, v3.SamlConfigTestOutput{}) } func userTypes(schema *types.Schemas) *types.Schemas { diff --git a/apis/management.cattle.io/v3public/authn_types.go b/apis/management.cattle.io/v3public/authn_types.go index a5cfeeb6..03b40686 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 SamlLogin struct { +type SamlLoginInput struct { FinalRedirectURL string `json:"finalRedirectUrl"` } + +type SamlLoginOutput struct { + IdpRedirectURL string `json:"idpRedirectUrl"` +} diff --git a/apis/management.cattle.io/v3public/schema/public_schema.go b/apis/management.cattle.io/v3public/schema/public_schema.go index 0372f19a..d109198d 100644 --- a/apis/management.cattle.io/v3public/schema/public_schema.go +++ b/apis/management.cattle.io/v3public/schema/public_schema.go @@ -86,14 +86,15 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas { schema.BaseType = "authProvider" schema.ResourceActions = map[string]types.Action{ "login": { - Input: "samlLogin", - Output: "token", + Input: "samlLoginInput", + Output: "samlLoginOutput", }, } schema.CollectionMethods = []string{} schema.ResourceMethods = []string{http.MethodGet} }). - MustImport(&PublicVersion, v3public.SamlLogin{}). + MustImport(&PublicVersion, v3public.SamlLoginInput{}). + MustImport(&PublicVersion, v3public.SamlLoginOutput{}). // OpenLdap provider MustImportAndCustomize(&PublicVersion, v3public.OpenLdapProvider{}, func(schema *types.Schema) { schema.BaseType = "authProvider"