From e136d9775610f552ddd780fadcdb1f3246e8fc79 Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Mon, 17 May 2021 15:22:55 +1200 Subject: [PATCH] Fix access policy login_method schema unpack --- cloudflare/resource_cloudflare_access_group.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cloudflare/resource_cloudflare_access_group.go b/cloudflare/resource_cloudflare_access_group.go index 42cc90dd88..f29950c63f 100644 --- a/cloudflare/resource_cloudflare_access_group.go +++ b/cloudflare/resource_cloudflare_access_group.go @@ -553,6 +553,7 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter commonName := "" authMethod := "" geos := []string{} + loginMethod := []string{} oktaID := "" oktaGroups := []string{} gsuiteID := "" @@ -600,6 +601,10 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter for _, geo := range groupValue.(map[string]interface{}) { geos = append(geos, geo.(string)) } + case "login_method": + for _, method := range groupValue.(map[string]interface{}) { + loginMethod = append(loginMethod, method.(string)) + } case "okta": oktaCfg := groupValue.(map[string]interface{}) oktaID = oktaCfg["identity_provider_id"].(string) @@ -673,6 +678,12 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter }) } + if len(loginMethod) > 0 { + data = append(data, map[string]interface{}{ + "login_method": loginMethod, + }) + } + if len(oktaGroups) > 0 && oktaID != "" { data = append(data, map[string]interface{}{ "okta": []interface{}{