Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Fix the error for managing client metadata #64

Merged
merged 1 commit into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions auth0/resource_auth0_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,12 @@ func buildClient(d *schema.ResourceData) *management.Client {
}
})

List(d, "client_metadata").First(func(v interface{}) {
c.ClientMetadata = v.(map[string]string)
})
if v, ok := d.GetOk("client_metadata"); ok {
c.ClientMetadata = make(map[string]string)
for key, value := range v.(map[string]interface{}) {
c.ClientMetadata[key] = (value.(string))
}
}

List(d, "mobile").First(func(v interface{}) {

Expand Down
4 changes: 4 additions & 0 deletions auth0/resource_auth0_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestAccClient(t *testing.T) {
resource.TestCheckResourceAttr("auth0_client.my_client", "addons.0.samlp.0.audience", "https://example.com/saml"),
resource.TestCheckResourceAttr("auth0_client.my_client", "addons.0.samlp.0.map_identities", "false"),
resource.TestCheckResourceAttr("auth0_client.my_client", "addons.0.samlp.0.name_identifier_format", "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"),
resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.foo", "zoo"),
),
},
},
Expand Down Expand Up @@ -52,6 +53,9 @@ resource "auth0_client" "my_client" {
foo = "bar"
}
}
client_metadata = {
foo = "zoo"
}
addons = {
firebase = {
client_email = "john.doe@example.com"
Expand Down