From ab8ca152cf2b5f2aac0cf19b657a2fb2dfa2fad7 Mon Sep 17 00:00:00 2001 From: Ramya Anusri <62586490+ramya18101@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:53:35 +0530 Subject: [PATCH] Add support for rendering the settings of prompt-screen (#1077) * 1. Support resource and data_source for render settings of prompt-screen 2. Include unit tests, examples and docs 3. Update Go-Auth0's dependent version * Add unit tests for delete scenario for auth0_prompt_screen_renderer * Include E2E test Recordings and few edge case scenario for auth0_prompt_screen_renderer resource * Fix lint issue * Handle null case for head_tags & update supported screens * Update docs,unit tests and integration tests recordings * Update the screen Name for reset-password-mfa-push-challenge-push * Update the latest go-auth0 version * Update the renderingMode type to ENUM. * Update the renderingMode type to ENUM. --- docs/data-sources/prompt_screen_renderer.md | 30 + docs/resources/prompt_screen_renderer.md | 88 ++ .../auth0_prompt_screen_renderer/import.sh | 8 + .../auth0_prompt_screen_renderer/resource.tf | 39 + go.mod | 2 +- go.sum | 4 +- .../auth0/prompt/data_source_screen_render.go | 54 ++ .../prompt/data_source_screen_render_test.go | 99 ++ internal/auth0/prompt/expand.go | 42 + internal/auth0/prompt/flatten.go | 32 + .../auth0/prompt/resource_screen_render.go | 257 ++++++ .../prompt/resource_screen_render_test.go | 181 ++++ internal/auth0/user/resource.go | 4 +- internal/auth0/user/resource_role.go | 4 +- internal/auth0/user/resource_roles.go | 4 +- internal/provider/provider.go | 2 + .../TestAccDataPromptScreenRender.yaml | 250 ++++++ .../TestAccPromptScreenSettings.yaml | 850 ++++++++++++++++++ 18 files changed, 1941 insertions(+), 9 deletions(-) create mode 100644 docs/data-sources/prompt_screen_renderer.md create mode 100644 docs/resources/prompt_screen_renderer.md create mode 100644 examples/resources/auth0_prompt_screen_renderer/import.sh create mode 100644 examples/resources/auth0_prompt_screen_renderer/resource.tf create mode 100644 internal/auth0/prompt/data_source_screen_render.go create mode 100644 internal/auth0/prompt/data_source_screen_render_test.go create mode 100644 internal/auth0/prompt/resource_screen_render.go create mode 100644 internal/auth0/prompt/resource_screen_render_test.go create mode 100644 test/data/recordings/TestAccDataPromptScreenRender.yaml create mode 100644 test/data/recordings/TestAccPromptScreenSettings.yaml diff --git a/docs/data-sources/prompt_screen_renderer.md b/docs/data-sources/prompt_screen_renderer.md new file mode 100644 index 00000000..07cab123 --- /dev/null +++ b/docs/data-sources/prompt_screen_renderer.md @@ -0,0 +1,30 @@ +--- +page_title: "Data Source: auth0_prompt_screen_renderer" +description: |- + Data source to retrieve a specific Auth0 prompt screen settings by prompt_type and screen_name +--- + +# Data Source: auth0_prompt_screen_renderer + +Data source to retrieve a specific Auth0 prompt screen settings by `prompt_type` and `screen_name` + + + + +## Schema + +### Required + +- `prompt_type` (String) The type of prompt to customize. +- `screen_name` (String) The screen name associated with the prompt type. + +### Read-Only + +- `context_configuration` (Set of String) Context values to make available +- `default_head_tags_disabled` (Boolean) Override Universal Login default head tags +- `head_tags` (String) An array of head tags +- `id` (String) The ID of this resource. +- `rendering_mode` (String) Rendering modeOptions are: `standard`, `advanced`. +- `tenant` (String) Tenant ID + + diff --git a/docs/resources/prompt_screen_renderer.md b/docs/resources/prompt_screen_renderer.md new file mode 100644 index 00000000..a4ead1dc --- /dev/null +++ b/docs/resources/prompt_screen_renderer.md @@ -0,0 +1,88 @@ +--- +page_title: "Resource: auth0_prompt_screen_renderer" +description: |- + With this resource, you can Configure the render settings for a specific screen.You can read more about this. +--- + +# Resource: auth0_prompt_screen_renderer + +With this resource, you can Configure the render settings for a specific screen.You can read more about this. + +## Example Usage + +```terraform +resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" { + prompt_type = "login-id" + screen_name = "login-id" + rendering_mode = "advanced" + default_head_tags_disabled = false + context_configuration = [ + "branding.settings", + "branding.themes.default", + "client.logo_uri", + "client.description", + "client.metadata.key", + "organization.display_name", + "organization.branding", + "organization.metadata.key", + "screen.texts", + "tenant.name", + "tenant.friendly_name", + "tenant.enabled_locales", + "untrusted_data.submitted_form_data", + "untrusted_data.authorization_params.login_hint", + "untrusted_data.authorization_params.screen_hint", + "untrusted_data.authorization_params.ui_locales", + "untrusted_data.authorization_params.ext-.key", + "transaction.connection.metadata.key" + ] + head_tags = jsonencode([ + { + attributes : { + "async" : true, + "defer" : true, + "integrity" : [ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" + ], + "src" : "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" + }, + tag : "script" + } + ]) +} +``` + + +## Schema + +### Required + +- `prompt_type` (String) The prompt that you are configuring settings for. Options are: `signup-id`, `signup`, `signup-password`, `login`, `login-id`, `login-password`, `login-passwordless`, `login-email-verification`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `reset-password`, `custom-form`, `consent`, `customized-consent`, `logout`, `mfa-push`, `mfa-otp`, `mfa-voice`, `mfa-phone`, `mfa-webauthn`, `mfa-sms`, `mfa-email`, `mfa-recovery-code`, `mfa`, `status`, `device-flow`, `email-verification`, `email-otp-challenge`, `organizations`, `invitation`, `common`, `passkeys`, `captcha`. +- `screen_name` (String) The screen that you are configuring settings for. Options are: `login`, `login-id`, `login-password`, `signup`, `signup-id`, `signup-password`, `login-passwordless-sms-otp`, `login-passwordless-email-code`, `login-passwordless-email-link`, `login-email-verification`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `reset-password-request`, `reset-password-email`, `reset-password`, `reset-password-success`, `reset-password-error`, `reset-password-mfa-email-challenge`, `reset-password-mfa-otp-challenge`, `reset-password-mfa-phone-challenge`, `reset-password-mfa-push-challenge-push`, `reset-password-mfa-recovery-code-challenge`, `reset-password-mfa-sms-challenge`, `reset-password-mfa-voice-challenge`, `reset-password-mfa-webauthn-platform-challenge`, `reset-password-mfa-webauthn-roaming-challenge`, `custom-form`, `consent`, `customized-consent`, `logout`, `logout-complete`, `logout-aborted`, `mfa-push-welcome`, `mfa-push-enrollment-qr`, `mfa-push-enrollment-code`, `mfa-push-success`, `mfa-push-challenge-push`, `mfa-push-list`, `mfa-otp-enrollment-qr`, `mfa-otp-enrollment-code`, `mfa-otp-challenge`, `mfa-voice-enrollment`, `mfa-voice-challenge`, `mfa-phone-challenge`, `mfa-phone-enrollment`, `mfa-webauthn-platform-enrollment`, `mfa-webauthn-roaming-enrollment`, `mfa-webauthn-platform-challenge`, `mfa-webauthn-roaming-challenge`, `mfa-webauthn-change-key-nickname`, `mfa-webauthn-enrollment-success`, `mfa-webauthn-error`, `mfa-webauthn-not-available-error`, `mfa-country-codes`, `mfa-sms-enrollment`, `mfa-sms-challenge`, `mfa-sms-list`, `mfa-email-challenge`, `mfa-email-list`, `mfa-recovery-code-enrollment`, `mfa-recovery-code-challenge`, `mfa-detect-browser-capabilities`, `mfa-enroll-result`, `mfa-login-options`, `mfa-begin-enroll-options`, `status`, `device-code-activation`, `device-code-activation-allowed`, `device-code-activation-denied`, `device-code-confirmation`, `email-verification-result`, `email-otp-challenge`, `organization-selection`, `organization-picker`, `accept-invitation`, `redeem-ticket`, `passkey-enrollment`, `passkey-enrollment-local`, `interstitial-captcha`. + +### Optional + +- `context_configuration` (Set of String) Context values to make available +- `default_head_tags_disabled` (Boolean) Override Universal Login default head tags +- `head_tags` (String) An array of head tags +- `rendering_mode` (String) Rendering modeOptions are: `standard`, `advanced`. + +### Read-Only + +- `id` (String) The ID of this resource. +- `tenant` (String) Tenant ID + +## Import + +Import is supported using the following syntax: + +```shell +# This resource can be imported using the prompt name and screen_name. +# +# As this is not a resource identifiable by an ID within the Auth0 Management API, +# login can be imported using the prompt name and screen name using the format: +# prompt_name:screen_name +# +# Example: +terraform import auth0_prompt_screen_renderer "login-id:login-id" +``` diff --git a/examples/resources/auth0_prompt_screen_renderer/import.sh b/examples/resources/auth0_prompt_screen_renderer/import.sh new file mode 100644 index 00000000..99fa4485 --- /dev/null +++ b/examples/resources/auth0_prompt_screen_renderer/import.sh @@ -0,0 +1,8 @@ +# This resource can be imported using the prompt name and screen_name. +# +# As this is not a resource identifiable by an ID within the Auth0 Management API, +# login can be imported using the prompt name and screen name using the format: +# prompt_name:screen_name +# +# Example: +terraform import auth0_prompt_screen_renderer "login-id:login-id" diff --git a/examples/resources/auth0_prompt_screen_renderer/resource.tf b/examples/resources/auth0_prompt_screen_renderer/resource.tf new file mode 100644 index 00000000..25a8bd22 --- /dev/null +++ b/examples/resources/auth0_prompt_screen_renderer/resource.tf @@ -0,0 +1,39 @@ +resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" { + prompt_type = "login-id" + screen_name = "login-id" + rendering_mode = "advanced" + default_head_tags_disabled = false + context_configuration = [ + "branding.settings", + "branding.themes.default", + "client.logo_uri", + "client.description", + "client.metadata.key", + "organization.display_name", + "organization.branding", + "organization.metadata.key", + "screen.texts", + "tenant.name", + "tenant.friendly_name", + "tenant.enabled_locales", + "untrusted_data.submitted_form_data", + "untrusted_data.authorization_params.login_hint", + "untrusted_data.authorization_params.screen_hint", + "untrusted_data.authorization_params.ui_locales", + "untrusted_data.authorization_params.ext-.key", + "transaction.connection.metadata.key" + ] + head_tags = jsonencode([ + { + attributes : { + "async" : true, + "defer" : true, + "integrity" : [ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" + ], + "src" : "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" + }, + tag : "script" + } + ]) +} diff --git a/go.mod b/go.mod index 354ce04e..589a578c 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.12.0 + github.com/auth0/go-auth0 v1.13.0 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index c6fe2579..510c8bc9 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= 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.12.0 h1:wfpXnTMix5mDZ5Rx68ir6XwtFqwOhhgBcYmRSCI0EjU= -github.com/auth0/go-auth0 v1.12.0/go.mod h1:G3oPT7sWjmM4mHbn6qkMYEsxnwm/5PnSbo0kpPLSS0E= +github.com/auth0/go-auth0 v1.13.0 h1:GA7WyGAzlKBQ2ctHcCZwVf0aiOvPd2PB3QagC5heQJg= +github.com/auth0/go-auth0 v1.13.0/go.mod h1:G3oPT7sWjmM4mHbn6qkMYEsxnwm/5PnSbo0kpPLSS0E= 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/prompt/data_source_screen_render.go b/internal/auth0/prompt/data_source_screen_render.go new file mode 100644 index 00000000..06c0e982 --- /dev/null +++ b/internal/auth0/prompt/data_source_screen_render.go @@ -0,0 +1,54 @@ +package prompt + +import ( + "context" + "fmt" + + "github.com/auth0/go-auth0/management" + + "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/config" + internalSchema "github.com/auth0/terraform-provider-auth0/internal/schema" +) + +// NewPromptScreenRenderDataSource creates a new data source to retrieve the prompt and screen settings`. +func NewPromptScreenRenderDataSource() *schema.Resource { + return &schema.Resource{ + ReadContext: readPromptScreenRenderDataSource, + Description: "Data source to retrieve a specific Auth0 prompt screen settings by `prompt_type` and `screen_name`", + Schema: getPromptScreenRenderDataSourceSchema(), + } +} + +func getPromptScreenRenderDataSourceSchema() map[string]*schema.Schema { + dataSourceSchema := internalSchema.TransformResourceToDataSource(NewPromptScreenRenderResource().Schema) + internalSchema.SetExistingAttributesAsRequired(dataSourceSchema, "prompt_type", "screen_name") + dataSourceSchema["prompt_type"].Description = "The type of prompt to customize." + dataSourceSchema["prompt_type"].ValidateFunc = validation.StringInSlice(allowedPromptsSettingsRenderer, false) + dataSourceSchema["screen_name"].Description = "The screen name associated with the prompt type." + dataSourceSchema["screen_name"].ValidateFunc = validation.StringInSlice(allowedScreensSettingsRenderer, false) + return dataSourceSchema +} + +func readPromptScreenRenderDataSource(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + prompt := management.PromptType(data.Get("prompt_type").(string)) + screen := management.ScreenName(data.Get("screen_name").(string)) + + screenSettings, err := api.Prompt.ReadRendering(ctx, prompt, screen) + if err != nil { + return diag.FromErr(err) + } + + data.SetId(fmt.Sprintf("%s:%s", prompt, screen)) + + if err := flattenPromptScreenSettings(data, screenSettings); err != nil { + return diag.FromErr(err) + } + + return diag.FromErr(err) +} diff --git a/internal/auth0/prompt/data_source_screen_render_test.go b/internal/auth0/prompt/data_source_screen_render_test.go new file mode 100644 index 00000000..cbaa8030 --- /dev/null +++ b/internal/auth0/prompt/data_source_screen_render_test.go @@ -0,0 +1,99 @@ +package prompt_test + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/auth0/terraform-provider-auth0/internal/acctest" +) + +const testAccPromptScreenRenderWithoutScreens = testAccGivenACustomDomain + testGivenABrandingTemplate + ` +data "auth0_prompt_screen_renderer" "prompt_screen_render" { + prompt_type = "login-passwordless" +} +` +const testAccPromptScreenRenderInvalid = ` +data "auth0_prompt_screen_renderer" "prompt_screen_render" { + prompt_type = "login-xxxxx" + screen_name = "login-passwordless-email-code" +} +` + +const testAccPromptScreenRenderData = ` +resource "auth0_prompt_screen_renderer" "prompt_screen_render" { + prompt_type = "login-passwordless" + screen_name = "login-passwordless-email-code" + rendering_mode = "advanced" + context_configuration = [ + "branding.settings", + "branding.themes.default", + "client.logo_uri", + "client.description", + "organization.display_name", + "organization.branding", + "screen.texts", + "tenant.name", + "tenant.friendly_name", + "tenant.enabled_locales", + "untrusted_data.submitted_form_data", + "untrusted_data.authorization_params.ui_locales", + "untrusted_data.authorization_params.login_hint", + "untrusted_data.authorization_params.screen_hint" + ] + head_tags = jsonencode([ + { + attributes: { + "async": true, + "defer": true, + "integrity": [ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" + ], + "src": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" + }, + tag: "script" + } + ]) + + +} + +data "auth0_prompt_screen_renderer" "prompt_screen_render" { + depends_on = [ auth0_prompt_screen_renderer.prompt_screen_render ] + prompt_type = auth0_prompt_screen_renderer.prompt_screen_render.prompt_type + screen_name = auth0_prompt_screen_renderer.prompt_screen_render.screen_name +} +` + +func TestAccDataPromptScreenRender(t *testing.T) { + acctest.Test(t, resource.TestCase{ + Steps: []resource.TestStep{ + { + Config: `data "auth0_prompt_screen_renderer" "prompt_screen_render" { }`, + ExpectError: regexp.MustCompile("Error: Missing required argument"), + }, + { + Config: testAccPromptScreenRenderWithoutScreens, + ExpectError: regexp.MustCompile("Error: Missing required argument"), + }, + { + Config: testAccPromptScreenRenderInvalid, + ExpectError: regexp.MustCompile("expected prompt_type to be one of"), + }, + { + Config: testAccPromptScreenRenderData, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_render", "prompt_type", "login-passwordless"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_render", "screen_name", "login-passwordless-email-code"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_render", "rendering_mode", "advanced"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_render", "context_configuration.#", "14"), + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_render", "prompt_type", "login-passwordless"), + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_render", "screen_name", "login-passwordless-email-code"), + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_render", "rendering_mode", "advanced"), + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_render", "context_configuration.#", "14"), + ), + }, + }, + }) +} diff --git a/internal/auth0/prompt/expand.go b/internal/auth0/prompt/expand.go index e41255d7..147a684c 100644 --- a/internal/auth0/prompt/expand.go +++ b/internal/auth0/prompt/expand.go @@ -1,6 +1,8 @@ package prompt import ( + "encoding/json" + "github.com/auth0/go-auth0/management" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -94,3 +96,43 @@ func expandInsertionPoints(insertionPointsList []cty.Value) map[management.Inser return insertionPoints } + +func expandPromptSettings(data *schema.ResourceData) (*management.PromptRendering, error) { + promptRawSettings := data.GetRawConfig() + if promptRawSettings.IsNull() { + return nil, nil + } + + promptSettings := &management.PromptRendering{} + + promptSettings.RenderingMode = (*management.RenderingMode)(value.String(promptRawSettings.GetAttr("rendering_mode"))) + promptSettings.ContextConfiguration = value.Strings(promptRawSettings.GetAttr("context_configuration")) + promptSettings.DefaultHeadTagsDisabled = value.Bool(promptRawSettings.GetAttr("default_head_tags_disabled")) + if data.HasChange("head_tags") { + promptSettings.HeadTags = expandInterfaceArray(data, "head_tags") + } + + return promptSettings, nil +} + +func expandInterfaceArray(d *schema.ResourceData, key string) []interface{} { + _, newMetadata := d.GetChange(key) + result := make([]interface{}, 0) + if newMetadata == "" { + return result + } + + if newMetadataStr, ok := newMetadata.(string); ok { + var newMetadataArr []interface{} + if err := json.Unmarshal([]byte(newMetadataStr), &newMetadataArr); err != nil { + return nil + } + return newMetadataArr + } + + if newMetadataArr, ok := newMetadata.([]interface{}); ok { + return newMetadataArr + } + + return result +} diff --git a/internal/auth0/prompt/flatten.go b/internal/auth0/prompt/flatten.go index 0b662177..11bb9d95 100644 --- a/internal/auth0/prompt/flatten.go +++ b/internal/auth0/prompt/flatten.go @@ -144,3 +144,35 @@ func marshalCustomTextBody(b map[string]interface{}) (string, error) { return buffer.String(), nil } + +func flattenPromptScreenSettings(data *schema.ResourceData, promptSetting *management.PromptRendering) error { + var ( + idComponents = strings.Split(data.Id(), ":") + promptName, screenName = idComponents[0], idComponents[1] + ) + + result := multierror.Append( + data.Set("prompt_type", promptName), + data.Set("screen_name", screenName), + data.Set("tenant", promptSetting.GetTenant()), + data.Set("rendering_mode", promptSetting.GetRenderingMode()), + data.Set("default_head_tags_disabled", promptSetting.GetDefaultHeadTagsDisabled()), + data.Set("context_configuration", promptSetting.GetContextConfiguration()), + data.Set("head_tags", flattenHeadTags(promptSetting)), + ) + + return result.ErrorOrNil() +} + +func flattenHeadTags(promptSetting *management.PromptRendering) string { + if promptSetting == nil || promptSetting.HeadTags == nil { + return "" + } + + headTagBytes, err := json.Marshal(promptSetting.HeadTags) + if err != nil { + return "" + } + + return string(headTagBytes) +} diff --git a/internal/auth0/prompt/resource_screen_render.go b/internal/auth0/prompt/resource_screen_render.go new file mode 100644 index 00000000..2a30215d --- /dev/null +++ b/internal/auth0/prompt/resource_screen_render.go @@ -0,0 +1,257 @@ +package prompt + +import ( + "context" + "fmt" + "strings" + + "github.com/auth0/go-auth0/management" + + "github.com/auth0/terraform-provider-auth0/internal/config" + internalError "github.com/auth0/terraform-provider-auth0/internal/error" + + "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" +) + +var ( + allowedPromptsSettingsRenderer = []string{ + string(management.PromptSignupID), + string(management.PromptSignup), + string(management.PromptSignupPassword), + string(management.PromptLogin), + string(management.PromptLoginID), + string(management.PromptLoginPassword), + string(management.PromptLoginPasswordLess), + string(management.PromptLoginEmailVerification), + string(management.PromptPhoneIdentifierEnrollment), + string(management.PromptPhoneIdentifierChallenge), + string(management.PromptEmailIdentifierChallenge), + string(management.PromptResetPassword), + string(management.PromptCustomForm), + string(management.PromptConsent), + string(management.PromptCustomizedConsent), + string(management.PromptLogout), + string(management.PromptMFAPush), + string(management.PromptMFAOTP), + string(management.PromptMFAVoice), + string(management.PromptMFAPhone), + string(management.PromptMFAWebAuthn), + string(management.PromptMFASMS), + string(management.PromptMFAEmail), + string(management.PromptMFARecoveryCode), + string(management.PromptMFA), + string(management.PromptStatus), + string(management.PromptDeviceFlow), + string(management.PromptEmailVerification), + string(management.PromptEmailOTPChallenge), + string(management.PromptOrganizations), + string(management.PromptInvitation), + string(management.PromptCommon), + string(management.PromptPasskeys), + string(management.PromptCaptcha), + } + allowedScreensSettingsRenderer = []string{ + string(management.ScreenLogin), + string(management.ScreenLoginID), + string(management.ScreenLoginPassword), + string(management.ScreenSignup), + string(management.ScreenSignupID), + string(management.ScreenSignupPassword), + string(management.ScreenLoginPasswordlessSMSOTP), + string(management.ScreenLoginPasswordlessEmailCode), + string(management.ScreenLoginPasswordlessEmailLink), + string(management.ScreenLoginEmailVerification), + string(management.ScreenPhoneIdentifierEnrollment), + string(management.ScreenPhoneIdentifierChallenge), + string(management.ScreenEmailIdentifierChallenge), + string(management.ScreenResetPasswordRequest), + string(management.ScreenResetPasswordEmail), + string(management.ScreenResetPassword), + string(management.ScreenResetPasswordSuccess), + string(management.ScreenResetPasswordError), + string(management.ScreenResetPasswordMFAEmailChallenge), + string(management.ScreenResetPasswordMFAOTPChallenge), + string(management.ScreenResetPasswordMFAPhoneChallenge), + string(management.ScreenResetPasswordMFAPushChallengePush), + string(management.ScreenResetPasswordMFARecoveryCodeChallenge), + string(management.ScreenResetPasswordMFASMSChallenge), + string(management.ScreenResetPasswordMFAVoiceChallenge), + string(management.ScreenResetPasswordMFAWebAuthnPlatformChallenge), + string(management.ScreenResetPasswordMFAWebAuthnRoamingChallenge), + string(management.ScreenCustomForm), + string(management.ScreenConsent), + string(management.ScreenCustomizedConsent), + string(management.ScreenLogout), + string(management.ScreenLogoutComplete), + string(management.ScreenLogoutAborted), + string(management.ScreenMFAPushWelcome), + string(management.ScreenMFAPushEnrollmentQR), + string(management.ScreenMFAPushEnrollmentCode), + string(management.ScreenMFAPushSuccess), + string(management.ScreenMFAPushChallengePush), + string(management.ScreenMFAPushList), + string(management.ScreenMFAOTPEnrollmentQR), + string(management.ScreenMFAOTPEnrollmentCode), + string(management.ScreenMFAOTPChallenge), + string(management.ScreenMFAVoiceEnrollment), + string(management.ScreenMFAVoiceChallenge), + string(management.ScreenMFAPhoneChallenge), + string(management.ScreenMFAPhoneEnrollment), + string(management.ScreenMFAWebAuthnPlatformEnrollment), + string(management.ScreenMFAWebAuthnRoamingEnrollment), + string(management.ScreenMFAWebAuthnPlatformChallenge), + string(management.ScreenMFAWebAuthnRoamingChallenge), + string(management.ScreenMFAWebAuthnChangeKeyNickname), + string(management.ScreenMFAWebAuthnEnrollmentSuccess), + string(management.ScreenMFAWebAuthnError), + string(management.ScreenMFAWebAuthnNotAvailableError), + string(management.ScreenMFACountryCodes), + string(management.ScreenMFASMSEnrollment), + string(management.ScreenMFASMSChallenge), + string(management.ScreenMFASMSList), + string(management.ScreenMFAEmailChallenge), + string(management.ScreenMFAEmailList), + string(management.ScreenMFARecoveryCodeEnrollment), + string(management.ScreenMFARecoveryCodeChallenge), + string(management.ScreenMFADetectBrowserCapabilities), + string(management.ScreenMFAEnrollResult), + string(management.ScreenMFALoginOptions), + string(management.ScreenMFABeginEnrollOptions), + string(management.ScreenStatus), + string(management.ScreenDeviceCodeActivation), + string(management.ScreenDeviceCodeActivationAllowed), + string(management.ScreenDeviceCodeActivationDenied), + string(management.ScreenDeviceCodeConfirmation), + string(management.ScreenEmailVerificationResult), + string(management.ScreenEmailOTPChallenge), + string(management.ScreenOrganizationSelection), + string(management.ScreenOrganizationPicker), + string(management.ScreenAcceptInvitation), + string(management.ScreenRedeemTicket), + string(management.ScreenPasskeyEnrollment), + string(management.ScreenPasskeyEnrollmentLocal), + string(management.ScreenInterstitialCaptcha), + } + + supportedRenderingModes = []string{string(management.RenderingModeStandard), string(management.RenderingModeAdvanced)} +) + +// NewPromptScreenRenderResource will return a new auth0_prompt_screen_renderer resource. +func NewPromptScreenRenderResource() *schema.Resource { + return &schema.Resource{ + CreateContext: createPromptScreenRenderer, + ReadContext: readPromptScreenRenderer, + UpdateContext: updatePromptScreenRenderer, + DeleteContext: deletePromptScreenRenderer, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Description: "With this resource, you can Configure the render settings for a specific screen." + + "You can read more about this.", + Schema: map[string]*schema.Schema{ + "prompt_type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(allowedPromptsSettingsRenderer, false), + Description: "The prompt that you are configuring settings for. " + + "Options are: `" + strings.Join(allowedPromptsSettingsRenderer, "`, `") + "`.", + }, + "screen_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(allowedScreensSettingsRenderer, false), + Description: "The screen that you are configuring settings for. " + + "Options are: `" + strings.Join(allowedScreensSettingsRenderer, "`, `") + "`.", + }, + "rendering_mode": { + Type: schema.TypeString, + Optional: true, + Default: management.RenderingModeStandard, + ValidateFunc: validation.StringInSlice(supportedRenderingModes, false), + Description: "Rendering mode" + + "Options are: `" + strings.Join(supportedRenderingModes, "`, `") + "`.", + }, + "tenant": { + Type: schema.TypeString, + Computed: true, + Description: "Tenant ID", + }, + "context_configuration": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: "Context values to make available", + }, + "default_head_tags_disabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Override Universal Login default head tags", + }, + "head_tags": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringIsJSON, + DiffSuppressFunc: structure.SuppressJsonDiff, + Description: "An array of head tags", + }, + }, + } +} + +func createPromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { + promptName := data.Get("prompt_type").(string) + screenName := data.Get("screen_name").(string) + data.SetId(fmt.Sprintf("%s:%s", promptName, screenName)) + return updatePromptScreenRenderer(ctx, data, meta) +} + +func readPromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + promptScreenSettings, err := api.Prompt.ReadRendering(ctx, management.PromptType(strings.Split(data.Id(), ":")[0]), management.ScreenName(strings.Split(data.Id(), ":")[1])) + if err != nil { + return diag.FromErr(err) + } + return diag.FromErr(flattenPromptScreenSettings(data, promptScreenSettings)) +} + +func updatePromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + prompt := management.PromptType(data.Get("prompt_type").(string)) + screen := management.ScreenName(data.Get("screen_name").(string)) + + promptSettings, err := expandPromptSettings(data) + if err != nil { + return diag.FromErr(err) + } + + if err := api.Prompt.UpdateRendering(ctx, prompt, screen, promptSettings); err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return readPromptScreenRenderer(ctx, data, meta) +} + +func deletePromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + idComponents := strings.Split(data.Id(), ":") + promptName, screenName := idComponents[0], idComponents[1] + + prompt := management.PromptType(promptName) + screen := management.ScreenName(screenName) + + promptSettings := &management.PromptRendering{RenderingMode: &management.RenderingModeStandard} + if err := api.Prompt.UpdateRendering(ctx, prompt, screen, promptSettings); err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return nil +} diff --git a/internal/auth0/prompt/resource_screen_render_test.go b/internal/auth0/prompt/resource_screen_render_test.go new file mode 100644 index 00000000..044f17c3 --- /dev/null +++ b/internal/auth0/prompt/resource_screen_render_test.go @@ -0,0 +1,181 @@ +package prompt_test + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/auth0/terraform-provider-auth0/internal/acctest" +) + +const ( + testAccPromptScreenRenderWithoutScreensInfo = testAccGivenACustomDomain + testGivenABrandingTemplate + ` +resource "auth0_prompt_screen_renderer" "prompt_screen_render" { + prompt_type = "login-passwordless" +} +` + + testAccPromptScreenRenderWithoutPromptsInfo = testAccGivenACustomDomain + testGivenABrandingTemplate + ` +resource "auth0_prompt_screen_renderer" "prompt_screen_render" { + screen_name = "login-passwordless" +} +` + + testAccPromptScreenRenderInvalidInfo = ` +resource "auth0_prompt_screen_renderer" "prompt_screen_render" { + prompt_type = "login-xxxxx" + screen_name = "login-passwordless-email-code" +} +` + + testAccPromptScreenRenderWithoutSettings = ` +resource "auth0_prompt_screen_renderer" "login-id" { + prompt_type = "login-id" + screen_name = "login-id" +} +` + + testAccPromptScreenRenderCreate = testAccPromptScreenRenderWithoutSettings + ` +resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" { + prompt_type = "logout" + screen_name = "logout" + rendering_mode = "advanced" + + head_tags = jsonencode([ + { + attributes: { + "async": true, + "defer": true, + "integrity": [ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" + ], + "src": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" + }, + tag: "script" + } + ]) + + context_configuration = [ + "branding.settings", + "branding.themes.default", + "client.logo_uri", + "client.description", + "organization.display_name", + "organization.branding", + "screen.texts", + "tenant.name", + "tenant.friendly_name", + "tenant.enabled_locales", + "untrusted_data.submitted_form_data", + "untrusted_data.authorization_params.login_hint", + "untrusted_data.authorization_params.screen_hint", + "untrusted_data.authorization_params.ui_locales", + "organization.metadata.key", + ] +} +` + + testAccPromptScreenRenderUpdate = ` +resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" { + prompt_type = "logout" + screen_name = "logout" + rendering_mode = "advanced" + + head_tags = jsonencode([ + { + attributes: { + "async": true, + "defer": true, + "integrity": [ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" + ], + "src": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" + }, + tag: "script" + } + ]) + + context_configuration = [ + "branding.settings", + "branding.themes.default", + "client.logo_uri", + "client.description", + "organization.display_name", + "organization.branding", + "screen.texts", + "tenant.name", + "tenant.friendly_name", + "untrusted_data.authorization_params.login_hint", + "untrusted_data.authorization_params.ui_locales", + ] +} +` + + testAccPromptScreenRenderDelete = testAccPromptScreenRenderWithoutSettings + + testAccPromptScreenRenderDataAfterDelete = ` +data "auth0_prompt_screen_renderer" "prompt_screen_renderer" { + prompt_type = "logout" + screen_name = "logout" +} +` +) + +func TestAccPromptScreenSettings(t *testing.T) { + acctest.Test(t, resource.TestCase{ + Steps: []resource.TestStep{ + { + Config: testAccPromptScreenRenderWithoutScreensInfo, + ExpectError: regexp.MustCompile("Error: Missing required argument"), + }, + { + Config: testAccPromptScreenRenderWithoutPromptsInfo, + ExpectError: regexp.MustCompile("Error: Missing required argument"), + }, + { + Config: testAccPromptScreenRenderInvalidInfo, + ExpectError: regexp.MustCompile("expected prompt_type to be one of"), + }, + { + Config: testAccPromptScreenRenderWithoutSettings, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.login-id", "prompt_type", "login-id"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.login-id", "screen_name", "login-id"), + resource.TestCheckResourceAttrSet("auth0_prompt_screen_renderer.login-id", "id"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.login-id", "rendering_mode", "standard"), + ), + }, + { + Config: testAccPromptScreenRenderCreate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "logout"), + resource.TestCheckResourceAttrSet("auth0_prompt_screen_renderer.prompt_screen_renderer", "id"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "advanced"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "context_configuration.#", "15"), + ), + }, + { + Config: testAccPromptScreenRenderUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "logout"), + resource.TestCheckResourceAttrSet("auth0_prompt_screen_renderer.prompt_screen_renderer", "id"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "advanced"), + resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "context_configuration.#", "11"), + ), + }, + { + Config: testAccPromptScreenRenderDelete, + }, + { + Config: testAccPromptScreenRenderDataAfterDelete, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"), + resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "standard"), + ), + }, + }, + }) +} diff --git a/internal/auth0/user/resource.go b/internal/auth0/user/resource.go index a863e565..2ad94a30 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(_, o, n string, _ *schema.ResourceData) bool { - return o == "auth0|"+n + DiffSuppressFunc: func(_, oldVal, newVal string, _ *schema.ResourceData) bool { + return oldVal == "auth0|"+newVal }, Description: "ID of the user.", }, diff --git a/internal/auth0/user/resource_role.go b/internal/auth0/user/resource_role.go index 82ae4069..3e7c44af 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(_, o, n string, _ *schema.ResourceData) bool { - return o == "auth0|"+n + DiffSuppressFunc: func(_, oldVal, newVal string, _ *schema.ResourceData) bool { + return oldVal == "auth0|"+newVal }, Description: "ID of the user.", }, diff --git a/internal/auth0/user/resource_roles.go b/internal/auth0/user/resource_roles.go index 83612ceb..174b86d1 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(_, o, n string, _ *schema.ResourceData) bool { - return o == "auth0|"+n + DiffSuppressFunc: func(_, oldVal, newVal string, _ *schema.ResourceData) bool { + return oldVal == "auth0|"+newVal }, Description: "ID of the user.", }, diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 7369bb9b..bdf77e03 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -133,6 +133,7 @@ func New() *schema.Provider { "auth0_prompt_partials": prompt.NewPartialsResource(), "auth0_prompt_screen_partial": prompt.NewScreenPartialResource(), "auth0_prompt_screen_partials": prompt.NewScreenPartialsResource(), + "auth0_prompt_screen_renderer": prompt.NewPromptScreenRenderResource(), "auth0_resource_server": resourceserver.NewResource(), "auth0_resource_server_scope": resourceserver.NewScopeResource(), "auth0_resource_server_scopes": resourceserver.NewScopesResource(), @@ -165,6 +166,7 @@ func New() *schema.Provider { "auth0_organization": organization.NewDataSource(), "auth0_pages": page.NewDataSource(), "auth0_prompt_screen_partials": prompt.NewPromptScreenPartialsDataSource(), + "auth0_prompt_screen_renderer": prompt.NewPromptScreenRenderDataSource(), "auth0_resource_server": resourceserver.NewDataSource(), "auth0_role": role.NewDataSource(), "auth0_self_service_profile": selfserviceprofile.NewDataSource(), diff --git a/test/data/recordings/TestAccDataPromptScreenRender.yaml b/test/data/recordings/TestAccDataPromptScreenRender.yaml new file mode 100644 index 00000000..34994151 --- /dev/null +++ b/test/data/recordings/TestAccDataPromptScreenRender.yaml @@ -0,0 +1,250 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 713 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"head_tags":[{"attributes":{"async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="],"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"},"tag":"script"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"head_tags":[{"attributes":{"async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="],"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"},"tag":"script"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 438.556542ms + - 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/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-passwordless","screen":"login-passwordless-email-code","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 410.677125ms + - id: 2 + 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/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-passwordless","screen":"login-passwordless-email-code","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 399.040291ms + - 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/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-passwordless","screen":"login-passwordless-email-code","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 430.0045ms + - 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/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-passwordless","screen":"login-passwordless-email-code","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 421.14175ms + - 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/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-passwordless","screen":"login-passwordless-email-code","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 392.783209ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"standard"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/login-passwordless/screen/login-passwordless-email-code/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 29 + uncompressed: false + body: '{"rendering_mode":"standard"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 406.853583ms diff --git a/test/data/recordings/TestAccPromptScreenSettings.yaml b/test/data/recordings/TestAccPromptScreenSettings.yaml new file mode 100644 index 00000000..6de7ef2c --- /dev/null +++ b/test/data/recordings/TestAccPromptScreenSettings.yaml @@ -0,0 +1,850 @@ +--- +version: 2 +interactions: + - id: 0 + 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/prompts/login-id/screen/login-id/rendering + method: PATCH + 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: 405.570916ms + - 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 380.146042ms + - id: 2 + 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 405.612458ms + - 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 666.710083ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 741 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","organization.metadata.key","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"head_tags":[{"attributes":{"async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="],"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"},"tag":"script"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/logout/screen/logout/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","organization.metadata.key","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"head_tags":[{"attributes":{"async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="],"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"},"tag":"script"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 633.048625ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","organization.metadata.key","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 377.745791ms + - 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 444.621458ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","organization.metadata.key","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 444.686ms + - id: 8 + 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 375.254458ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","organization.metadata.key","screen.texts","tenant.enabled_locales","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.screen_hint","untrusted_data.authorization_params.ui_locales","untrusted_data.submitted_form_data"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 383.805041ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"standard"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/login-id/screen/login-id/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 29 + uncompressed: false + body: '{"rendering_mode":"standard"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 379.831417ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 343 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/logout/screen/logout/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 423.4195ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 403.72325ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 380.634542ms + - id: 14 + 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 389.286083ms + - id: 15 + 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/prompts/login-id/screen/login-id/rendering + method: PATCH + 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: 376.224166ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"standard"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/logout/screen/logout/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 29 + uncompressed: false + body: '{"rendering_mode":"standard"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 402.608209ms + - 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 357.666834ms + - 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 363.972083ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"standard","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 416.689541ms + - id: 20 + 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/prompts/login-id/screen/login-id/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"login-id","screen":"login-id","rendering_mode":"standard","context_configuration":[],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"http://127.0.0.1:8080/index.js","defer":true}},{"tag":"link","attributes":{"rel":"stylesheet","href":"http://127.0.0.1:8090/index.css"}},{"tag":"meta","attributes":{"name":"viewport","content":"width=device-width, initial-scale=1"}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 416.800667ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"standard"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/prompts/login-id/screen/login-id/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 29 + uncompressed: false + body: '{"rendering_mode":"standard"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 388.451333ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"standard","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 359.424ms + - 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/prompts/logout/screen/logout/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"terraform-provider-auth0-dev","prompt":"logout","screen":"logout","rendering_mode":"standard","context_configuration":["branding.settings","branding.themes.default","client.description","client.logo_uri","organization.branding","organization.display_name","screen.texts","tenant.friendly_name","tenant.name","untrusted_data.authorization_params.login_hint","untrusted_data.authorization_params.ui_locales"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","attributes":{"src":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js","async":true,"defer":true,"integrity":["sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="]}}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 395.559209ms