Skip to content

Commit

Permalink
DXCDT-644: clean up of expand for SCIM
Browse files Browse the repository at this point in the history
  • Loading branch information
acwest committed Jul 18, 2024
1 parent fa7be65 commit ea6dfd3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/auth0/connection/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,11 @@ func checkForUnmanagedConfigurationSecrets(configFromTF, configFromAPI map[strin
func expandSCIMConfigurationMapping(data *schema.ResourceData) *[]management.SCIMConfigurationMapping {
srcMapping := data.Get("mapping").(*schema.Set)
mapping := make([]management.SCIMConfigurationMapping, 0, srcMapping.Len())
for _, srcMap := range srcMapping.List() {
for _, item := range srcMapping.List() {
srcMap := item.(map[string]interface{})
mapping = append(mapping, management.SCIMConfigurationMapping{
Auth0: auth0.String(srcMap.(map[string]interface{})["auth0"].(string)),
SCIM: auth0.String(srcMap.(map[string]interface{})["scim"].(string)),
Auth0: auth0.String(srcMap["auth0"].(string)),
SCIM: auth0.String(srcMap["scim"].(string)),
})
}

Expand All @@ -1097,8 +1098,7 @@ func expandSCIMConfiguration(data *schema.ResourceData) *management.SCIMConfigur
cfg := data.GetRawConfig()
scimConfiguration := &management.SCIMConfiguration{}
if !cfg.GetAttr("user_id_attribute").IsNull() {
userIDAttribute := data.Get("user_id_attribute").(string)
scimConfiguration.UserIDAttribute = &userIDAttribute
scimConfiguration.UserIDAttribute = auth0.String(data.Get("user_id_attribute").(string))
}
if !cfg.GetAttr("mapping").IsNull() && cfg.GetAttr("mapping").AsValueSet().Length() > 0 {
scimConfiguration.Mapping = expandSCIMConfigurationMapping(data)
Expand Down

0 comments on commit ea6dfd3

Please sign in to comment.