From cc44440be121c70bab806f3b22b91a6fd3a2a75d Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea Date: Fri, 7 Oct 2022 10:55:06 +0200 Subject: [PATCH 1/2] Refactor role and rule resources to allow for empty fields --- internal/provider/resource_auth0_role.go | 59 +- internal/provider/resource_auth0_role_test.go | 29 + internal/provider/resource_auth0_rule.go | 18 +- .../provider/resource_auth0_rule_config.go | 13 +- .../resource_auth0_rule_config_test.go | 15 + internal/provider/resource_auth0_rule_test.go | 39 +- test/data/recordings/TestAccRole.yaml | 798 +++++++++++++++--- test/data/recordings/TestAccRule.yaml | 314 ++++++- test/data/recordings/TestAccRuleConfig.yaml | 186 +++- 9 files changed, 1283 insertions(+), 188 deletions(-) diff --git a/internal/provider/resource_auth0_role.go b/internal/provider/resource_auth0_role.go index e652c9d34..5879c0c45 100644 --- a/internal/provider/resource_auth0_role.go +++ b/internal/provider/resource_auth0_role.go @@ -9,6 +9,8 @@ import ( "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) func newRole() *schema.Resource { @@ -58,25 +60,19 @@ func newRole() *schema.Resource { } func createRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - role := expandRole(d) api := m.(*management.Management) + + role := expandRole(d) if err := api.Role.Create(role); err != nil { return diag.FromErr(err) } - d.SetId(auth0.StringValue(role.ID)) + d.SetId(role.GetID()) - // Enable partial state mode. Sub-resources can potentially cause partial - // state. Therefore, we must explicitly tell Terraform what is safe to - // persist and what is not. - // - // See: https://www.terraform.io/docs/extend/writing-custom-providers.html d.Partial(true) if err := assignRolePermissions(d, m); err != nil { return diag.FromErr(err) } - // We succeeded, disable partial mode. - // This causes Terraform to save all fields again. d.Partial(false) return readRole(ctx, d, m) @@ -84,22 +80,19 @@ func createRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag func readRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := m.(*management.Management) + role, err := api.Role.Read(d.Id()) if err != nil { - if mErr, ok := err.(management.Error); ok { - if mErr.Status() == http.StatusNotFound { - d.SetId("") - return nil - } + if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound { + d.SetId("") + return nil } return diag.FromErr(err) } - d.SetId(role.GetID()) - result := multierror.Append( - d.Set("name", role.Name), - d.Set("description", role.Description), + d.Set("name", role.GetName()), + d.Set("description", role.GetDescription()), ) var permissions []*management.Permission @@ -115,17 +108,22 @@ func readRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D if !permissionList.HasNext() { break } + page++ } - result = multierror.Append(result, d.Set("permissions", flattenRolePermissions(permissions))) + result = multierror.Append( + result, + d.Set("permissions", flattenRolePermissions(permissions)), + ) return diag.FromErr(result.ErrorOrNil()) } func updateRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - role := expandRole(d) api := m.(*management.Management) + + role := expandRole(d) if err := api.Role.Update(d.Id(), role); err != nil { return diag.FromErr(err) } @@ -141,22 +139,25 @@ func updateRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag func deleteRole(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := m.(*management.Management) + if err := api.Role.Delete(d.Id()); err != nil { - if mErr, ok := err.(management.Error); ok { - if mErr.Status() == http.StatusNotFound { - d.SetId("") - return nil - } + if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound { + d.SetId("") + return nil } + return diag.FromErr(err) } + d.SetId("") return nil } func expandRole(d *schema.ResourceData) *management.Role { + config := d.GetRawConfig() + return &management.Role{ - Name: String(d, "name"), - Description: String(d, "description"), + Name: value.String(config.GetAttr("name")), + Description: value.String(config.GetAttr("description")), } } @@ -202,8 +203,8 @@ func flattenRolePermissions(permissions []*management.Permission) []interface{} var result []interface{} for _, permission := range permissions { result = append(result, map[string]interface{}{ - "name": permission.Name, - "resource_server_identifier": permission.ResourceServerIdentifier, + "name": permission.GetName(), + "resource_server_identifier": permission.GetResourceServerIdentifier(), }) } return result diff --git a/internal/provider/resource_auth0_role_test.go b/internal/provider/resource_auth0_role_test.go index 60ec13222..2096594e1 100644 --- a/internal/provider/resource_auth0_role_test.go +++ b/internal/provider/resource_auth0_role_test.go @@ -58,6 +58,14 @@ func TestAccRole(t *testing.T) { resource.Test(t, resource.TestCase{ ProviderFactories: testProviders(httpRecorder), Steps: []resource.TestStep{ + { + Config: template.ParseTestName(testAccRoleEmpty, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_role.the_one", "name", fmt.Sprintf("The One - Acceptance Test - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_role.the_one", "description", ""), + resource.TestCheckResourceAttr("auth0_role.the_one", "permissions.#", "0"), + ), + }, { Config: template.ParseTestName(testAccRoleCreate, t.Name()), Check: resource.ComposeTestCheckFunc( @@ -73,10 +81,24 @@ func TestAccRole(t *testing.T) { resource.TestCheckResourceAttr("auth0_role.the_one", "permissions.#", "2"), ), }, + { + Config: template.ParseTestName(testAccRoleEmptyAgain, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_role.the_one", "name", fmt.Sprintf("The One - Acceptance Test - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_role.the_one", "description", " "), // #Management API ignores empty strings for role descriptions + resource.TestCheckResourceAttr("auth0_role.the_one", "permissions.#", "0"), + ), + }, }, }) } +const testAccRoleEmpty = ` +resource auth0_role the_one { + name = "The One - Acceptance Test - {{.testName}}" +} +` + const testAccRoleAux = ` resource auth0_resource_server matrix { name = "Role - Acceptance Test - {{.testName}}" @@ -117,6 +139,13 @@ resource auth0_role the_one { } ` +const testAccRoleEmptyAgain = ` +resource auth0_role the_one { + name = "The One - Acceptance Test - {{.testName}}" + description = " " +} +` + func TestAccRolePermissions(t *testing.T) { httpRecorder := recorder.New(t) diff --git a/internal/provider/resource_auth0_rule.go b/internal/provider/resource_auth0_rule.go index f41186116..6e063f5c0 100644 --- a/internal/provider/resource_auth0_rule.go +++ b/internal/provider/resource_auth0_rule.go @@ -7,10 +7,13 @@ import ( "github.com/auth0/go-auth0" "github.com/auth0/go-auth0/management" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) var ruleNameRegexp = regexp.MustCompile(`^[^\s-][\w -]+[^\s-]$`) @@ -55,6 +58,7 @@ func newRule() *schema.Resource { "enabled": { Type: schema.TypeBool, Optional: true, + Computed: true, Description: "Indicates whether the rule is enabled.", }, }, @@ -62,7 +66,7 @@ func newRule() *schema.Resource { } func createRule(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - rule := buildRule(d) + rule := expandRule(d.GetRawConfig()) api := m.(*management.Management) if err := api.Rule.Create(rule); err != nil { return diag.FromErr(err) @@ -97,7 +101,7 @@ func readRule(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D } func updateRule(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - rule := buildRule(d) + rule := expandRule(d.GetRawConfig()) api := m.(*management.Management) if err := api.Rule.Update(d.Id(), rule); err != nil { return diag.FromErr(err) @@ -121,11 +125,11 @@ func deleteRule(ctx context.Context, d *schema.ResourceData, m interface{}) diag return nil } -func buildRule(d *schema.ResourceData) *management.Rule { +func expandRule(d cty.Value) *management.Rule { return &management.Rule{ - Name: String(d, "name"), - Script: String(d, "script"), - Order: Int(d, "order"), - Enabled: Bool(d, "enabled"), + Name: value.String(d.GetAttr("name")), + Script: value.String(d.GetAttr("script")), + Order: value.Int(d.GetAttr("order")), + Enabled: value.Bool(d.GetAttr("enabled")), } } diff --git a/internal/provider/resource_auth0_rule_config.go b/internal/provider/resource_auth0_rule_config.go index 0cbb9983f..564410d20 100644 --- a/internal/provider/resource_auth0_rule_config.go +++ b/internal/provider/resource_auth0_rule_config.go @@ -6,8 +6,11 @@ import ( "github.com/auth0/go-auth0" "github.com/auth0/go-auth0/management" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) func newRuleConfig() *schema.Resource { @@ -41,7 +44,7 @@ func newRuleConfig() *schema.Resource { } func createRuleConfig(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - ruleConfig := buildRuleConfig(d) + ruleConfig := expandRuleConfig(d.GetRawConfig()) key := auth0.StringValue(ruleConfig.Key) ruleConfig.Key = nil api := m.(*management.Management) @@ -71,7 +74,7 @@ func readRuleConfig(ctx context.Context, d *schema.ResourceData, m interface{}) } func updateRuleConfig(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - ruleConfig := buildRuleConfig(d) + ruleConfig := expandRuleConfig(d.GetRawConfig()) ruleConfig.Key = nil api := m.(*management.Management) if err := api.RuleConfig.Upsert(d.Id(), ruleConfig); err != nil { @@ -95,9 +98,9 @@ func deleteRuleConfig(ctx context.Context, d *schema.ResourceData, m interface{} return nil } -func buildRuleConfig(d *schema.ResourceData) *management.RuleConfig { +func expandRuleConfig(d cty.Value) *management.RuleConfig { return &management.RuleConfig{ - Key: String(d, "key"), - Value: String(d, "value"), + Key: value.String(d.GetAttr("key")), + Value: value.String(d.GetAttr("value")), } } diff --git a/internal/provider/resource_auth0_rule_config_test.go b/internal/provider/resource_auth0_rule_config_test.go index 8802f9587..5b4c63ecf 100644 --- a/internal/provider/resource_auth0_rule_config_test.go +++ b/internal/provider/resource_auth0_rule_config_test.go @@ -74,6 +74,14 @@ func TestAccRuleConfig(t *testing.T) { resource.TestCheckResourceAttr("auth0_rule_config.foo", "value", "foo"), ), }, + { + Config: template.ParseTestName(testAccRuleConfigEmptyValue, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_rule_config.foo", "id", fmt.Sprintf("acc_test_key_%s", t.Name())), + resource.TestCheckResourceAttr("auth0_rule_config.foo", "key", fmt.Sprintf("acc_test_key_%s", t.Name())), + resource.TestCheckResourceAttr("auth0_rule_config.foo", "value", ""), + ), + }, }, }) } @@ -98,3 +106,10 @@ resource "auth0_rule_config" "foo" { value = "foo" } ` + +const testAccRuleConfigEmptyValue = ` +resource "auth0_rule_config" "foo" { + key = "acc_test_key_{{.testName}}" + value = "" +} +` diff --git a/internal/provider/resource_auth0_rule_test.go b/internal/provider/resource_auth0_rule_test.go index d196c1b6e..c7a38280e 100644 --- a/internal/provider/resource_auth0_rule_test.go +++ b/internal/provider/resource_auth0_rule_test.go @@ -18,25 +18,60 @@ func TestAccRule(t *testing.T) { ProviderFactories: testProviders(httpRecorder), Steps: []resource.TestStep{ { - Config: template.ParseTestName(testAccRule, t.Name()), + Config: template.ParseTestName(testAccRuleCreate, t.Name()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("auth0_rule.my_rule", "name", fmt.Sprintf("acceptance-test-%s", t.Name())), resource.TestCheckResourceAttr("auth0_rule.my_rule", "script", "function (user, context, callback) { callback(null, user, context); }"), + resource.TestCheckResourceAttrSet("auth0_rule.my_rule", "enabled"), + resource.TestCheckResourceAttrSet("auth0_rule.my_rule", "order"), + ), + }, + { + Config: template.ParseTestName(testAccRuleUpdate, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_rule.my_rule", "name", fmt.Sprintf("acceptance-test-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_rule.my_rule", "script", "function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }"), resource.TestCheckResourceAttr("auth0_rule.my_rule", "enabled", "true"), + resource.TestCheckResourceAttr("auth0_rule.my_rule", "order", "1"), + ), + }, + { + Config: template.ParseTestName(testAccRuleUpdateAgain, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_rule.my_rule", "name", fmt.Sprintf("acceptance-test-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_rule.my_rule", "script", "function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }"), + resource.TestCheckResourceAttr("auth0_rule.my_rule", "enabled", "false"), + resource.TestCheckResourceAttr("auth0_rule.my_rule", "order", "1"), ), }, }, }) } -const testAccRule = ` +const testAccRuleCreate = ` resource "auth0_rule" "my_rule" { name = "acceptance-test-{{.testName}}" script = "function (user, context, callback) { callback(null, user, context); }" +} +` + +const testAccRuleUpdate = ` +resource "auth0_rule" "my_rule" { + name = "acceptance-test-{{.testName}}" + script = "function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }" + order = 1 enabled = true } ` +const testAccRuleUpdateAgain = ` +resource "auth0_rule" "my_rule" { + name = "acceptance-test-{{.testName}}" + script = "function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }" + enabled = false +} +` + func TestRuleNameRegexp(t *testing.T) { vf := validation.StringMatch(ruleNameRegexp, "invalid name") diff --git a/test/data/recordings/TestAccRole.yaml b/test/data/recordings/TestAccRole.yaml index 43ba0375e..35d3cc315 100644 --- a/test/data/recordings/TestAccRole.yaml +++ b/test/data/recordings/TestAccRole.yaml @@ -6,21 +6,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 212 + content_length: 51 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]} + {"name":"The One - Acceptance Test - TestAccRole"} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles method: POST response: proto: HTTP/2.0 @@ -29,13 +29,13 @@ interactions: transfer_encoding: [ ] trailer: { } content_length: -1 - uncompressed: false - body: '{"id":"630dd3043238cfdda5d49d5a","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]}' + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":null}' headers: Content-Type: - application/json; charset=utf-8 - status: 201 Created - code: 201 + status: 200 OK + code: 200 duration: 1ms - id: 1 request: @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/630dd3043238cfdda5d49d5a + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 method: GET response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"630dd3043238cfdda5d49d5a","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":null}' headers: Content-Type: - application/json; charset=utf-8 @@ -78,22 +78,22 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 93 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"} + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles - method: POST + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' + body: '{"permissions":[],"start":0,"limit":50,"total":0}' headers: Content-Type: - application/json; charset=utf-8 @@ -114,22 +114,22 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 116 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"permissions":[{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"stop:bullets"}]} + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions - method: POST + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -137,13 +137,13 @@ interactions: transfer_encoding: [ ] trailer: { } content_length: -1 - uncompressed: false - body: '{}' + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":null}' headers: Content-Type: - application/json; charset=utf-8 - status: 201 Created - code: 201 + status: 200 OK + code: 200 duration: 1ms - id: 4 request: @@ -163,8 +163,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 method: GET response: proto: HTTP/2.0 @@ -174,7 +174,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' + body: '{"permissions":[],"start":0,"limit":50,"total":0}' headers: Content-Type: - application/json; charset=utf-8 @@ -199,8 +199,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions?include_totals=true&page=0&per_page=50 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 method: GET response: proto: HTTP/2.0 @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":null}' headers: Content-Type: - application/json; charset=utf-8 @@ -235,8 +235,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/630dd3043238cfdda5d49d5a + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 method: GET response: proto: HTTP/2.0 @@ -246,7 +246,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"630dd3043238cfdda5d49d5a","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]}' + body: '{"permissions":[],"start":0,"limit":50,"total":0}' headers: Content-Type: - application/json; charset=utf-8 @@ -254,6 +254,42 @@ interactions: code: 200 duration: 1ms - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 212 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 403 + uncompressed: false + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1ms + - id: 8 request: proto: HTTP/1.1 proto_major: 1 @@ -271,8 +307,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b method: GET response: proto: HTTP/2.0 @@ -282,34 +318,34 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 8 + - id: 9 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 5 + content_length: 93 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - null + {"name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions?include_totals=true&page=0&per_page=50 - method: GET + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: PATCH response: proto: HTTP/2.0 proto_major: 2 @@ -318,14 +354,50 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 9 + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"permissions":[{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"stop:bullets"}]} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1ms + - id: 11 request: proto: HTTP/1.1 proto_major: 1 @@ -343,8 +415,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/630dd3043238cfdda5d49d5a + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 method: GET response: proto: HTTP/2.0 @@ -354,14 +426,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"630dd3043238cfdda5d49d5a","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 10 + - id: 12 request: proto: HTTP/1.1 proto_major: 1 @@ -379,8 +451,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 method: GET response: proto: HTTP/2.0 @@ -390,14 +462,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' + body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 11 + - id: 13 request: proto: HTTP/1.1 proto_major: 1 @@ -415,8 +487,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions?include_totals=true&page=0&per_page=50 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b method: GET response: proto: HTTP/2.0 @@ -426,34 +498,34 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 12 + - id: 14 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 114 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"} + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj - method: PATCH + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -462,34 +534,34 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 13 + - id: 15 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 115 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"permissions":[{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"bring:peace"}]} + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions - method: POST + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -497,15 +569,15 @@ interactions: transfer_encoding: [ ] trailer: { } content_length: -1 - uncompressed: false - body: '{}' + uncompressed: true + body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' headers: Content-Type: - application/json; charset=utf-8 - status: 201 Created - code: 201 + status: 200 OK + code: 200 duration: 1ms - - id: 14 + - id: 16 request: proto: HTTP/1.1 proto_major: 1 @@ -523,8 +595,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b method: GET response: proto: HTTP/2.0 @@ -534,14 +606,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 15 + - id: 17 request: proto: HTTP/1.1 proto_major: 1 @@ -559,8 +631,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions?include_totals=true&page=0&per_page=50 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 method: GET response: proto: HTTP/2.0 @@ -570,14 +642,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"permissions":[{"permission_name":"bring:peace","description":"Bring peace","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"},{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":2}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 16 + - id: 18 request: proto: HTTP/1.1 proto_major: 1 @@ -595,8 +667,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/630dd3043238cfdda5d49d5a + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 method: GET response: proto: HTTP/2.0 @@ -606,14 +678,86 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"630dd3043238cfdda5d49d5a","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"stop:bullets","description":"Stop bullets"},{"value":"bring:peace","description":"Bring peace"}]}' + body: '{"permissions":[{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":1}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 17 + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 114 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 115 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"permissions":[{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"bring:peace"}]} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1ms + - id: 21 request: proto: HTTP/1.1 proto_major: 1 @@ -631,8 +775,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 method: GET response: proto: HTTP/2.0 @@ -642,14 +786,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rol_QQ7oVFC67INBR5Wj","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 18 + - id: 22 request: proto: HTTP/1.1 proto_major: 1 @@ -667,8 +811,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj/permissions?include_totals=true&page=0&per_page=50 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 method: GET response: proto: HTTP/2.0 @@ -685,27 +829,27 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 19 + - id: 23 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 3 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {} + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_QQ7oVFC67INBR5Wj - method: DELETE + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b + method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -714,45 +858,477 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{}' + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 20 + - id: 24 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 5 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + null form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/630dd3043238cfdda5d49d5a - method: DELETE + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET response: proto: HTTP/2.0 proto_major: 2 proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: 0 - uncompressed: false - body: "" + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' headers: Content-Type: - application/json; charset=utf-8 - status: 204 No Content - code: 204 + status: 200 OK + code: 200 + duration: 1ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"permissions":[{"permission_name":"bring:peace","description":"Bring peace","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"},{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":2}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":"The One who will bring peace - Acceptance Test"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"632da00717d703d775734d7b","name":"Role - Acceptance Test - TestAccRole","identifier":"https://TestAccRole.matrix.com/","allow_offline_access":false,"skip_consent_for_verifiable_first_party_clients":false,"token_lifetime":86400,"token_lifetime_for_web":7200,"signing_alg":"RS256","scopes":[{"value":"bring:peace","description":"Bring peace"},{"value":"stop:bullets","description":"Stop bullets"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"permissions":[{"permission_name":"bring:peace","description":"Bring peace","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"},{"permission_name":"stop:bullets","description":"Stop bullets","resource_server_name":"Role - Acceptance Test - TestAccRole","resource_server_identifier":"https://TestAccRole.matrix.com/"}],"start":0,"limit":50,"total":2}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/resource-servers/632da00717d703d775734d7b + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 1ms + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 69 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"The One - Acceptance Test - TestAccRole","description":" "} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":" "}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 31 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 213 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"permissions":[{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"stop:bullets"},{"resource_server_identifier":"https://TestAccRole.matrix.com/","permission_name":"bring:peace"}]} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 1ms + - id: 32 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":" "}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 33 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"permissions":[],"start":0,"limit":50,"total":0}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 34 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rol_E1hcU5HqIZP6NrP5","name":"The One - Acceptance Test - TestAccRole","description":" "}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 35 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5/permissions?include_totals=true&page=0&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"permissions":[],"start":0,"limit":50,"total":0}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 36 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 3 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/roles/rol_E1hcU5HqIZP6NrP5 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 duration: 1ms diff --git a/test/data/recordings/TestAccRule.yaml b/test/data/recordings/TestAccRule.yaml index 5358b8896..a47c0db85 100644 --- a/test/data/recordings/TestAccRule.yaml +++ b/test/data/recordings/TestAccRule.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 135 + content_length: 120 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"acceptance-test-TestAccRule","script":"function (user, context, callback) { callback(null, user, context); }","enabled":true} + {"name":"acceptance-test-TestAccRule","script":"function (user, context, callback) { callback(null, user, context); }"} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules method: POST response: @@ -28,9 +28,9 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 196 uncompressed: false - body: '{"id":"rul_1yQAfKAs8K06Yyuo","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' headers: Content-Type: - application/json; charset=utf-8 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_1yQAfKAs8K06Yyuo + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ method: GET response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rul_1yQAfKAs8K06Yyuo","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' headers: Content-Type: - application/json; charset=utf-8 @@ -91,8 +91,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_1yQAfKAs8K06Yyuo + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ method: GET response: proto: HTTP/2.0 @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"rul_1yQAfKAs8K06Yyuo","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' headers: Content-Type: - application/json; charset=utf-8 @@ -110,6 +110,294 @@ interactions: code: 200 duration: 1ms - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 169 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"acceptance-test-TestAccRule","script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","order":1,"enabled":true} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":true,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 160 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"acceptance-test-TestAccRule","script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","enabled":false} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":false,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":false,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"rul_MZb3AutLa4QMC8iZ","enabled":false,"script":"function (user, context, callback) { console.log(\"here!\"); callback(null, user, context); }","name":"acceptance-test-TestAccRule","order":1,"stage":"login_success"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 11 request: proto: HTTP/1.1 proto_major: 1 @@ -126,8 +414,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_1yQAfKAs8K06Yyuo + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules/rul_MZb3AutLa4QMC8iZ method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccRuleConfig.yaml b/test/data/recordings/TestAccRuleConfig.yaml index 6baf81db3..9b820cb63 100644 --- a/test/data/recordings/TestAccRuleConfig.yaml +++ b/test/data/recordings/TestAccRuleConfig.yaml @@ -19,7 +19,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_TestAccRuleConfig method: PUT response: @@ -55,7 +55,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -91,7 +91,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -127,7 +127,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -138,7 +138,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -163,7 +163,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_TestAccRuleConfig method: PUT response: @@ -199,7 +199,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -235,7 +235,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -246,7 +246,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -271,7 +271,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -282,7 +282,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -306,7 +306,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_TestAccRuleConfig method: DELETE response: @@ -342,7 +342,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_key_TestAccRuleConfig method: PUT response: @@ -378,7 +378,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -389,7 +389,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_key_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_key_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -414,7 +414,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 method: GET response: @@ -425,7 +425,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '[{"key":"acc_test_key_TestAccRuleConfig"}]' + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_key_TestAccRuleConfig"}]' headers: Content-Type: - application/json; charset=utf-8 @@ -433,6 +433,150 @@ interactions: code: 200 duration: 1ms - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_key_TestAccRuleConfig"}]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 13 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"value":""} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_key_TestAccRuleConfig + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"key":"acc_test_key_TestAccRuleConfig","value":""}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_key_TestAccRuleConfig"}]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs?include_totals=true&per_page=50 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '[{"key":"MY_RULES_CONFIG_KEY"},{"key":"MY_RULES_CONFIG_KEY_2"},{"key":"SLACK_HOOK_URL"},{"key":"the-key"},{"key":"acc_test_key_TestAccRuleConfig"}]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 16 request: proto: HTTP/1.1 proto_major: 1 @@ -449,7 +593,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/rules-configs/acc_test_key_TestAccRuleConfig method: DELETE response: From 460b839dbab2fb26fd2fd164034dba769a6f8ce8 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:17:37 +0200 Subject: [PATCH 2/2] [15/X] Refactor log stream resource to allow for empty fields (#350) * Refactor log stream resource to allow for empty fields * [16/X] Refactor prompts resource to allow for empty fields (#351) * Refactor prompts resource to allow for empty fields * [17/X] Refactor hooks resource to allow for empty fields (#352) Refactor hooks resource to allow for empty fields * Fix small issue with log stream filters --- internal/provider/resource_auth0_hook.go | 41 +- internal/provider/resource_auth0_hook_test.go | 35 ++ .../provider/resource_auth0_log_stream.go | 161 +++--- .../resource_auth0_log_stream_test.go | 53 +- internal/provider/resource_auth0_prompt.go | 23 +- .../provider/resource_auth0_prompt_test.go | 22 + test/data/recordings/TestAccHook.yaml | 264 +++++++++- test/data/recordings/TestAccHookSecrets.yaml | 470 +++++++++++++++--- .../data/recordings/TestAccLogStreamHTTP.yaml | 282 ++++++++--- .../data/recordings/TestAccLogStreamSumo.yaml | 220 ++++++-- test/data/recordings/TestAccPrompt.yaml | 258 +++++++++- 11 files changed, 1513 insertions(+), 316 deletions(-) diff --git a/internal/provider/resource_auth0_hook.go b/internal/provider/resource_auth0_hook.go index 74482c70d..0909742e6 100644 --- a/internal/provider/resource_auth0_hook.go +++ b/internal/provider/resource_auth0_hook.go @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) func newHook() *schema.Resource { @@ -79,8 +81,9 @@ func newHook() *schema.Resource { } func createHook(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - hook := expandHook(d) api := m.(*management.Management) + + hook := expandHook(d) if err := api.Hook.Create(hook); err != nil { return diag.FromErr(err) } @@ -181,42 +184,36 @@ func checkForUntrackedHookSecrets(ctx context.Context, d *schema.ResourceData, m func upsertHookSecrets(ctx context.Context, d *schema.ResourceData, m interface{}) error { if d.IsNewResource() || d.HasChange("secrets") { - hookSecrets := expandHookSecrets(d) api := m.(*management.Management) - return api.Hook.ReplaceSecrets(d.Id(), hookSecrets) + + hookSecrets := value.MapOfStrings(d.GetRawConfig().GetAttr("secrets")) + if hookSecrets == nil { + return nil + } + + return api.Hook.ReplaceSecrets(d.Id(), *hookSecrets) } return nil } func expandHook(d *schema.ResourceData) *management.Hook { + config := d.GetRawConfig() + hook := &management.Hook{ - Name: String(d, "name"), - Script: String(d, "script"), - TriggerID: String(d, "trigger_id", IsNewResource()), - Enabled: Bool(d, "enabled"), + Name: value.String(config.GetAttr("name")), + Script: value.String(config.GetAttr("script")), + Enabled: value.Bool(config.GetAttr("enabled")), + Dependencies: value.MapOfStrings(config.GetAttr("dependencies")), } - if deps := Map(d, "dependencies"); deps != nil { - hook.Dependencies = &deps + if d.IsNewResource() { + hook.TriggerID = value.String(config.GetAttr("trigger_id")) } return hook } -func expandHookSecrets(d *schema.ResourceData) management.HookSecrets { - hookSecrets := management.HookSecrets{} - secrets := Map(d, "secrets") - - for key, value := range secrets { - if strVal, ok := value.(string); ok { - hookSecrets[key] = strVal - } - } - - return hookSecrets -} - func validateHookName() schema.SchemaValidateDiagFunc { hookNameValidation := validation.StringMatch( regexp.MustCompile(`^[^\s-][\w -]+[^\s-]$`), diff --git a/internal/provider/resource_auth0_hook_test.go b/internal/provider/resource_auth0_hook_test.go index 15efafa07..170914cfd 100644 --- a/internal/provider/resource_auth0_hook_test.go +++ b/internal/provider/resource_auth0_hook_test.go @@ -17,6 +17,17 @@ func TestAccHook(t *testing.T) { resource.Test(t, resource.TestCase{ ProviderFactories: testProviders(httpRecorder), Steps: []resource.TestStep{ + { + Config: testAccHookEmpty, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_hook.my_hook", "name", "pre-user-reg-hook"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "script", "function (user, context, callback) { callback(null, { user }); }"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "trigger_id", "pre-user-registration"), + resource.TestCheckResourceAttrSet("auth0_hook.my_hook", "enabled"), + resource.TestCheckNoResourceAttr("auth0_hook.my_hook", "secrets"), + resource.TestCheckNoResourceAttr("auth0_hook.my_hook", "dependencies"), + ), + }, { Config: fmt.Sprintf(testAccHookCreate, ""), Check: resource.ComposeTestCheckFunc( @@ -30,6 +41,14 @@ func TestAccHook(t *testing.T) { }) } +const testAccHookEmpty = ` +resource "auth0_hook" "my_hook" { + name = "pre-user-reg-hook" + script = "function (user, context, callback) { callback(null, { user }); }" + trigger_id = "pre-user-registration" +} +` + const testAccHookCreate = ` resource "auth0_hook" "my_hook" { name = "pre-user-reg-hook" @@ -81,6 +100,17 @@ func TestAccHookSecrets(t *testing.T) { resource.TestCheckNoResourceAttr("auth0_hook.my_hook", "secrets.bar"), ), }, + { + Config: fmt.Sprintf(testAccHookCreate, testAccHookSecretsEmpty), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_hook.my_hook", "name", "pre-user-reg-hook"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "script", "function (user, context, callback) { callback(null, { user }); }"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "trigger_id", "pre-user-registration"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "enabled", "true"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "secrets.%", "0"), + resource.TestCheckResourceAttr("auth0_hook.my_hook", "dependencies.%", "0"), + ), + }, }, }) } @@ -113,6 +143,11 @@ const testAccHookSecretsUpdateAndRemoval = ` } ` +const testAccHookSecretsEmpty = ` + dependencies = {} + secrets = {} +` + func TestHookNameRegexp(t *testing.T) { for givenHookName, expectedError := range map[string]bool{ "my-hook-1": false, diff --git a/internal/provider/resource_auth0_log_stream.go b/internal/provider/resource_auth0_log_stream.go index e4e89390d..38310e849 100644 --- a/internal/provider/resource_auth0_log_stream.go +++ b/internal/provider/resource_auth0_log_stream.go @@ -6,10 +6,13 @@ import ( "net/http" "github.com/auth0/go-auth0/management" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) func newLogStream() *schema.Resource { @@ -223,21 +226,21 @@ func newLogStream() *schema.Resource { } func createLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - logStream := expandLogStream(d) - api := m.(*management.Management) + + logStream := expandLogStream(d) if err := api.LogStream.Create(logStream); err != nil { return diag.FromErr(err) } d.SetId(logStream.GetID()) - // The Management API only allows updating a log stream's status. Therefore, - // if the status field was present in the configuration, we perform an - // additional operation to modify it. - status := String(d, "status") - if status != nil && status != logStream.Status { - if err := api.LogStream.Update(logStream.GetID(), &management.LogStream{Status: status}); err != nil { + // The Management API only allows updating a log stream's status. + // Therefore, if the status field was present in the configuration, + // we perform an additional operation to modify it. + status := d.Get("status").(string) + if status != "" && status != logStream.GetStatus() { + if err := api.LogStream.Update(logStream.GetID(), &management.LogStream{Status: &status}); err != nil { return diag.FromErr(err) } } @@ -247,21 +250,20 @@ func createLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) func readLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := m.(*management.Management) + logStream, err := api.LogStream.Read(d.Id()) if err != nil { - if mErr, ok := err.(management.Error); ok { - if mErr.Status() == http.StatusNotFound { - d.SetId("") - return nil - } + if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound { + d.SetId("") + return nil } return diag.FromErr(err) } result := multierror.Append( - d.Set("name", logStream.Name), - d.Set("status", logStream.Status), - d.Set("type", logStream.Type), + d.Set("name", logStream.GetName()), + d.Set("status", logStream.GetStatus()), + d.Set("type", logStream.GetType()), d.Set("filters", logStream.Filters), d.Set("sink", flattenLogStreamSink(logStream.Sink)), ) @@ -270,8 +272,9 @@ func readLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) d } func updateLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - logStream := expandLogStream(d) api := m.(*management.Management) + + logStream := expandLogStream(d) if err := api.LogStream.Update(d.Id(), logStream); err != nil { return diag.FromErr(err) } @@ -281,15 +284,15 @@ func updateLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) func deleteLogStream(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := m.(*management.Management) + if err := api.LogStream.Delete(d.Id()); err != nil { - if mErr, ok := err.(management.Error); ok { - if mErr.Status() == http.StatusNotFound { - d.SetId("") - return nil - } + if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound { + d.SetId("") + return nil } } + d.SetId("") return nil } @@ -363,86 +366,120 @@ func flattenLogStreamSinkSumo(o *management.LogStreamSinkSumo) interface{} { } } -func expandLogStream(d ResourceData) *management.LogStream { +func expandLogStream(d *schema.ResourceData) *management.LogStream { + config := d.GetRawConfig() + logStream := &management.LogStream{ - Name: String(d, "name"), - Type: String(d, "type", IsNewResource()), - Status: String(d, "status", Not(IsNewResource())), - Filters: List(d, "filters").List(), + Name: value.String(config.GetAttr("name")), } - streamType := d.Get("type").(string) - List(d, "sink").Elem(func(d ResourceData) { - switch streamType { + logStreamType := value.String(config.GetAttr("type")) + if d.IsNewResource() { + logStream.Type = logStreamType + } + + if !d.IsNewResource() { + logStream.Status = value.String(config.GetAttr("status")) + } + + filtersConfig := config.GetAttr("filters") + if !filtersConfig.IsNull() { + filters := make([]map[string]string, 0) + + filtersConfig.ForEachElement(func(_ cty.Value, filter cty.Value) (stop bool) { + filters = append(filters, *value.MapOfStrings(filter)) + return stop + }) + + logStream.Filters = &filters + } + + config.GetAttr("sink").ForEachElement(func(_ cty.Value, sink cty.Value) (stop bool) { + switch *logStreamType { case management.LogStreamTypeAmazonEventBridge: // LogStreamTypeAmazonEventBridge cannot be updated. if d.IsNewResource() { - logStream.Sink = expandLogStreamSinkAmazonEventBridge(d) + logStream.Sink = expandLogStreamSinkAmazonEventBridge(sink) } case management.LogStreamTypeAzureEventGrid: // LogStreamTypeAzureEventGrid cannot be updated. if d.IsNewResource() { - logStream.Sink = expandLogStreamSinkAzureEventGrid(d) + logStream.Sink = expandLogStreamSinkAzureEventGrid(sink) } case management.LogStreamTypeHTTP: - logStream.Sink = expandLogStreamSinkHTTP(d) + logStream.Sink = expandLogStreamSinkHTTP(sink) case management.LogStreamTypeDatadog: - logStream.Sink = expandLogStreamSinkDatadog(d) + logStream.Sink = expandLogStreamSinkDatadog(sink) case management.LogStreamTypeSplunk: - logStream.Sink = expandLogStreamSinkSplunk(d) + logStream.Sink = expandLogStreamSinkSplunk(sink) case management.LogStreamTypeSumo: - logStream.Sink = expandLogStreamSinkSumo(d) + logStream.Sink = expandLogStreamSinkSumo(sink) default: - log.Printf("[WARN]: Unsupported log stream sink %s", streamType) + log.Printf("[WARN]: Unsupported log stream sink %s", logStream.GetType()) log.Printf("[WARN]: Raise an issue with the auth0 provider in order to support it:") log.Printf("[WARN]: https://github.com/auth0/terraform-provider-auth0/issues/new") } + + return stop }) return logStream } -func expandLogStreamSinkAmazonEventBridge(d ResourceData) *management.LogStreamSinkAmazonEventBridge { +func expandLogStreamSinkAmazonEventBridge(config cty.Value) *management.LogStreamSinkAmazonEventBridge { return &management.LogStreamSinkAmazonEventBridge{ - AccountID: String(d, "aws_account_id"), - Region: String(d, "aws_region"), + AccountID: value.String(config.GetAttr("aws_account_id")), + Region: value.String(config.GetAttr("aws_region")), } } -func expandLogStreamSinkAzureEventGrid(d ResourceData) *management.LogStreamSinkAzureEventGrid { +func expandLogStreamSinkAzureEventGrid(config cty.Value) *management.LogStreamSinkAzureEventGrid { return &management.LogStreamSinkAzureEventGrid{ - SubscriptionID: String(d, "azure_subscription_id"), - ResourceGroup: String(d, "azure_resource_group"), - Region: String(d, "azure_region"), - PartnerTopic: String(d, "azure_partner_topic"), + SubscriptionID: value.String(config.GetAttr("azure_subscription_id")), + ResourceGroup: value.String(config.GetAttr("azure_resource_group")), + Region: value.String(config.GetAttr("azure_region")), + PartnerTopic: value.String(config.GetAttr("azure_partner_topic")), } } -func expandLogStreamSinkHTTP(d ResourceData) *management.LogStreamSinkHTTP { - return &management.LogStreamSinkHTTP{ - ContentFormat: String(d, "http_content_format"), - ContentType: String(d, "http_content_type"), - Endpoint: String(d, "http_endpoint"), - Authorization: String(d, "http_authorization"), - CustomHeaders: List(d, "http_custom_headers").List(), +func expandLogStreamSinkHTTP(config cty.Value) *management.LogStreamSinkHTTP { + httpSink := &management.LogStreamSinkHTTP{ + ContentFormat: value.String(config.GetAttr("http_content_format")), + ContentType: value.String(config.GetAttr("http_content_type")), + Endpoint: value.String(config.GetAttr("http_endpoint")), + Authorization: value.String(config.GetAttr("http_authorization")), + } + + customHeadersConfig := config.GetAttr("http_custom_headers") + if !customHeadersConfig.IsNull() { + customHeaders := make([]map[string]string, 0) + + customHeadersConfig.ForEachElement(func(_ cty.Value, httpHeader cty.Value) (stop bool) { + customHeaders = append(customHeaders, *value.MapOfStrings(httpHeader)) + return stop + }) + + httpSink.CustomHeaders = &customHeaders } + + return httpSink } -func expandLogStreamSinkDatadog(d ResourceData) *management.LogStreamSinkDatadog { +func expandLogStreamSinkDatadog(config cty.Value) *management.LogStreamSinkDatadog { return &management.LogStreamSinkDatadog{ - Region: String(d, "datadog_region"), - APIKey: String(d, "datadog_api_key"), + Region: value.String(config.GetAttr("datadog_region")), + APIKey: value.String(config.GetAttr("datadog_api_key")), } } -func expandLogStreamSinkSplunk(d ResourceData) *management.LogStreamSinkSplunk { +func expandLogStreamSinkSplunk(config cty.Value) *management.LogStreamSinkSplunk { return &management.LogStreamSinkSplunk{ - Domain: String(d, "splunk_domain"), - Token: String(d, "splunk_token"), - Port: String(d, "splunk_port"), - Secure: Bool(d, "splunk_secure"), + Domain: value.String(config.GetAttr("splunk_domain")), + Token: value.String(config.GetAttr("splunk_token")), + Port: value.String(config.GetAttr("splunk_port")), + Secure: value.Bool(config.GetAttr("splunk_secure")), } } -func expandLogStreamSinkSumo(d ResourceData) *management.LogStreamSinkSumo { +func expandLogStreamSinkSumo(config cty.Value) *management.LogStreamSinkSumo { return &management.LogStreamSinkSumo{ - SourceAddress: String(d, "sumo_source_address"), + SourceAddress: value.String(config.GetAttr("sumo_source_address")), } } diff --git a/internal/provider/resource_auth0_log_stream_test.go b/internal/provider/resource_auth0_log_stream_test.go index b50381219..a54a18285 100644 --- a/internal/provider/resource_auth0_log_stream_test.go +++ b/internal/provider/resource_auth0_log_stream_test.go @@ -115,6 +115,18 @@ func TestAccLogStreamHTTP(t *testing.T) { resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_custom_headers.1.value", "foo"), ), }, + { + Config: template.ParseTestName(testAccLogStreamHTTPConfigEmptyCustomHTTPHeaders, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "name", fmt.Sprintf("Acceptance-Test-LogStream-http-new-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "type", "http"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_endpoint", "https://example.com/logs"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_content_type", "application/json"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_content_format", "JSONLINES"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_authorization", "AKIAXXXXXXXXXXXXXXXX"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.http_custom_headers.#", "0"), + ), + }, }, }) } @@ -195,6 +207,20 @@ resource "auth0_log_stream" "my_log_stream" { } ` +const testAccLogStreamHTTPConfigEmptyCustomHTTPHeaders = ` +resource "auth0_log_stream" "my_log_stream" { + name = "Acceptance-Test-LogStream-http-new-{{.testName}}" + type = "http" + sink { + http_endpoint = "https://example.com/logs" + http_content_type = "application/json" + http_content_format = "JSONLINES" + http_authorization = "AKIAXXXXXXXXXXXXXXXX" + http_custom_headers = [] + } +} +` + func TestAccLogStreamEventBridge(t *testing.T) { httpRecorder := recorder.New(t) @@ -511,6 +537,15 @@ func TestAccLogStreamSumo(t *testing.T) { resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.sumo_source_address", "prod.sumo.com"), ), }, + { + Config: template.ParseTestName(logStreamSumoConfigUpdateWithEmptyFilters, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "name", fmt.Sprintf("Acceptance-Test-LogStream-sumo-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "type", "sumo"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "filters.#", "0"), + resource.TestCheckResourceAttr("auth0_log_stream.my_log_stream", "sink.0.sumo_source_address", "prod.sumo.com"), + ), + }, }, }) } @@ -533,10 +568,12 @@ resource "auth0_log_stream" "my_log_stream" { } } ` + const logStreamSumoConfigUpdateWithFilters = ` resource "auth0_log_stream" "my_log_stream" { name = "Acceptance-Test-LogStream-sumo-{{.testName}}" type = "sumo" + filters = [ { type = "category" @@ -547,8 +584,22 @@ resource "auth0_log_stream" "my_log_stream" { name = "auth.signup.fail" } ] + sink { - sumo_source_address = "prod.sumo.com" + sumo_source_address = "prod.sumo.com" + } +} +` + +const logStreamSumoConfigUpdateWithEmptyFilters = ` +resource "auth0_log_stream" "my_log_stream" { + name = "Acceptance-Test-LogStream-sumo-{{.testName}}" + type = "sumo" + + filters = [ ] + + sink { + sumo_source_address = "prod.sumo.com" } } ` diff --git a/internal/provider/resource_auth0_prompt.go b/internal/provider/resource_auth0_prompt.go index 9be4c42b4..9306fbd63 100644 --- a/internal/provider/resource_auth0_prompt.go +++ b/internal/provider/resource_auth0_prompt.go @@ -4,11 +4,14 @@ import ( "context" "github.com/auth0/go-auth0/management" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/auth0/terraform-provider-auth0/internal/value" ) func newPrompt() *schema.Resource { @@ -26,6 +29,7 @@ func newPrompt() *schema.Resource { "universal_login_experience": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice([]string{ "new", "classic", }, false), @@ -40,6 +44,7 @@ func newPrompt() *schema.Resource { "webauthn_platform_first_factor": { Type: schema.TypeBool, Optional: true, + Computed: true, Description: "Determines if the login screen uses identifier and biometrics first.", }, }, @@ -71,7 +76,7 @@ func readPrompt(ctx context.Context, d *schema.ResourceData, m interface{}) diag func updatePrompt(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := m.(*management.Management) - prompt := expandPrompt(d) + prompt := expandPrompt(d.GetRawConfig()) if err := api.Prompt.Update(prompt); err != nil { return diag.FromErr(err) } @@ -84,10 +89,16 @@ func deletePrompt(ctx context.Context, d *schema.ResourceData, m interface{}) di return nil } -func expandPrompt(d *schema.ResourceData) *management.Prompt { - return &management.Prompt{ - UniversalLoginExperience: d.Get("universal_login_experience").(string), - IdentifierFirst: Bool(d, "identifier_first"), - WebAuthnPlatformFirstFactor: Bool(d, "webauthn_platform_first_factor"), +func expandPrompt(d cty.Value) *management.Prompt { + prompt := management.Prompt{ + IdentifierFirst: value.Bool(d.GetAttr("identifier_first")), + WebAuthnPlatformFirstFactor: value.Bool(d.GetAttr("webauthn_platform_first_factor")), + } + + ule := d.GetAttr("universal_login_experience") + if !ule.IsNull() { + prompt.UniversalLoginExperience = ule.AsString() } + + return &prompt } diff --git a/internal/provider/resource_auth0_prompt_test.go b/internal/provider/resource_auth0_prompt_test.go index 800075627..13b214ad5 100644 --- a/internal/provider/resource_auth0_prompt_test.go +++ b/internal/provider/resource_auth0_prompt_test.go @@ -8,6 +8,12 @@ import ( "github.com/auth0/terraform-provider-auth0/internal/recorder" ) +const testAccPromptEmpty = ` +resource "auth0_prompt" "prompt" { + identifier_first = false # Required by API to include at least one property +} +` + const testAccPromptCreate = ` resource "auth0_prompt" "prompt" { universal_login_experience = "classic" @@ -38,6 +44,14 @@ func TestAccPrompt(t *testing.T) { resource.Test(t, resource.TestCase{ ProviderFactories: testProviders(httpRecorder), Steps: []resource.TestStep{ + { + Config: testAccPromptEmpty, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("auth0_prompt.prompt", "universal_login_experience"), + resource.TestCheckResourceAttr("auth0_prompt.prompt", "identifier_first", "false"), + resource.TestCheckResourceAttrSet("auth0_prompt.prompt", "webauthn_platform_first_factor"), + ), + }, { Config: testAccPromptCreate, Check: resource.ComposeTestCheckFunc( @@ -62,6 +76,14 @@ func TestAccPrompt(t *testing.T) { resource.TestCheckResourceAttr("auth0_prompt.prompt", "webauthn_platform_first_factor", "true"), ), }, + { + Config: testAccPromptEmpty, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_prompt.prompt", "universal_login_experience", "new"), + resource.TestCheckResourceAttr("auth0_prompt.prompt", "identifier_first", "false"), + resource.TestCheckResourceAttr("auth0_prompt.prompt", "webauthn_platform_first_factor", "true"), + ), + }, }, }) } diff --git a/test/data/recordings/TestAccHook.yaml b/test/data/recordings/TestAccHook.yaml index 4d2b59d6e..cc76a0928 100644 --- a/test/data/recordings/TestAccHook.yaml +++ b/test/data/recordings/TestAccHook.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 156 + content_length: 141 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","triggerId":"pre-user-registration","enabled":true} + {"name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","triggerId":"pre-user-registration"} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks method: POST response: @@ -28,9 +28,9 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 208 uncompressed: false - body: '{"id":"01GBPZWEFDT9RFR6PN6939RZZE","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"triggerId":"pre-user-registration","enabled":true}' + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"triggerId":"pre-user-registration","enabled":false}' headers: Content-Type: - application/json; charset=utf-8 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: GET response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{}' + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":false,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -91,8 +91,44 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: GET response: proto: HTTP/2.0 @@ -102,14 +138,14 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWEFDT9RFR6PN6939RZZE","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":false,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 3 + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -127,8 +163,44 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: GET response: proto: HTTP/2.0 @@ -138,6 +210,42 @@ interactions: trailer: { } content_length: -1 uncompressed: true + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":false,"triggerId":"pre-user-registration"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false body: '{}' headers: Content-Type: @@ -145,7 +253,43 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 4 + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 120 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","enabled":true} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"triggerId":"pre-user-registration","enabled":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 8 request: proto: HTTP/1.1 proto_major: 1 @@ -163,8 +307,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: GET response: proto: HTTP/2.0 @@ -174,14 +318,50 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWEFDT9RFR6PN6939RZZE","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 duration: 1ms - - id: 5 + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 10 request: proto: HTTP/1.1 proto_major: 1 @@ -199,8 +379,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: GET response: proto: HTTP/2.0 @@ -210,6 +390,42 @@ interactions: trailer: { } content_length: -1 uncompressed: true + body: '{"id":"01GEPVQEH9SX3RSTYY561TR92N","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false body: '{}' headers: Content-Type: @@ -217,7 +433,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 6 + - id: 12 request: proto: HTTP/1.1 proto_major: 1 @@ -234,8 +450,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWEFDT9RFR6PN6939RZZE + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQEH9SX3RSTYY561TR92N method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccHookSecrets.yaml b/test/data/recordings/TestAccHookSecrets.yaml index c45657b22..7e5a507ad 100644 --- a/test/data/recordings/TestAccHookSecrets.yaml +++ b/test/data/recordings/TestAccHookSecrets.yaml @@ -19,7 +19,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks method: POST response: @@ -28,9 +28,9 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 223 uncompressed: false - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' headers: Content-Type: - application/json; charset=utf-8 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -64,8 +64,8 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 - uncompressed: true + content_length: 2 + uncompressed: false body: '{}' headers: Content-Type: @@ -91,8 +91,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: POST response: proto: HTTP/2.0 @@ -100,7 +100,7 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 2 uncompressed: false body: '{}' headers: @@ -127,8 +127,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -138,7 +138,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -163,8 +163,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -199,8 +199,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -235,8 +235,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -271,8 +271,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -282,7 +282,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -307,8 +307,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -343,8 +343,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: PATCH response: proto: HTTP/2.0 @@ -354,7 +354,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' headers: Content-Type: - application/json; charset=utf-8 @@ -379,8 +379,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -415,8 +415,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: POST response: proto: HTTP/2.0 @@ -424,7 +424,7 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 2 uncompressed: false body: '{}' headers: @@ -451,8 +451,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: PATCH response: proto: HTTP/2.0 @@ -460,7 +460,7 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 2 uncompressed: false body: '{}' headers: @@ -487,8 +487,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -498,7 +498,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -523,8 +523,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -559,8 +559,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -570,7 +570,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -595,8 +595,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -631,8 +631,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -642,7 +642,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -667,8 +667,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -703,8 +703,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: PATCH response: proto: HTTP/2.0 @@ -714,7 +714,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"triggerId":"pre-user-registration","enabled":true}' headers: Content-Type: - application/json; charset=utf-8 @@ -739,8 +739,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -775,8 +775,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: PATCH response: proto: HTTP/2.0 @@ -784,7 +784,7 @@ interactions: proto_minor: 0 transfer_encoding: [ ] trailer: { } - content_length: -1 + content_length: 2 uncompressed: false body: '{}' headers: @@ -811,8 +811,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: DELETE response: proto: HTTP/2.0 @@ -847,8 +847,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -858,7 +858,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -883,8 +883,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -919,8 +919,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: GET response: proto: HTTP/2.0 @@ -930,7 +930,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"01GBPZWHNHPCQJB116XTN9AX84","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' headers: Content-Type: - application/json; charset=utf-8 @@ -955,8 +955,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84/secrets + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets method: GET response: proto: HTTP/2.0 @@ -974,6 +974,330 @@ interactions: code: 200 duration: 1ms - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{"auth0":"2.30.0"},"enabled":true,"triggerId":"pre-user-registration"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"foo":"_VALUE_NOT_SHOWN_"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 138 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"triggerId":"pre-user-registration","enabled":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"foo":"_VALUE_NOT_SHOWN_"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 31 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 8 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + ["foo"] + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 1ms + - id: 32 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 33 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 34 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"01GEPVQNVSHW1ZVB7WVPRYKX18","name":"pre-user-reg-hook","script":"function (user, context, callback) { callback(null, { user }); }","dependencies":{},"enabled":true,"triggerId":"pre-user-registration"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 35 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18/secrets + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 2 + uncompressed: false + body: '{}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 36 request: proto: HTTP/1.1 proto_major: 1 @@ -990,8 +1314,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GBPZWHNHPCQJB116XTN9AX84 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/hooks/01GEPVQNVSHW1ZVB7WVPRYKX18 method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccLogStreamHTTP.yaml b/test/data/recordings/TestAccLogStreamHTTP.yaml index 48960ecf7..a3487fcb7 100644 --- a/test/data/recordings/TestAccLogStreamHTTP.yaml +++ b/test/data/recordings/TestAccLogStreamHTTP.yaml @@ -19,7 +19,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams method: POST response: @@ -30,7 +30,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"active","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"active","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: PATCH response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -91,8 +91,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -127,8 +127,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -138,7 +138,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -163,8 +163,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -174,7 +174,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -186,21 +186,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 267 + content_length: 249 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","status":"paused","sink":{"httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} + {"name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","sink":{"httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: PATCH response: proto: HTTP/2.0 @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -235,8 +235,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -246,7 +246,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -271,8 +271,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -282,7 +282,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -307,8 +307,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -318,7 +318,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONARRAY","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -330,21 +330,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 268 + content_length: 250 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","status":"paused","sink":{"httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} + {"name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","sink":{"httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: PATCH response: proto: HTTP/2.0 @@ -354,7 +354,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -379,8 +379,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -390,7 +390,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -415,8 +415,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -426,7 +426,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -451,8 +451,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -462,7 +462,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONOBJECT","httpContentType":"application/json; charset=utf-8","httpEndpoint":"https://example.com/webhook/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -474,21 +474,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 248 + content_length: 230 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","status":"paused","sink":{"httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} + {"name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","sink":{"httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX"}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: PATCH response: proto: HTTP/2.0 @@ -498,7 +498,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -523,8 +523,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -534,7 +534,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -559,8 +559,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -570,7 +570,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -595,8 +595,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -606,7 +606,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -618,21 +618,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 332 + content_length: 314 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","status":"paused","sink":{"httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}} + {"name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","sink":{"httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: PATCH response: proto: HTTP/2.0 @@ -642,7 +642,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' headers: Content-Type: - application/json; charset=utf-8 @@ -667,8 +667,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -678,7 +678,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' headers: Content-Type: - application/json; charset=utf-8 @@ -703,8 +703,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: GET response: proto: HTTP/2.0 @@ -714,7 +714,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010031","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' headers: Content-Type: - application/json; charset=utf-8 @@ -722,6 +722,150 @@ interactions: code: 200 duration: 1ms - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[{"header":"foo","value":"bar"},{"header":"bar","value":"foo"}]}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 253 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","sink":{"httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpCustomHeaders":[]}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[]}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[]}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000007100","name":"Acceptance-Test-LogStream-http-new-TestAccLogStreamHTTP","type":"http","status":"paused","sink":{"httpAuthorization":"AKIAXXXXXXXXXXXXXXXX","httpContentFormat":"JSONLINES","httpContentType":"application/json","httpEndpoint":"https://example.com/logs","httpCustomHeaders":[]}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 24 request: proto: HTTP/1.1 proto_major: 1 @@ -738,8 +882,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010031 + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000007100 method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccLogStreamSumo.yaml b/test/data/recordings/TestAccLogStreamSumo.yaml index f4127d46f..e3d134d0c 100644 --- a/test/data/recordings/TestAccLogStreamSumo.yaml +++ b/test/data/recordings/TestAccLogStreamSumo.yaml @@ -19,7 +19,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/0.11.0 url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams method: POST response: @@ -30,7 +30,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -55,8 +55,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -91,8 +91,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -127,8 +127,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -138,7 +138,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"demo.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -150,21 +150,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 126 + content_length: 108 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}} + {"name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","sink":{"sumoSourceAddress":"prod.sumo.com"}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: PATCH response: proto: HTTP/2.0 @@ -174,7 +174,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -199,8 +199,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -235,8 +235,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -246,7 +246,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -271,8 +271,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -282,7 +282,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' headers: Content-Type: - application/json; charset=utf-8 @@ -294,21 +294,21 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 229 + content_length: 211 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","status":"active","filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}],"sink":{"sumoSourceAddress":"prod.sumo.com"}} + {"name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}],"sink":{"sumoSourceAddress":"prod.sumo.com"}} form: { } headers: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: PATCH response: proto: HTTP/2.0 @@ -318,7 +318,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' headers: Content-Type: - application/json; charset=utf-8 @@ -343,8 +343,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -354,7 +354,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' headers: Content-Type: - application/json; charset=utf-8 @@ -379,8 +379,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: GET response: proto: HTTP/2.0 @@ -390,7 +390,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"id":"lst_0000000000010036","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' headers: Content-Type: - application/json; charset=utf-8 @@ -398,6 +398,150 @@ interactions: code: 200 duration: 1ms - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"},"filters":[{"name":"auth.login.fail","type":"category"},{"name":"auth.signup.fail","type":"category"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 121 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","filters":[],"sink":{"sumoSourceAddress":"prod.sumo.com"}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"id":"lst_0000000000010354","name":"Acceptance-Test-LogStream-sumo-TestAccLogStreamSumo","type":"sumo","status":"active","sink":{"sumoSourceAddress":"prod.sumo.com"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 15 request: proto: HTTP/1.1 proto_major: 1 @@ -414,8 +558,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010036 + - Go-Auth0-SDK/0.11.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/log-streams/lst_0000000000010354 method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccPrompt.yaml b/test/data/recordings/TestAccPrompt.yaml index a20264c13..25c448d13 100644 --- a/test/data/recordings/TestAccPrompt.yaml +++ b/test/data/recordings/TestAccPrompt.yaml @@ -2,6 +2,150 @@ version: 2 interactions: - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 27 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"identifier_first":false} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -19,7 +163,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: PATCH response: @@ -37,7 +181,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 1 + - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -55,7 +199,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -73,7 +217,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 2 + - id: 6 request: proto: HTTP/1.1 proto_major: 1 @@ -91,7 +235,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -109,7 +253,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 3 + - id: 7 request: proto: HTTP/1.1 proto_major: 1 @@ -127,7 +271,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -145,7 +289,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 4 + - id: 8 request: proto: HTTP/1.1 proto_major: 1 @@ -163,7 +307,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: PATCH response: @@ -181,7 +325,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 5 + - id: 9 request: proto: HTTP/1.1 proto_major: 1 @@ -199,7 +343,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -217,7 +361,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 6 + - id: 10 request: proto: HTTP/1.1 proto_major: 1 @@ -235,7 +379,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -253,7 +397,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 7 + - id: 11 request: proto: HTTP/1.1 proto_major: 1 @@ -271,7 +415,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -289,7 +433,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 8 + - id: 12 request: proto: HTTP/1.1 proto_major: 1 @@ -307,7 +451,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: PATCH response: @@ -325,7 +469,7 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 9 + - id: 13 request: proto: HTTP/1.1 proto_major: 1 @@ -343,7 +487,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: @@ -361,7 +505,79 @@ interactions: status: 200 OK code: 200 duration: 1ms - - id: 10 + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"universal_login_experience":"new","identifier_first":false,"webauthn_platform_first_factor":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 16 request: proto: HTTP/1.1 proto_major: 1 @@ -379,7 +595,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0-SDK/0.10.0 + - Go-Auth0-SDK/latest url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts method: GET response: