Skip to content

Commit

Permalink
add support for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Jan 27, 2021
1 parent cfd0705 commit 96a720e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cloudflare/resource_cloudflare_access_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter
emailDomains := []string{}
ips := []string{}
serviceTokens := []string{}
groups := []string{}
commonName := ""
authMethod := ""
geos := []string{}
Expand Down Expand Up @@ -600,6 +601,10 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter
samlID = samlCfg["identity_provider_id"].(string)
samlAttrName = samlCfg["attribute_name"].(string)
samlAttrValue = samlCfg["attribute_value"].(string)
case "group":
for _, group := range groupValue.(map[string]interface{}) {
groups = append(groups, group.(string))
}
default:
log.Printf("[DEBUG] Access Group key %q not transformed", groupKey)
}
Expand Down Expand Up @@ -700,5 +705,11 @@ func TransformAccessGroupForSchema(accessGroup []interface{}) []map[string]inter
})
}

if len(groups) > 0 {
data = append(data, map[string]interface{}{
"group": groups,
})
}

return data
}

0 comments on commit 96a720e

Please sign in to comment.