From 0f69ef3864faae2d4328c13a06b242817e4cbec6 Mon Sep 17 00:00:00 2001 From: carolyn Date: Fri, 17 Aug 2018 11:05:46 -0700 Subject: [PATCH] disable keycloak auth --- apis/management.cattle.io/v3/schema/schema.go | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index dcf6175a..185f6902 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -417,14 +417,14 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { MustImport(&Version, v3.FreeIpaTestAndApplyInput{}). // Saml Config // Ping-Saml Config - MustImportAndCustomize(&Version, v3.PingConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.ADFSConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.KeyCloakConfig{}, configSchema). + MustImportAndCustomize(&Version, v3.PingConfig{}, configSchemaEnable). + MustImportAndCustomize(&Version, v3.ADFSConfig{}, configSchemaEnable). + MustImportAndCustomize(&Version, v3.KeyCloakConfig{}, configSchemaDisable). MustImport(&Version, v3.SamlConfigTestInput{}). MustImport(&Version, v3.SamlConfigTestOutput{}) } -func configSchema(schema *types.Schema) { +func configSchemaEnable(schema *types.Schema) { schema.BaseType = "authConfig" schema.ResourceActions = map[string]types.Action{ "disable": {}, @@ -437,6 +437,19 @@ func configSchema(schema *types.Schema) { schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} } +func configSchemaDisable(schema *types.Schema) { + schema.BaseType = "authConfig" + schema.ResourceActions = map[string]types.Action{ + "disable": {}, + "testAndEnable": { + Input: "samlConfigTestInput", + Output: "samlConfigTestOutput", + }, + } + schema.CollectionMethods = []string{} + schema.ResourceMethods = []string{} +} + func userTypes(schema *types.Schemas) *types.Schemas { return schema. MustImportAndCustomize(&Version, v3.Preference{}, func(schema *types.Schema) {