diff --git a/docs/data-sources/self_service_profile.md b/docs/data-sources/self_service_profile.md index 133b69807..60311a0a1 100644 --- a/docs/data-sources/self_service_profile.md +++ b/docs/data-sources/self_service_profile.md @@ -26,8 +26,11 @@ data "auth0_self_service_profile" "auth0_self_service_profile" { ### Read-Only +- `allowed_strategies` (Set of String) List of IdP strategies that will be shown to users during the Self-Service SSO flow. - `branding` (List of Object) Field can be used to customize the look and feel of the wizard. (see [below for nested schema](#nestedatt--branding)) - `created_at` (String) The ISO 8601 formatted date the profile was created. +- `description` (String) The description of the self-service Profile +- `name` (String) The name of the self-service Profile - `updated_at` (String) The ISO 8601 formatted date the profile was updated. - `user_attributes` (List of Object) This array stores the mapping information that will be shown to the user during the SS-SSO flow. The user will be prompted to map the attributes on their identity provider to ensure the specified attributes get passed to Auth0. (see [below for nested schema](#nestedatt--user_attributes)) diff --git a/docs/resources/self_service_profile.md b/docs/resources/self_service_profile.md index 1531256fb..17f1c576f 100644 --- a/docs/resources/self_service_profile.md +++ b/docs/resources/self_service_profile.md @@ -29,9 +29,15 @@ resource "auth0_self_service_profile" "my_self_service_profile" { ## Schema +### Required + +- `name` (String) The name of the self-service Profile + ### Optional +- `allowed_strategies` (Set of String) List of IdP strategies that will be shown to users during the Self-Service SSO flow. - `branding` (Block List, Max: 1) Field can be used to customize the look and feel of the wizard. (see [below for nested schema](#nestedblock--branding)) +- `description` (String) The description of the self-service Profile - `user_attributes` (Block List, Max: 20) This array stores the mapping information that will be shown to the user during the SS-SSO flow. The user will be prompted to map the attributes on their identity provider to ensure the specified attributes get passed to Auth0. (see [below for nested schema](#nestedblock--user_attributes)) ### Read-Only diff --git a/docs/resources/self_service_profile_custom_text.md b/docs/resources/self_service_profile_custom_text.md new file mode 100644 index 000000000..c48a141b5 --- /dev/null +++ b/docs/resources/self_service_profile_custom_text.md @@ -0,0 +1,51 @@ +--- +page_title: "Resource: auth0_self_service_profile_custom_text" +description: |- + With this resource, you can set custom text for Self-Service Profile +--- + +# Resource: auth0_self_service_profile_custom_text + +With this resource, you can set custom text for Self-Service Profile + +## Example Usage + +```terraform +resource "auth0_self_service_profile_custom_text" "sso_custom_text" { + sso_id = "some-sso-id" + language = "en" + page = "get-started" + body = jsonencode( + { + "introduction" : "Welcome! With only a few steps you'll be able to setup your new custom text." + } + ) +} +``` + + +## Schema + +### Required + +- `body` (String) The list of text keys and values to customize the self-service SSO page. Values can be plain text or rich HTML content limited to basic styling tags and hyperlinks +- `language` (String) The language of the custom text +- `page` (String) The page where the custom text is shown +- `sso_id` (String) The id of the self-service profile + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +# This resource can be imported by specifying the +# sso-profile-id, language and page separated by "::" (note the double colon) +# :::: +# +# Example +terraform import auth0_self_service_profile_custom_text.example "some-sso-id::en::get-started" +``` diff --git a/examples/resources/auth0_self_service_profile_custom_text/import.sh b/examples/resources/auth0_self_service_profile_custom_text/import.sh new file mode 100644 index 000000000..6b86cd080 --- /dev/null +++ b/examples/resources/auth0_self_service_profile_custom_text/import.sh @@ -0,0 +1,6 @@ +# This resource can be imported by specifying the +# sso-profile-id, language and page separated by "::" (note the double colon) +# :::: +# +# Example +terraform import auth0_self_service_profile_custom_text.example "some-sso-id::en::get-started" diff --git a/examples/resources/auth0_self_service_profile_custom_text/resource.tf b/examples/resources/auth0_self_service_profile_custom_text/resource.tf new file mode 100644 index 000000000..1785f906b --- /dev/null +++ b/examples/resources/auth0_self_service_profile_custom_text/resource.tf @@ -0,0 +1,11 @@ +resource "auth0_self_service_profile_custom_text" "sso_custom_text" { + sso_id = "some-sso-id" + language = "en" + page = "get-started" + body = jsonencode( + { + "introduction" : "Welcome! With only a few steps you'll be able to setup your new custom text." + } + ) +} + diff --git a/go.mod b/go.mod index df0f9b5e9..92e8682c0 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/PuerkitoBio/rehttp v1.4.0 - github.com/auth0/go-auth0 v1.11.2 + github.com/auth0/go-auth0 v1.11.3-0.20241113184128-ddfd407304f5 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index 0299637b3..9bbd61331 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,14 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/auth0/go-auth0 v1.11.2 h1:WLh0K3iau5d5mCt08vIvynOM5jCRmv/WJDH8FBo4Fu4= github.com/auth0/go-auth0 v1.11.2/go.mod h1:VyYseHsdB4s9jmfBqoxnzJTvZr0w17ZJ5kjNdA+ag9Y= +github.com/auth0/go-auth0 v1.11.3-0.20241111092011-46578faea3fc h1:D3Com1bbzf4tCWdiAgM8i/tDsIGn/RFFl/KpnFP81uQ= +github.com/auth0/go-auth0 v1.11.3-0.20241111092011-46578faea3fc/go.mod h1:vmYy3IH8KkbJb+kxuAX1TBGUlhR3HFNsD+7F518qf90= +github.com/auth0/go-auth0 v1.11.3-0.20241111092326-a0cf7a08f44d h1:SI0EVpcFhqz5a/WhMarz24d1T+mXoh6GWOU3NPrL+uY= +github.com/auth0/go-auth0 v1.11.3-0.20241111092326-a0cf7a08f44d/go.mod h1:vmYy3IH8KkbJb+kxuAX1TBGUlhR3HFNsD+7F518qf90= +github.com/auth0/go-auth0 v1.11.3-0.20241111093533-5387e0cfb42b h1:Rmq9lf4ijBK0LBY60FQNE+iVzvxeY3m7+BO9tdtLsiU= +github.com/auth0/go-auth0 v1.11.3-0.20241111093533-5387e0cfb42b/go.mod h1:vmYy3IH8KkbJb+kxuAX1TBGUlhR3HFNsD+7F518qf90= +github.com/auth0/go-auth0 v1.11.3-0.20241113184128-ddfd407304f5 h1:v2NO2cz8Orj2I3WxqkGI8kHNW46wTef6esYDLQnU/gc= +github.com/auth0/go-auth0 v1.11.3-0.20241113184128-ddfd407304f5/go.mod h1:vmYy3IH8KkbJb+kxuAX1TBGUlhR3HFNsD+7F518qf90= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= diff --git a/internal/auth0/selfserviceprofile/data_source_test.go b/internal/auth0/selfserviceprofile/data_source_test.go index c9385375a..f918831d9 100644 --- a/internal/auth0/selfserviceprofile/data_source_test.go +++ b/internal/auth0/selfserviceprofile/data_source_test.go @@ -12,6 +12,9 @@ import ( const testAGivenSelfServiceProfile = ` resource "auth0_self_service_profile" "my_self_service_profile" { + name = "my-sso-profile" + description = "sample description" + allowed_strategies = ["oidc", "samlp"] user_attributes { name = "sample-name-{{.testName}}" description = "sample-description" diff --git a/internal/auth0/selfserviceprofile/expand.go b/internal/auth0/selfserviceprofile/expand.go index b592c1551..fefe8cd8e 100644 --- a/internal/auth0/selfserviceprofile/expand.go +++ b/internal/auth0/selfserviceprofile/expand.go @@ -12,8 +12,11 @@ func expandSelfServiceProfiles(data *schema.ResourceData) *management.SelfServic cfg := data.GetRawConfig() return &management.SelfServiceProfile{ - UserAttributes: expandSelfServiceProfileUserAttributes(cfg.GetAttr("user_attributes")), - Branding: expandBranding(cfg.GetAttr("branding")), + Name: value.String(cfg.GetAttr("name")), + Description: value.String(cfg.GetAttr("description")), + AllowedStrategies: value.Strings(cfg.GetAttr("allowed_strategies")), + UserAttributes: expandSelfServiceProfileUserAttributes(cfg.GetAttr("user_attributes")), + Branding: expandBranding(cfg.GetAttr("branding")), } } diff --git a/internal/auth0/selfserviceprofile/flatten.go b/internal/auth0/selfserviceprofile/flatten.go index eb0f834ee..3ff0e4aca 100644 --- a/internal/auth0/selfserviceprofile/flatten.go +++ b/internal/auth0/selfserviceprofile/flatten.go @@ -1,6 +1,10 @@ package selfserviceprofile import ( + "bytes" + "encoding/json" + "fmt" + "github.com/auth0/go-auth0/management" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -54,3 +58,31 @@ func flattenBrandingColors(brandingColors *management.BrandingColors) []interfac }, } } + +func flattenSSOCustomText(data *schema.ResourceData, customText map[string]interface{}) error { + body, err := marshalCustomTextBody(customText) + if err != nil { + return err + } + + return data.Set("body", body) +} + +func marshalCustomTextBody(b map[string]interface{}) (string, error) { + if b == nil { + return "{}", nil + } + + bodyBytes, err := json.Marshal(b) + if err != nil { + return "", fmt.Errorf("failed to serialize the custom texts to JSON: %w", err) + } + + var buffer bytes.Buffer + const jsonIndentation = " " + if err := json.Indent(&buffer, bodyBytes, "", jsonIndentation); err != nil { + return "", fmt.Errorf("failed to format the custom texts JSON: %w", err) + } + + return buffer.String(), nil +} diff --git a/internal/auth0/selfserviceprofile/resource.go b/internal/auth0/selfserviceprofile/resource.go index 15751b2d1..2b0e490c4 100644 --- a/internal/auth0/selfserviceprofile/resource.go +++ b/internal/auth0/selfserviceprofile/resource.go @@ -23,6 +23,18 @@ func NewResource() *schema.Resource { }, Description: "With this resource, you can create and manage Self-Service Profile for a tenant.", Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1, 100), + Description: "The name of the self-service Profile", + }, + "description": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(1, 140), + Description: "The description of the self-service Profile", + }, "user_attributes": { Type: schema.TypeList, Optional: true, @@ -86,6 +98,18 @@ func NewResource() *schema.Resource { }, }, }, + "allowed_strategies": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "oidc", "samlp", "waad", "google-apps", + "adfs", "okta", "keycloak-samlp", "pingfederate"}, + false), + }, + Description: "List of IdP strategies that will be shown to users during the Self-Service SSO flow.", + }, "created_at": { Type: schema.TypeString, Computed: true, diff --git a/internal/auth0/selfserviceprofile/resource_custom_text.go b/internal/auth0/selfserviceprofile/resource_custom_text.go new file mode 100644 index 000000000..0779c5c06 --- /dev/null +++ b/internal/auth0/selfserviceprofile/resource_custom_text.go @@ -0,0 +1,111 @@ +package selfserviceprofile + +import ( + "context" + "encoding/json" + + "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/structure" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/auth0/terraform-provider-auth0/internal/config" + internalError "github.com/auth0/terraform-provider-auth0/internal/error" + internalSchema "github.com/auth0/terraform-provider-auth0/internal/schema" +) + +// NewCustomTextResource will return a new auth0_self_service_profile_custom_text resource. +func NewCustomTextResource() *schema.Resource { + return &schema.Resource{ + CreateContext: createCustomTextForSSOProfile, + ReadContext: readCustomTextForSSOProfile, + UpdateContext: updateCustomTextForSSOProfile, + DeleteContext: deleteCustomTextForSSOProfile, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Description: "With this resource, you can set custom text for Self-Service Profile", + Schema: map[string]*schema.Schema{ + "sso_id": { + Type: schema.TypeString, + ForceNew: true, + Required: true, + Description: "The id of the self-service profile", + }, + "language": { + Type: schema.TypeString, + Required: true, + Description: "The language of the custom text", + }, + "page": { + Type: schema.TypeString, + Required: true, + Description: "The page where the custom text is shown", + }, + "body": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsJSON, + DiffSuppressFunc: structure.SuppressJsonDiff, + Description: "The list of text keys and values to customize the self-service SSO page. " + + "Values can be plain text or rich HTML content limited to basic styling tags and hyperlinks", + }, + }, + } +} + +func createCustomTextForSSOProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := data.Get("sso_id").(string) + language := data.Get("language").(string) + page := data.Get("page").(string) + + internalSchema.SetResourceGroupID(data, id, language, page) + + return updateCustomTextForSSOProfile(ctx, data, meta) +} + +func readCustomTextForSSOProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + customText, err := api.SelfServiceProfile.GetCustomText(ctx, + data.Get("sso_id").(string), + data.Get("language").(string), + data.Get("page").(string)) + if err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return diag.FromErr(flattenSSOCustomText(data, customText)) +} + +func updateCustomTextForSSOProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + id := data.Get("sso_id").(string) + language := data.Get("language").(string) + page := data.Get("page").(string) + body := data.Get("body").(string) + + if body == "" { + return nil + } + + var payload map[string]interface{} + if err := json.Unmarshal([]byte(body), &payload); err != nil { + return diag.FromErr(err) + } + + if err := api.SelfServiceProfile.SetCustomText(ctx, id, language, page, payload); err != nil { + return diag.FromErr(err) + } + + return readCustomTextForSSOProfile(ctx, data, meta) +} + +func deleteCustomTextForSSOProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + if err := data.Set("body", "{}"); err != nil { + return diag.FromErr(err) + } + + return updateCustomTextForSSOProfile(ctx, data, meta) +} diff --git a/internal/auth0/selfserviceprofile/resource_custom_text_test.go b/internal/auth0/selfserviceprofile/resource_custom_text_test.go new file mode 100644 index 000000000..028dbb3b1 --- /dev/null +++ b/internal/auth0/selfserviceprofile/resource_custom_text_test.go @@ -0,0 +1,114 @@ +package selfserviceprofile_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/auth0/terraform-provider-auth0/internal/acctest" +) + +func TestAccSSOCustomText(t *testing.T) { + acctest.Test(t, resource.TestCase{ + Steps: []resource.TestStep{ + { + Config: testAccSSOCustomTextEmptyBody, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("auth0_self_service_profile_custom_text.sso_custom_text", "sso_id"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "page", "get-started"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "language", "en"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "body", "{}"), + ), + }, + { + Config: testAccSSOCustomTextCreate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("auth0_self_service_profile_custom_text.sso_custom_text", "sso_id"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "page", "get-started"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "language", "en"), + resource.TestCheckResourceAttr( + "auth0_self_service_profile_custom_text.sso_custom_text", + "body", + "{\n \"introduction\": \"Welcome! With only a few steps you'll be able to setup your new connection.\"\n}", + ), + ), + }, + { + Config: testAccSSOCustomTextUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("auth0_self_service_profile_custom_text.sso_custom_text", "sso_id"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "language", "en"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "page", "get-started"), + resource.TestCheckResourceAttr( + "auth0_self_service_profile_custom_text.sso_custom_text", + "body", + "{\n \"introduction\": \"Welcome! This is an updated Text\"\n}", + ), + ), + }, + { + Config: testAccSSOCustomTextEmptyBody, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("auth0_self_service_profile_custom_text.sso_custom_text", "sso_id"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "language", "en"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "page", "get-started"), + resource.TestCheckResourceAttr("auth0_self_service_profile_custom_text.sso_custom_text", "body", "{}"), + ), + }, + }, + }) +} + +const givenSelfServiceProfile = ` +resource "auth0_self_service_profile" "my_self_service_profile" { + name = "my-sso-profile" + description = "sample description" + allowed_strategies = ["oidc", "samlp"] + user_attributes { + name = "sample-name-{{.testName}}" + description = "sample-description" + is_optional = true + } + branding { + logo_url = "https://mycompany.org/v2/logo.png" + colors { + primary = "#0059d6" + } + } +} +` + +const testAccSSOCustomTextEmptyBody = givenSelfServiceProfile + ` +resource "auth0_self_service_profile_custom_text" "sso_custom_text" { + sso_id = auth0_self_service_profile.my_self_service_profile.id + language = "en" + page = "get-started" + body = "{}" +} +` + +const testAccSSOCustomTextCreate = givenSelfServiceProfile + ` +resource "auth0_self_service_profile_custom_text" "sso_custom_text" { + sso_id = auth0_self_service_profile.my_self_service_profile.id + language = "en" + page = "get-started" + body = jsonencode( + { + "introduction": "Welcome! With only a few steps you'll be able to setup your new connection." + } + ) +} +` + +const testAccSSOCustomTextUpdate = givenSelfServiceProfile + ` +resource "auth0_self_service_profile_custom_text" "sso_custom_text" { + sso_id = auth0_self_service_profile.my_self_service_profile.id + language = "en" + page = "get-started" + body = jsonencode( + { + "introduction": "Welcome! This is an updated Text" + } + ) +} +` diff --git a/internal/auth0/selfserviceprofile/resource_test.go b/internal/auth0/selfserviceprofile/resource_test.go index 048efbd83..af426d1df 100644 --- a/internal/auth0/selfserviceprofile/resource_test.go +++ b/internal/auth0/selfserviceprofile/resource_test.go @@ -11,6 +11,9 @@ import ( const testSelfServiceProfileCreate = ` resource "auth0_self_service_profile" "my_self_service_profile" { + name = "my-sso-profile-{{.testName}}" + description = "sample description" + allowed_strategies = ["oidc", "samlp"] user_attributes { name = "sample-name-{{.testName}}" description = "sample-description" @@ -27,6 +30,9 @@ resource "auth0_self_service_profile" "my_self_service_profile" { const testSelfServiceProfileUpdate = ` resource "auth0_self_service_profile" "my_self_service_profile" { + name = "updated-my-sso-profile-{{.testName}}" + description = "updated sample description" + allowed_strategies = ["oidc"] user_attributes { name = "updated-sample-name-{{.testName}}" description = "updated-sample-description" @@ -47,6 +53,9 @@ func TestSelfServiceProfile(t *testing.T) { { Config: acctest.ParseTestName(testSelfServiceProfileCreate, t.Name()), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "name", fmt.Sprintf("my-sso-profile-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "description", "sample description"), + resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "allowed_strategies.#", "2"), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.name", fmt.Sprintf("sample-name-%s", t.Name())), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.description", "sample-description"), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.is_optional", "true"), @@ -59,6 +68,7 @@ func TestSelfServiceProfile(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.name", fmt.Sprintf("updated-sample-name-%s", t.Name())), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.description", "updated-sample-description"), + resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "allowed_strategies.#", "1"), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "user_attributes.0.is_optional", "true"), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "branding.0.logo_url", "https://newcompany.org/v2/logo.png"), resource.TestCheckResourceAttr("auth0_self_service_profile.my_self_service_profile", "branding.0.colors.0.primary", "#000000"), diff --git a/internal/auth0/user/resource.go b/internal/auth0/user/resource.go index bd9258eda..a863e5650 100644 --- a/internal/auth0/user/resource.go +++ b/internal/auth0/user/resource.go @@ -34,8 +34,8 @@ func NewResource() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool { - return old == "auth0|"+new + DiffSuppressFunc: func(_, o, n string, _ *schema.ResourceData) bool { + return o == "auth0|"+n }, Description: "ID of the user.", }, diff --git a/internal/auth0/user/resource_role.go b/internal/auth0/user/resource_role.go index 6f952e685..82ae40690 100644 --- a/internal/auth0/user/resource_role.go +++ b/internal/auth0/user/resource_role.go @@ -20,8 +20,8 @@ func NewRoleResource() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool { - return old == "auth0|"+new + DiffSuppressFunc: func(_, o, n string, _ *schema.ResourceData) bool { + return o == "auth0|"+n }, Description: "ID of the user.", }, diff --git a/internal/auth0/user/resource_roles.go b/internal/auth0/user/resource_roles.go index 24c9a66ea..83612ceb5 100644 --- a/internal/auth0/user/resource_roles.go +++ b/internal/auth0/user/resource_roles.go @@ -21,8 +21,8 @@ func NewRolesResource() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool { - return old == "auth0|"+new + DiffSuppressFunc: func(_, o, n string, _ *schema.ResourceData) bool { + return o == "auth0|"+n }, Description: "ID of the user.", }, diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f0c54c928..11fea2716 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -95,59 +95,60 @@ func New() *schema.Provider { }, }, ResourcesMap: map[string]*schema.Resource{ - "auth0_action": action.NewResource(), - "auth0_trigger_actions": action.NewTriggerActionsResource(), - "auth0_trigger_action": action.NewTriggerActionResource(), - "auth0_attack_protection": attackprotection.NewResource(), - "auth0_branding": branding.NewResource(), - "auth0_branding_theme": branding.NewThemeResource(), - "auth0_client": client.NewResource(), - "auth0_client_credentials": client.NewCredentialsResource(), - "auth0_client_grant": client.NewGrantResource(), - "auth0_connection": connection.NewResource(), - "auth0_connection_client": connection.NewClientResource(), - "auth0_connection_clients": connection.NewClientsResource(), - "auth0_connection_scim_configuration": connection.NewSCIMConfigurationResource(), - "auth0_custom_domain": customdomain.NewResource(), - "auth0_custom_domain_verification": customdomain.NewVerificationResource(), - "auth0_email_provider": email.NewResource(), - "auth0_email_template": email.NewTemplateResource(), - "auth0_encryption_key_manager": encryptionkeymanager.NewEncryptionKeyManagerResource(), - "auth0_flow": flow.NewResource(), - "auth0_flow_vault_connection": flow.NewVaultConnectionResource(), - "auth0_form": form.NewResource(), - "auth0_guardian": guardian.NewResource(), - "auth0_hook": hook.NewResource(), - "auth0_log_stream": logstream.NewResource(), - "auth0_organization": organization.NewResource(), - "auth0_organization_client_grant": organization.NewOrganizationClientGrantResource(), - "auth0_organization_connection": organization.NewConnectionResource(), - "auth0_organization_connections": organization.NewConnectionsResource(), - "auth0_organization_member": organization.NewMemberResource(), - "auth0_organization_member_role": organization.NewMemberRoleResource(), - "auth0_organization_member_roles": organization.NewMemberRolesResource(), - "auth0_organization_members": organization.NewMembersResource(), - "auth0_pages": page.NewResource(), - "auth0_prompt": prompt.NewResource(), - "auth0_prompt_custom_text": prompt.NewCustomTextResource(), - "auth0_prompt_partials": prompt.NewPartialsResource(), - "auth0_prompt_screen_partial": prompt.NewScreenPartialResource(), - "auth0_prompt_screen_partials": prompt.NewScreenPartialsResource(), - "auth0_resource_server": resourceserver.NewResource(), - "auth0_resource_server_scope": resourceserver.NewScopeResource(), - "auth0_resource_server_scopes": resourceserver.NewScopesResource(), - "auth0_role": role.NewResource(), - "auth0_role_permission": role.NewPermissionResource(), - "auth0_role_permissions": role.NewPermissionsResource(), - "auth0_rule": rule.NewResource(), - "auth0_rule_config": rule.NewConfigResource(), - "auth0_self_service_profile": selfserviceprofile.NewResource(), - "auth0_tenant": tenant.NewResource(), - "auth0_user": user.NewResource(), - "auth0_user_permission": user.NewPermissionResource(), - "auth0_user_permissions": user.NewPermissionsResource(), - "auth0_user_role": user.NewRoleResource(), - "auth0_user_roles": user.NewRolesResource(), + "auth0_action": action.NewResource(), + "auth0_trigger_actions": action.NewTriggerActionsResource(), + "auth0_trigger_action": action.NewTriggerActionResource(), + "auth0_attack_protection": attackprotection.NewResource(), + "auth0_branding": branding.NewResource(), + "auth0_branding_theme": branding.NewThemeResource(), + "auth0_client": client.NewResource(), + "auth0_client_credentials": client.NewCredentialsResource(), + "auth0_client_grant": client.NewGrantResource(), + "auth0_connection": connection.NewResource(), + "auth0_connection_client": connection.NewClientResource(), + "auth0_connection_clients": connection.NewClientsResource(), + "auth0_connection_scim_configuration": connection.NewSCIMConfigurationResource(), + "auth0_custom_domain": customdomain.NewResource(), + "auth0_custom_domain_verification": customdomain.NewVerificationResource(), + "auth0_email_provider": email.NewResource(), + "auth0_email_template": email.NewTemplateResource(), + "auth0_encryption_key_manager": encryptionkeymanager.NewEncryptionKeyManagerResource(), + "auth0_flow": flow.NewResource(), + "auth0_flow_vault_connection": flow.NewVaultConnectionResource(), + "auth0_form": form.NewResource(), + "auth0_guardian": guardian.NewResource(), + "auth0_hook": hook.NewResource(), + "auth0_log_stream": logstream.NewResource(), + "auth0_organization": organization.NewResource(), + "auth0_organization_client_grant": organization.NewOrganizationClientGrantResource(), + "auth0_organization_connection": organization.NewConnectionResource(), + "auth0_organization_connections": organization.NewConnectionsResource(), + "auth0_organization_member": organization.NewMemberResource(), + "auth0_organization_member_role": organization.NewMemberRoleResource(), + "auth0_organization_member_roles": organization.NewMemberRolesResource(), + "auth0_organization_members": organization.NewMembersResource(), + "auth0_pages": page.NewResource(), + "auth0_prompt": prompt.NewResource(), + "auth0_prompt_custom_text": prompt.NewCustomTextResource(), + "auth0_prompt_partials": prompt.NewPartialsResource(), + "auth0_prompt_screen_partial": prompt.NewScreenPartialResource(), + "auth0_prompt_screen_partials": prompt.NewScreenPartialsResource(), + "auth0_resource_server": resourceserver.NewResource(), + "auth0_resource_server_scope": resourceserver.NewScopeResource(), + "auth0_resource_server_scopes": resourceserver.NewScopesResource(), + "auth0_role": role.NewResource(), + "auth0_role_permission": role.NewPermissionResource(), + "auth0_role_permissions": role.NewPermissionsResource(), + "auth0_rule": rule.NewResource(), + "auth0_rule_config": rule.NewConfigResource(), + "auth0_self_service_profile": selfserviceprofile.NewResource(), + "auth0_self_service_profile_custom_text": selfserviceprofile.NewCustomTextResource(), + "auth0_tenant": tenant.NewResource(), + "auth0_user": user.NewResource(), + "auth0_user_permission": user.NewPermissionResource(), + "auth0_user_permissions": user.NewPermissionsResource(), + "auth0_user_role": user.NewRoleResource(), + "auth0_user_roles": user.NewRolesResource(), }, DataSourcesMap: map[string]*schema.Resource{ "auth0_attack_protection": attackprotection.NewDataSource(), diff --git a/test/data/recordings/TestAccSSOCustomText.yaml b/test/data/recordings/TestAccSSOCustomText.yaml new file mode 100644 index 000000000..59c92f0ed --- /dev/null +++ b/test/data/recordings/TestAccSSOCustomText.yaml @@ -0,0 +1,954 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 301 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"my-sso-profile","description":"sample description","allowed_strategies":["oidc","samlp"],"user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"branding":{"colors":{"primary":"#0059d6"},"logo_url":"https://mycompany.org/v2/logo.png"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 414 + uncompressed: false + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 361.013833ms + - id: 1 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 480.865292ms + - id: 2 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: PUT + 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: 529.058041ms + - id: 3 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 369.14425ms + - id: 4 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 2.254550667s + - id: 5 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 3.378859417s + - id: 6 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 5.381368583s + - id: 7 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 3.392942041s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 95 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"introduction":"Welcome! With only a few steps you'll be able to setup your new connection."} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! With only a few steps you''ll be able to setup your new connection."}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 2.690113916s + - id: 9 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! With only a few steps you''ll be able to setup your new connection."}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 375.2075ms + - id: 10 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 364.711042ms + - id: 11 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! With only a few steps you''ll be able to setup your new connection."}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 355.619083ms + - id: 12 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 309.317666ms + - id: 13 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! With only a few steps you''ll be able to setup your new connection."}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 335.527417ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 52 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"introduction":"Welcome! This is an updated Text"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! This is an updated Text"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 348.677875ms + - id: 15 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! This is an updated Text"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 932.155458ms + - id: 16 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 324.079583ms + - id: 17 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! This is an updated Text"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 321.343208ms + - id: 18 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 302.443041ms + - id: 19 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"introduction":"Welcome! This is an updated Text"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 327.195667ms + - id: 20 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: PUT + 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: 322.204708ms + - id: 21 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 294.143542ms + - id: 22 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"ssp_dLUJMxiQ4GoG3ewN8FnXNd","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-{{.testName}}","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:34:23.410Z","updated_at":"2024-11-13T18:34:23.410Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 315.569542ms + - id: 23 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 325.537833ms + - id: 24 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + method: PUT + 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: 345.538791ms + - id: 25 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd/custom-text/en/get-started + 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: 317.849583ms + - id: 26 + 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/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_dLUJMxiQ4GoG3ewN8FnXNd + 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: 314.2045ms diff --git a/test/data/recordings/TestSelfServiceDataSourceResource.yaml b/test/data/recordings/TestSelfServiceDataSourceResource.yaml index 786c7c9ec..570c6f1e1 100644 --- a/test/data/recordings/TestSelfServiceDataSourceResource.yaml +++ b/test/data/recordings/TestSelfServiceDataSourceResource.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 224 + content_length: 321 transfer_encoding: [] trailer: {} host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"branding":{"colors":{"primary":"#0059d6"},"logo_url":"https://mycompany.org/v2/logo.png"}} + {"name":"my-sso-profile","description":"sample description","allowed_strategies":["oidc","samlp"],"user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"branding":{"colors":{"primary":"#0059d6"},"logo_url":"https://mycompany.org/v2/logo.png"}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 + - Go-Auth0/1.11.2 url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles method: POST response: @@ -28,15 +28,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 337 + content_length: 434 uncompressed: false - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 379.807291ms + duration: 410.859042ms - id: 1 request: proto: HTTP/1.1 @@ -54,8 +54,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -65,13 +65,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 357.008ms + duration: 364.377333ms - id: 2 request: proto: HTTP/1.1 @@ -89,7 +89,7 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 + - Go-Auth0/1.11.2 url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_bskks8aGbiq7qS13umnuvX method: GET response: @@ -106,7 +106,7 @@ interactions: - application/json; charset=utf-8 status: 404 Not Found code: 404 - duration: 353.041541ms + duration: 409.1435ms - id: 3 request: proto: HTTP/1.1 @@ -124,8 +124,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -135,13 +135,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 345.169042ms + duration: 1.4477905s - id: 4 request: proto: HTTP/1.1 @@ -159,8 +159,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -170,13 +170,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 313.995208ms + duration: 1.5700585s - id: 5 request: proto: HTTP/1.1 @@ -194,8 +194,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -205,13 +205,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 331.157916ms + duration: 3.92362225s - id: 6 request: proto: HTTP/1.1 @@ -229,8 +229,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -240,13 +240,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 331.689167ms + duration: 1.965138583s - id: 7 request: proto: HTTP/1.1 @@ -264,8 +264,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: GET response: proto: HTTP/2.0 @@ -275,13 +275,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_hcfmRKDq1o8P3eBFGBmc4y","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T20:57:45.382Z","updated_at":"2024-08-22T20:57:45.382Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_7VyHvtyjmZZUAU1T498LFN","name":"my-sso-profile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceDataSourceResource","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T19:29:15.702Z","updated_at":"2024-11-13T19:29:15.702Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 328.803167ms + duration: 2.510987958s - id: 8 request: proto: HTTP/1.1 @@ -299,8 +299,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hcfmRKDq1o8P3eBFGBmc4y + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_7VyHvtyjmZZUAU1T498LFN method: DELETE response: proto: HTTP/2.0 @@ -316,4 +316,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 331.205458ms + duration: 2.347906375s diff --git a/test/data/recordings/TestSelfServiceProfile.yaml b/test/data/recordings/TestSelfServiceProfile.yaml index c2700157b..1664b2c34 100644 --- a/test/data/recordings/TestSelfServiceProfile.yaml +++ b/test/data/recordings/TestSelfServiceProfile.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 213 + content_length: 333 transfer_encoding: [] trailer: {} host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"branding":{"colors":{"primary":"#0059d6"},"logo_url":"https://mycompany.org/v2/logo.png"}} + {"name":"my-sso-profile-TestSelfServiceProfile","description":"sample description","allowed_strategies":["oidc","samlp"],"user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"branding":{"colors":{"primary":"#0059d6"},"logo_url":"https://mycompany.org/v2/logo.png"}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 + - Go-Auth0/1.11.2 url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles method: POST response: @@ -28,15 +28,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 326 + content_length: 446 uncompressed: false - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:09.230Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"my-sso-profile-TestSelfServiceProfile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:50.450Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 425.205083ms + duration: 386.266209ms - id: 1 request: proto: HTTP/1.1 @@ -54,8 +54,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: GET response: proto: HTTP/2.0 @@ -65,13 +65,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:09.230Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"my-sso-profile-TestSelfServiceProfile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:50.450Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 337.79425ms + duration: 338.4615ms - id: 2 request: proto: HTTP/1.1 @@ -89,8 +89,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: GET response: proto: HTTP/2.0 @@ -100,13 +100,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:09.230Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"my-sso-profile-TestSelfServiceProfile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:50.450Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 323.154917ms + duration: 357.665625ms - id: 3 request: proto: HTTP/1.1 @@ -124,8 +124,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: GET response: proto: HTTP/2.0 @@ -135,33 +135,33 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:09.230Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"my-sso-profile-TestSelfServiceProfile","description":"sample description","user_attributes":[{"name":"sample-name-TestSelfServiceProfile","description":"sample-description","is_optional":true}],"allowed_strategies":["oidc","samlp"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:50.450Z","branding":{"logo_url":"https://mycompany.org/v2/logo.png","colors":{"primary":"#0059d6"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 347.216417ms + duration: 317.5665ms - id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 230 + content_length: 358 transfer_encoding: [] trailer: {} host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"branding":{"colors":{"primary":"#000000"},"logo_url":"https://newcompany.org/v2/logo.png"}} + {"name":"updated-my-sso-profile-TestSelfServiceProfile","description":"updated sample description","allowed_strategies":["oidc"],"user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"branding":{"colors":{"primary":"#000000"},"logo_url":"https://newcompany.org/v2/logo.png"}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: PATCH response: proto: HTTP/2.0 @@ -171,13 +171,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:12.155Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"updated-my-sso-profile-TestSelfServiceProfile","description":"updated sample description","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"allowed_strategies":["oidc"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:53.340Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 357.310042ms + duration: 351.886167ms - id: 5 request: proto: HTTP/1.1 @@ -195,8 +195,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: GET response: proto: HTTP/2.0 @@ -206,13 +206,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:12.155Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"updated-my-sso-profile-TestSelfServiceProfile","description":"updated sample description","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"allowed_strategies":["oidc"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:53.340Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 329.831375ms + duration: 310.854083ms - id: 6 request: proto: HTTP/1.1 @@ -230,8 +230,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: GET response: proto: HTTP/2.0 @@ -241,13 +241,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_mCuWk3TvhEQDk1f6oovKod","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"created_at":"2024-08-22T21:01:09.230Z","updated_at":"2024-08-22T21:01:12.155Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' + body: '{"id":"ssp_tdTrKAi1xxjCrkhut45YNJ","name":"updated-my-sso-profile-TestSelfServiceProfile","description":"updated sample description","user_attributes":[{"name":"updated-sample-name-TestSelfServiceProfile","description":"updated-sample-description","is_optional":true}],"allowed_strategies":["oidc"],"created_at":"2024-11-13T18:35:50.450Z","updated_at":"2024-11-13T18:35:53.340Z","branding":{"logo_url":"https://newcompany.org/v2/logo.png","colors":{"primary":"#000000"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 317.670291ms + duration: 318.304084ms - id: 7 request: proto: HTTP/1.1 @@ -265,8 +265,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.9.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_mCuWk3TvhEQDk1f6oovKod + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_tdTrKAi1xxjCrkhut45YNJ method: DELETE response: proto: HTTP/2.0 @@ -282,4 +282,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 335.627375ms + duration: 323.762917ms