From 0bab77f023098ef12ef09ea277fd83e5a34af23b Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Wed, 8 Nov 2023 13:53:27 +0100 Subject: [PATCH 1/2] Add disable_self_service_change_password to AD connection options --- docs/resources/connection.md | 7 +- .../auth0_connection/resource_with_ad.tf | 7 +- go.mod | 4 +- go.sum | 8 +- internal/auth0/connection/expand.go | 19 ++--- internal/auth0/connection/flatten.go | 23 +++--- internal/auth0/connection/resource_test.go | 4 + test/data/recordings/TestAccConnectionAD.yaml | 80 +++++++++---------- 8 files changed, 80 insertions(+), 72 deletions(-) diff --git a/docs/resources/connection.md b/docs/resources/connection.md index cb91f6d77..cd9a37951 100644 --- a/docs/resources/connection.md +++ b/docs/resources/connection.md @@ -281,9 +281,10 @@ resource "auth0_connection" "ad" { show_as_button = true options { - brute_force_protection = true - tenant_domain = "example.com" - icon_url = "https://example.com/assets/logo.png" + disable_self_service_change_password = true + brute_force_protection = true + tenant_domain = "example.com" + icon_url = "https://example.com/assets/logo.png" domain_aliases = [ "example.com", "api.example.com" diff --git a/examples/resources/auth0_connection/resource_with_ad.tf b/examples/resources/auth0_connection/resource_with_ad.tf index 65a8db254..d5cc5ff92 100644 --- a/examples/resources/auth0_connection/resource_with_ad.tf +++ b/examples/resources/auth0_connection/resource_with_ad.tf @@ -5,9 +5,10 @@ resource "auth0_connection" "ad" { show_as_button = true options { - brute_force_protection = true - tenant_domain = "example.com" - icon_url = "https://example.com/assets/logo.png" + disable_self_service_change_password = true + brute_force_protection = true + tenant_domain = "example.com" + icon_url = "https://example.com/assets/logo.png" domain_aliases = [ "example.com", "api.example.com" diff --git a/go.mod b/go.mod index 2d10989f3..d0e3a7711 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/PuerkitoBio/rehttp v1.3.0 - github.com/auth0/go-auth0 v1.2.0 + github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 @@ -28,7 +28,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.13.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect diff --git a/go.sum b/go.sum index 567d8c12a..f5776f22a 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/auth0/go-auth0 v1.2.0 h1:pZWzWCWk038jDsItwfqrbuoN37xcNHUClfPzW+rk1ok= -github.com/auth0/go-auth0 v1.2.0/go.mod h1:tLH1Qv816g3dpqituiPNN4ET+YoNtk5++68aRg+MxaA= +github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4 h1:PgChubgxiF/JKtHI1DwF+yAUVg/SsVQdq36a32XxczY= +github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4/go.mod h1:JYeef0PqdISrt/yiqHH84qEQ4hIcL3EGzYHZZfWWJzI= 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= @@ -63,8 +63,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/internal/auth0/connection/expand.go b/internal/auth0/connection/expand.go index 54615cdd8..9ae2021df 100644 --- a/internal/auth0/connection/expand.go +++ b/internal/auth0/connection/expand.go @@ -545,15 +545,16 @@ func expandConnectionOptionsEmail(_ *schema.ResourceData, config cty.Value) (int func expandConnectionOptionsAD(_ *schema.ResourceData, config cty.Value) (interface{}, diag.Diagnostics) { options := &management.ConnectionOptionsAD{ - DomainAliases: value.Strings(config.GetAttr("domain_aliases")), - TenantDomain: value.String(config.GetAttr("tenant_domain")), - LogoURL: value.String(config.GetAttr("icon_url")), - IPs: value.Strings(config.GetAttr("ips")), - CertAuth: value.Bool(config.GetAttr("use_cert_auth")), - Kerberos: value.Bool(config.GetAttr("use_kerberos")), - DisableCache: value.Bool(config.GetAttr("disable_cache")), - NonPersistentAttrs: value.Strings(config.GetAttr("non_persistent_attrs")), - BruteForceProtection: value.Bool(config.GetAttr("brute_force_protection")), + DomainAliases: value.Strings(config.GetAttr("domain_aliases")), + TenantDomain: value.String(config.GetAttr("tenant_domain")), + LogoURL: value.String(config.GetAttr("icon_url")), + IPs: value.Strings(config.GetAttr("ips")), + CertAuth: value.Bool(config.GetAttr("use_cert_auth")), + Kerberos: value.Bool(config.GetAttr("use_kerberos")), + DisableCache: value.Bool(config.GetAttr("disable_cache")), + NonPersistentAttrs: value.Strings(config.GetAttr("non_persistent_attrs")), + BruteForceProtection: value.Bool(config.GetAttr("brute_force_protection")), + DisableSelfServiceChangePassword: value.Bool(config.GetAttr("disable_self_service_change_password")), } options.SetUserAttributes = value.String(config.GetAttr("set_user_root_attributes")) diff --git a/internal/auth0/connection/flatten.go b/internal/auth0/connection/flatten.go index 2281c8387..6e18e5a08 100644 --- a/internal/auth0/connection/flatten.go +++ b/internal/auth0/connection/flatten.go @@ -678,17 +678,18 @@ func flattenConnectionOptionsAD( } optionsMap := map[string]interface{}{ - "tenant_domain": options.GetTenantDomain(), - "domain_aliases": options.GetDomainAliases(), - "icon_url": options.GetLogoURL(), - "ips": options.GetIPs(), - "use_cert_auth": options.GetCertAuth(), - "use_kerberos": options.GetKerberos(), - "disable_cache": options.GetDisableCache(), - "brute_force_protection": options.GetBruteForceProtection(), - "non_persistent_attrs": options.GetNonPersistentAttrs(), - "set_user_root_attributes": options.GetSetUserAttributes(), - "upstream_params": upstreamParams, + "tenant_domain": options.GetTenantDomain(), + "domain_aliases": options.GetDomainAliases(), + "icon_url": options.GetLogoURL(), + "ips": options.GetIPs(), + "use_cert_auth": options.GetCertAuth(), + "use_kerberos": options.GetKerberos(), + "disable_cache": options.GetDisableCache(), + "brute_force_protection": options.GetBruteForceProtection(), + "non_persistent_attrs": options.GetNonPersistentAttrs(), + "set_user_root_attributes": options.GetSetUserAttributes(), + "disable_self_service_change_password": options.GetDisableSelfServiceChangePassword(), + "upstream_params": upstreamParams, } if options.GetSetUserAttributes() == "" { diff --git a/internal/auth0/connection/resource_test.go b/internal/auth0/connection/resource_test.go index f0cb71c19..e41b53fe8 100644 --- a/internal/auth0/connection/resource_test.go +++ b/internal/auth0/connection/resource_test.go @@ -180,6 +180,7 @@ func TestAccConnectionAD(t *testing.T) { resource.TestCheckTypeSetElemAttr("auth0_connection.ad", "options.0.non_persistent_attrs.*", "ethnicity"), resource.TestCheckTypeSetElemAttr("auth0_connection.ad", "options.0.non_persistent_attrs.*", "gender"), resource.TestCheckResourceAttr("auth0_connection.ad", "options.0.upstream_params", "{\"screen_name\":{\"alias\":\"login_hint\"}}"), + resource.TestCheckResourceAttr("auth0_connection.ad", "options.0.disable_self_service_change_password", "false"), ), }, { @@ -199,6 +200,7 @@ func TestAccConnectionAD(t *testing.T) { resource.TestCheckTypeSetElemAttr("auth0_connection.ad", "options.0.non_persistent_attrs.*", "ethnicity"), resource.TestCheckTypeSetElemAttr("auth0_connection.ad", "options.0.non_persistent_attrs.*", "gender"), resource.TestCheckResourceAttr("auth0_connection.ad", "options.0.upstream_params", "{\"screen_name\":{\"alias\":\"login_hint\"}}"), + resource.TestCheckResourceAttr("auth0_connection.ad", "options.0.disable_self_service_change_password", "true"), ), }, }, @@ -211,6 +213,7 @@ resource "auth0_connection" "ad" { strategy = "ad" show_as_button = true options { + disable_self_service_change_password = false brute_force_protection = true tenant_domain = "example.com" domain_aliases = [ @@ -235,6 +238,7 @@ resource "auth0_connection" "ad" { strategy = "ad" show_as_button = true options { + disable_self_service_change_password = true brute_force_protection = true tenant_domain = "example.com" domain_aliases = [ diff --git a/test/data/recordings/TestAccConnectionAD.yaml b/test/data/recordings/TestAccConnectionAD.yaml index 3e3fa3da1..a9d8a412f 100644 --- a/test/data/recordings/TestAccConnectionAD.yaml +++ b/test/data/recordings/TestAccConnectionAD.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 350 + content_length: 395 transfer_encoding: [] trailer: {} host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-AD-TestAccConnectionAD","strategy":"ad","show_as_button":true,"options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Acceptance-Test-AD-TestAccConnectionAD","strategy":"ad","show_as_button":true,"options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"disable_self_service_change_password":false}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 + - Go-Auth0/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections method: POST response: @@ -28,15 +28,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 601 + content_length: 622 uncompressed: false - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}}},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"disable_self_service_change_password":false},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 198.945ms + duration: 209.435167ms - id: 1 request: proto: HTTP/1.1 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -66,13 +66,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"disable_self_service_change_password":false},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 94.423ms + duration: 101.596875ms - id: 2 request: proto: HTTP/1.1 @@ -91,8 +91,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -102,13 +102,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"disable_self_service_change_password":false},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 100.938291ms + duration: 102.970333ms - id: 3 request: proto: HTTP/1.1 @@ -127,8 +127,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -138,13 +138,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"disable_self_service_change_password":false},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 90.590792ms + duration: 133.853042ms - id: 4 request: proto: HTTP/1.1 @@ -163,8 +163,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -174,33 +174,33 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"disable_self_service_change_password":false},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 83.786333ms + duration: 176.196ms - id: 5 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 330 + content_length: 374 transfer_encoding: [] trailer: {} host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"show_as_button":true,"options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login","non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"show_as_button":true,"options":{"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"ips":["192.168.1.1","192.168.1.2"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login","non_persistent_attrs":["ethnicity","gender"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"disable_self_service_change_password":true}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: PATCH response: proto: HTTP/2.0 @@ -210,13 +210,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login"},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login","disable_self_service_change_password":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 173.705ms + duration: 163.709ms - id: 6 request: proto: HTTP/1.1 @@ -235,8 +235,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -246,13 +246,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login"},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login","disable_self_service_change_password":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 84.149375ms + duration: 109.574666ms - id: 7 request: proto: HTTP/1.1 @@ -271,8 +271,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: GET response: proto: HTTP/2.0 @@ -282,13 +282,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"con_edhvzCkZvOz5QNdz","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login"},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/NQuWSAzEoCuU5bwMSEFz7FXw2oDiHFox","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' + body: '{"id":"con_yAtnohItHFcriZzk","options":{"ips":["192.168.1.1","192.168.1.2"],"tenant_domain":"example.com","domain_aliases":["api.example.com","example.com"],"upstream_params":{"screen_name":{"alias":"login_hint"}},"non_persistent_attrs":["ethnicity","gender"],"brute_force_protection":true,"set_user_root_attributes":"on_first_login","disable_self_service_change_password":true},"strategy":"ad","name":"Acceptance-Test-AD-TestAccConnectionAD","provisioning_ticket_url":"https://terraform-provider-auth0-dev.eu.auth0.com/p/ad/lmMkUOn0gQFneCfrfV7VT46B2raRSFcS","is_domain_connection":false,"show_as_button":true,"enabled_clients":[],"realms":["Acceptance-Test-AD-TestAccConnectionAD"]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 125.765166ms + duration: 110.606708ms - id: 8 request: proto: HTTP/1.1 @@ -306,8 +306,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.0.2 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_edhvzCkZvOz5QNdz + - Go-Auth0/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/connections/con_yAtnohItHFcriZzk method: DELETE response: proto: HTTP/2.0 @@ -317,10 +317,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2023-08-31T08:59:52.125Z"}' + body: '{"deleted_at":"2023-11-08T12:52:41.530Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 95.815667ms + duration: 106.59675ms From 4e8eb0cf824f92046257a370a5cd7c36335431ae Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:01:42 +0100 Subject: [PATCH 2/2] Bump go-auth0 to v1.3.0 --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index d0e3a7711..edba56af7 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/PuerkitoBio/rehttp v1.3.0 - github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4 + github.com/auth0/go-auth0 v1.3.0 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 @@ -66,13 +66,13 @@ require ( github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.3 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.15.0 // indirect golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.56.3 // indirect diff --git a/go.sum b/go.sum index f5776f22a..9bab8ad45 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4 h1:PgChubgxiF/JKtHI1DwF+yAUVg/SsVQdq36a32XxczY= -github.com/auth0/go-auth0 v0.0.0-20231108124355-09ffb2c8d9c4/go.mod h1:JYeef0PqdISrt/yiqHH84qEQ4hIcL3EGzYHZZfWWJzI= +github.com/auth0/go-auth0 v1.3.0 h1:46bo0C6HYtsdSj4BEF4j6IaQrSAiUqehwuv+IO3qDJ0= +github.com/auth0/go-auth0 v1.3.0/go.mod h1:gm0NUM340x77a9YVZB50HUrJJkSchD9DkiqqbAl+s34= 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= @@ -207,8 +207,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= @@ -217,10 +217,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -234,15 +234,15 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=