Skip to content

Commit

Permalink
Bump go-auth0 to v0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Jul 18, 2022
1 parent bd683cd commit 9ecabef
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
25 changes: 16 additions & 9 deletions auth0/resource_auth0_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,21 @@ func readUser(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D
d.Set("picture", user.Picture),
)

userMeta, err := structure.FlattenJsonToString(user.UserMetadata)
if err != nil {
return diag.FromErr(err)
var userMeta string
if user.UserMetadata != nil {
userMeta, err = structure.FlattenJsonToString(*user.UserMetadata)
if err != nil {
return diag.FromErr(err)
}
}
result = multierror.Append(result, d.Set("user_metadata", userMeta))

appMeta, err := structure.FlattenJsonToString(user.AppMetadata)
if err != nil {
return diag.FromErr(err)
var appMeta string
if user.AppMetadata != nil {
appMeta, err = structure.FlattenJsonToString(*user.AppMetadata)
if err != nil {
return diag.FromErr(err)
}
}
result = multierror.Append(result, d.Set("app_metadata", appMeta))

Expand Down Expand Up @@ -255,16 +261,17 @@ func buildUser(d *schema.ResourceData) (*management.User, error) {
Blocked: Bool(d, "blocked"),
}

var err error
user.UserMetadata, err = JSON(d, "user_metadata")
userMeta, err := JSON(d, "user_metadata")
if err != nil {
return nil, err
}
user.UserMetadata = &userMeta

user.AppMetadata, err = JSON(d, "app_metadata")
appMeta, err := JSON(d, "app_metadata")
if err != nil {
return nil, err
}
user.AppMetadata = &appMeta

return user, nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/auth0/terraform-provider-auth0
go 1.18

require (
github.com/auth0/go-auth0 v0.9.1
github.com/auth0/go-auth0 v0.9.2
github.com/dnaeon/go-vcr/v2 v2.0.1
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-multierror v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJE
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/auth0/go-auth0 v0.9.1 h1:sc9w+Znl53KXdgYFCLbFz93mW9aJlNK49u/KBsfbmUc=
github.com/auth0/go-auth0 v0.9.1/go.mod h1:kxxGNgF592VPvWSNPVWNbmWHs+R9c0MZCTuW+T3NgZw=
github.com/auth0/go-auth0 v0.9.2 h1:HKG2fchD92qSOOgjg4SDkvUMgUzXHoqcOON5Qfuo1QY=
github.com/auth0/go-auth0 v0.9.2/go.mod h1:kxxGNgF592VPvWSNPVWNbmWHs+R9c0MZCTuW+T3NgZw=
github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48=
github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
Expand Down

0 comments on commit 9ecabef

Please sign in to comment.