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

Commit

Permalink
Add support for set_user_root_attributes to more options
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Kalyvitis committed Feb 4, 2021
1 parent af0b73d commit 7d45966
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.19.0

ENHANCEMENTS:

* resource/auth0_connection: Add `set_user_root_attributes` to more connections [#324](https://github.com/alexkappa/terraform-provider-auth0/pull/324)

## 0.18.0

FEATURES:
Expand Down
4 changes: 2 additions & 2 deletions auth0/resource_auth0_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ resource "auth0_connection" "oidc" {
token_endpoint = "https://api.login.yahoo.com/oauth2/get_token"
userinfo_endpoint = "https://api.login.yahoo.com/openid/v1/userinfo"
authorization_endpoint = "https://api.login.yahoo.com/oauth2/request_auth"
scopes = [ "openid", "email", "profile" ]
scopes = [ "openid", "email", "profile" ]
set_user_root_attributes = "on_each_login"
}
}
Expand All @@ -385,7 +385,7 @@ resource "auth0_connection" "oidc" {
token_endpoint = "https://api.paypal.com/v1/oauth2/token"
userinfo_endpoint = "https://api.paypal.com/v1/oauth2/token/userinfo"
authorization_endpoint = "https://www.paypal.com/signin/authorize"
scopes = [ "openid", "email" ]
scopes = [ "openid", "email" ]
set_user_root_attributes = "on_first_login"
}
}
Expand Down
22 changes: 11 additions & 11 deletions auth0/structure_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func flattenConnectionOptionsAuth0(d ResourceData, o *management.ConnectionOptio
"custom_scripts": o.CustomScripts,
"mfa": o.MFA,
"configuration": Map(d, "configuration"), // does not get read back
"set_user_root_attributes": o.GetSetUserAttributes(),
}
}

Expand Down Expand Up @@ -164,14 +163,15 @@ func flattenConnectionOptionsOIDC(o *management.ConnectionOptionsOIDC) interface
"tenant_domain": o.GetTenantDomain(),
"domain_aliases": o.DomainAliases,

"type": o.GetType(),
"scopes": o.Scopes(),
"issuer": o.GetIssuer(),
"jwks_uri": o.GetJWKSURI(),
"discovery_url": o.GetDiscoveryURL(),
"token_endpoint": o.GetTokenEndpoint(),
"userinfo_endpoint": o.GetUserInfoEndpoint(),
"authorization_endpoint": o.GetAuthorizationEndpoint(),
"type": o.GetType(),
"scopes": o.Scopes(),
"issuer": o.GetIssuer(),
"jwks_uri": o.GetJWKSURI(),
"discovery_url": o.GetDiscoveryURL(),
"token_endpoint": o.GetTokenEndpoint(),
"userinfo_endpoint": o.GetUserInfoEndpoint(),
"authorization_endpoint": o.GetAuthorizationEndpoint(),
"set_user_root_attributes": o.GetSetUserAttributes(),
}
}

Expand Down Expand Up @@ -321,8 +321,7 @@ func expandConnectionOptionsGitHub(d ResourceData) *management.ConnectionOptions
func expandConnectionOptionsAuth0(d ResourceData) *management.ConnectionOptions {

o := &management.ConnectionOptions{
PasswordPolicy: String(d, "password_policy"),
SetUserAttributes: String(d, "set_user_root_attributes"),
PasswordPolicy: String(d, "password_policy"),
}

List(d, "validation").Elem(func(d ResourceData) {
Expand Down Expand Up @@ -572,6 +571,7 @@ func expandConnectionOptionsOIDC(d ResourceData) *management.ConnectionOptionsOI
Type: String(d, "type"),
UserInfoEndpoint: String(d, "userinfo_endpoint"),
TokenEndpoint: String(d, "token_endpoint"),
SetUserAttributes: String(d, "set_user_root_attributes"),
}

expandConnectionOptionsScopes(d, o)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.13
require (
github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/terraform-plugin-sdk v1.16.0
gopkg.in/auth0.v5 v5.9.0
gopkg.in/auth0.v5 v5.11.0
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU=
gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E=
gopkg.in/auth0.v5 v5.9.0 h1:k6kd6+QjFtX8ZSho7yU1oaIrKUcGffwsIGtCkHPCVxc=
gopkg.in/auth0.v5 v5.9.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E=
gopkg.in/auth0.v5 v5.10.0 h1:mR95cYVqUrHZAE/j9EXzzPqRyqsIcR8vRpeZ364gUKw=
gopkg.in/auth0.v5 v5.10.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E=
gopkg.in/auth0.v5 v5.11.0 h1:cMwZoPuZZgK6y1F5FJDeVMi3PaDfchoDywu2qsNCCbc=
gopkg.in/auth0.v5 v5.11.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

0 comments on commit 7d45966

Please sign in to comment.