diff --git a/management/management.gen.go b/management/management.gen.go index 965e1274..5ea6e7ce 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -9067,6 +9067,59 @@ func (p *PromptPartials) String() string { return Stringify(p) } +// GetContextConfiguration returns the ContextConfiguration field if it's non-nil, zero value otherwise. +func (p *PromptRendering) GetContextConfiguration() []string { + if p == nil || p.ContextConfiguration == nil { + return nil + } + return *p.ContextConfiguration +} + +// GetDefaultHeadTagsDisabled returns the DefaultHeadTagsDisabled field if it's non-nil, zero value otherwise. +func (p *PromptRendering) GetDefaultHeadTagsDisabled() bool { + if p == nil || p.DefaultHeadTagsDisabled == nil { + return false + } + return *p.DefaultHeadTagsDisabled +} + +// GetPrompt returns the Prompt field. +func (p *PromptRendering) GetPrompt() *PromptType { + if p == nil { + return nil + } + return p.Prompt +} + +// GetRenderingMode returns the RenderingMode field. +func (p *PromptRendering) GetRenderingMode() *RenderingMode { + if p == nil { + return nil + } + return p.RenderingMode +} + +// GetScreen returns the Screen field. +func (p *PromptRendering) GetScreen() *ScreenName { + if p == nil { + return nil + } + return p.Screen +} + +// GetTenant returns the Tenant field if it's non-nil, zero value otherwise. +func (p *PromptRendering) GetTenant() string { + if p == nil || p.Tenant == nil { + return "" + } + return *p.Tenant +} + +// String returns a string representation of PromptRendering. +func (p *PromptRendering) String() string { + return Stringify(p) +} + // GetClientID returns the ClientID field if it's non-nil, zero value otherwise. func (r *RefreshToken) GetClientID() string { if r == nil || r.ClientID == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index af599f53..a1f9a353 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -11380,6 +11380,65 @@ func TestPromptPartials_String(t *testing.T) { } } +func TestPromptRendering_GetContextConfiguration(tt *testing.T) { + var zeroValue []string + p := &PromptRendering{ContextConfiguration: &zeroValue} + p.GetContextConfiguration() + p = &PromptRendering{} + p.GetContextConfiguration() + p = nil + p.GetContextConfiguration() +} + +func TestPromptRendering_GetDefaultHeadTagsDisabled(tt *testing.T) { + var zeroValue bool + p := &PromptRendering{DefaultHeadTagsDisabled: &zeroValue} + p.GetDefaultHeadTagsDisabled() + p = &PromptRendering{} + p.GetDefaultHeadTagsDisabled() + p = nil + p.GetDefaultHeadTagsDisabled() +} + +func TestPromptRendering_GetPrompt(tt *testing.T) { + p := &PromptRendering{} + p.GetPrompt() + p = nil + p.GetPrompt() +} + +func TestPromptRendering_GetRenderingMode(tt *testing.T) { + p := &PromptRendering{} + p.GetRenderingMode() + p = nil + p.GetRenderingMode() +} + +func TestPromptRendering_GetScreen(tt *testing.T) { + p := &PromptRendering{} + p.GetScreen() + p = nil + p.GetScreen() +} + +func TestPromptRendering_GetTenant(tt *testing.T) { + var zeroValue string + p := &PromptRendering{Tenant: &zeroValue} + p.GetTenant() + p = &PromptRendering{} + p.GetTenant() + p = nil + p.GetTenant() +} + +func TestPromptRendering_String(t *testing.T) { + var rawJSON json.RawMessage + v := &PromptRendering{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + func TestRefreshToken_GetClientID(tt *testing.T) { var zeroValue string r := &RefreshToken{ClientID: &zeroValue} diff --git a/management/prompt.go b/management/prompt.go index 45c68857..069c9909 100644 --- a/management/prompt.go +++ b/management/prompt.go @@ -6,6 +6,17 @@ import ( "fmt" ) +// RenderingMode is a type that represents the rendering mode. +type RenderingMode string + +var ( + // RenderingModeStandard represents the standard rendering mode. + RenderingModeStandard RenderingMode = "standard" + + // RenderingModeAdvanced represents the advanced rendering mode. + RenderingModeAdvanced RenderingMode = "advanced" +) + const ( // PromptSignup represents the signup prompt. PromptSignup PromptType = "signup" @@ -27,6 +38,87 @@ const ( // PromptLoginPasswordLess represents the login-passwordless prompt. PromptLoginPasswordLess PromptType = "login-passwordless" + + // PromptLoginEmailVerification represents the login-email-verification prompt. + PromptLoginEmailVerification PromptType = "login-email-verification" + + // PromptPhoneIdentifierEnrollment represents the phone-identifier-enrollment prompt. + PromptPhoneIdentifierEnrollment PromptType = "phone-identifier-enrollment" + + // PromptPhoneIdentifierChallenge represents the phone-identifier-challenge prompt. + PromptPhoneIdentifierChallenge PromptType = "phone-identifier-challenge" + + // PromptEmailIdentifierChallenge represents the email-identifier-challenge prompt. + PromptEmailIdentifierChallenge PromptType = "email-identifier-challenge" + + // PromptResetPassword represents the reset-password prompt. + PromptResetPassword PromptType = "reset-password" + + // PromptCustomForm represents the custom-form prompt. + PromptCustomForm PromptType = "custom-form" + + // PromptConsent represents the consent prompt. + PromptConsent PromptType = "consent" + + // PromptCustomizedConsent represents the customized-consent prompt. + PromptCustomizedConsent PromptType = "customized-consent" + + // PromptLogout represents the logout prompt. + PromptLogout PromptType = "logout" + + // PromptMFAPush represents the mfa-push prompt. + PromptMFAPush PromptType = "mfa-push" + + // PromptMFAOTP represents the mfa-otp prompt. + PromptMFAOTP PromptType = "mfa-otp" + + // PromptMFAVoice represents the mfa-voice prompt. + PromptMFAVoice PromptType = "mfa-voice" + + // PromptMFAPhone represents the mfa-phone prompt. + PromptMFAPhone PromptType = "mfa-phone" + + // PromptMFAWebAuthn represents the mfa-webauthn prompt. + PromptMFAWebAuthn PromptType = "mfa-webauthn" + + // PromptMFASMS represents the mfa-sms prompt. + PromptMFASMS PromptType = "mfa-sms" + + // PromptMFAEmail represents the mfa-email prompt. + PromptMFAEmail PromptType = "mfa-email" + + // PromptMFARecoveryCode represents the mfa-recovery-code prompt. + PromptMFARecoveryCode PromptType = "mfa-recovery-code" + + // PromptMFA represents the mfa prompt. + PromptMFA PromptType = "mfa" + + // PromptStatus represents the status prompt. + PromptStatus PromptType = "status" + + // PromptDeviceFlow represents the device-flow prompt. + PromptDeviceFlow PromptType = "device-flow" + + // PromptEmailVerification represents the email-verification prompt. + PromptEmailVerification PromptType = "email-verification" + + // PromptEmailOTPChallenge represents the email-otp-challenge prompt. + PromptEmailOTPChallenge PromptType = "email-otp-challenge" + + // PromptOrganizations represents the organizations prompt. + PromptOrganizations PromptType = "organizations" + + // PromptInvitation represents the invitation prompt. + PromptInvitation PromptType = "invitation" + + // PromptCommon represents the common prompt. + PromptCommon PromptType = "common" + + // PromptPasskeys represents the passkeys prompt. + PromptPasskeys PromptType = "passkeys" + + // PromptCaptcha represents the captcha prompt. + PromptCaptcha PromptType = "captcha" ) var allowedPromptsWithPartials = []PromptType{ @@ -58,6 +150,18 @@ const ( // ScreenLoginPassword represents the login-password screen. ScreenLoginPassword ScreenName = "login-password" + // ScreenLoginPasswordlessEmailCode represents the login-passwordless-email-code screen. + ScreenLoginPasswordlessEmailCode ScreenName = "login-passwordless-email-code" + + // ScreenLoginPasswordlessEmailLink represents the login-passwordless-email-link screen. + ScreenLoginPasswordlessEmailLink ScreenName = "login-passwordless-email-link" + + // ScreenLoginPasswordlessSMSOTP represents the login-passwordless-sms-otp screen. + ScreenLoginPasswordlessSMSOTP ScreenName = "login-passwordless-sms-otp" + + // ScreenLoginEmailVerification represents the login-email-verification screen. + ScreenLoginEmailVerification ScreenName = "login-email-verification" + // ScreenSignup represents the signup screen. ScreenSignup ScreenName = "signup" @@ -67,11 +171,215 @@ const ( // ScreenSignupPassword represents the signup-password screen. ScreenSignupPassword ScreenName = "signup-password" - // ScreenLoginPasswordlessSMSOTP represents the login-passwordless-sms-otp screen. - ScreenLoginPasswordlessSMSOTP ScreenName = "login-passwordless-sms-otp" + // ScreenPhoneIdentifierEnrollment represents the phone-identifier-enrollment screen. + ScreenPhoneIdentifierEnrollment ScreenName = "phone-identifier-enrollment" - // ScreenLoginPasswordlessEmailCode represents the login-passwordless-email-code screen. - ScreenLoginPasswordlessEmailCode ScreenName = "login-passwordless-email-code" + // ScreenPhoneIdentifierChallenge represents the phone-identifier-challenge screen. + ScreenPhoneIdentifierChallenge ScreenName = "phone-identifier-challenge" + + // ScreenEmailIdentifierChallenge represents the email-identifier-challenge screen. + ScreenEmailIdentifierChallenge ScreenName = "email-identifier-challenge" + + // ScreenResetPasswordRequest represents the reset-password-request screen. + ScreenResetPasswordRequest ScreenName = "reset-password-request" + + // ScreenResetPasswordEmail represents the reset-password-email screen. + ScreenResetPasswordEmail ScreenName = "reset-password-email" + + // ScreenResetPassword represents the reset-password screen. + ScreenResetPassword ScreenName = "reset-password" + + // ScreenResetPasswordSuccess represents the reset-password-success screen. + ScreenResetPasswordSuccess ScreenName = "reset-password-success" + + // ScreenResetPasswordError represents the reset-password-error screen. + ScreenResetPasswordError ScreenName = "reset-password-error" + + // ScreenResetPasswordMFAEmailChallenge represents the reset-password-mfa-email-challenge screen. + ScreenResetPasswordMFAEmailChallenge ScreenName = "reset-password-mfa-email-challenge" + + // ScreenResetPasswordMFAOTPChallenge represents the reset-password-mfa-otp-challenge screen. + ScreenResetPasswordMFAOTPChallenge ScreenName = "reset-password-mfa-otp-challenge" + + // ScreenResetPasswordMFAPhoneChallenge represents the reset-password-mfa-phone-challenge screen. + ScreenResetPasswordMFAPhoneChallenge ScreenName = "reset-password-mfa-phone-challenge" + + // ScreenResetPasswordMFAPushChallengePush represents the reset-password-mfa-push-challenge-push screen. + ScreenResetPasswordMFAPushChallengePush ScreenName = "reset-password-mfa-push-challenge-push" + + // ScreenResetPasswordMFARecoveryCodeChallenge represents the reset-password-mfa-recovery-code-challenge screen. + ScreenResetPasswordMFARecoveryCodeChallenge ScreenName = "reset-password-mfa-recovery-code-challenge" + + // ScreenResetPasswordMFASMSChallenge represents the reset-password-mfa-sms-challenge screen. + ScreenResetPasswordMFASMSChallenge ScreenName = "reset-password-mfa-sms-challenge" + + // ScreenResetPasswordMFAVoiceChallenge represents the reset-password-mfa-voice-challenge screen. + ScreenResetPasswordMFAVoiceChallenge ScreenName = "reset-password-mfa-voice-challenge" + + // ScreenResetPasswordMFAWebAuthnPlatformChallenge represents the reset-password-mfa-webauthn-platform-challenge screen. + ScreenResetPasswordMFAWebAuthnPlatformChallenge ScreenName = "reset-password-mfa-webauthn-platform-challenge" + + // ScreenResetPasswordMFAWebAuthnRoamingChallenge represents the reset-password-mfa-webauthn-roaming-challenge screen. + ScreenResetPasswordMFAWebAuthnRoamingChallenge ScreenName = "reset-password-mfa-webauthn-roaming-challenge" + + // ScreenCustomForm represents the custom-form screen. + ScreenCustomForm ScreenName = "custom-form" + + // ScreenConsent represents the consent screen. + ScreenConsent ScreenName = "consent" + + // ScreenCustomizedConsent represents the customized-consent screen. + ScreenCustomizedConsent ScreenName = "customized-consent" + + // ScreenLogout represents the logout screen. + ScreenLogout ScreenName = "logout" + + // ScreenLogoutComplete represents the logout-complete screen. + ScreenLogoutComplete ScreenName = "logout-complete" + + // ScreenLogoutAborted represents the logout-aborted screen. + ScreenLogoutAborted ScreenName = "logout-aborted" + + // ScreenMFAPushWelcome represents the mfa-push-welcome screen. + ScreenMFAPushWelcome ScreenName = "mfa-push-welcome" + + // ScreenMFAPushEnrollmentQR represents the mfa-push-enrollment-qr screen. + ScreenMFAPushEnrollmentQR ScreenName = "mfa-push-enrollment-qr" + + // ScreenMFAPushEnrollmentCode represents the mfa-push-enrollment-code screen. + ScreenMFAPushEnrollmentCode ScreenName = "mfa-push-enrollment-code" + + // ScreenMFAPushSuccess represents the mfa-push-success screen. + ScreenMFAPushSuccess ScreenName = "mfa-push-success" + + // ScreenMFAPushChallengePush represents the mfa-push-challenge-push screen. + ScreenMFAPushChallengePush ScreenName = "mfa-push-challenge-push" + + // ScreenMFAPushList represents the mfa-push-list screen. + ScreenMFAPushList ScreenName = "mfa-push-list" + + // ScreenMFAOTPEnrollmentQR represents the mfa-otp-enrollment-qr screen. + ScreenMFAOTPEnrollmentQR ScreenName = "mfa-otp-enrollment-qr" + + // ScreenMFAOTPEnrollmentCode represents the mfa-otp-enrollment-code screen. + ScreenMFAOTPEnrollmentCode ScreenName = "mfa-otp-enrollment-code" + + // ScreenMFAOTPChallenge represents the mfa-otp-challenge screen. + ScreenMFAOTPChallenge ScreenName = "mfa-otp-challenge" + + // ScreenMFAVoiceEnrollment represents the mfa-voice-enrollment screen. + ScreenMFAVoiceEnrollment ScreenName = "mfa-voice-enrollment" + + // ScreenMFAVoiceChallenge represents the mfa-voice-challenge screen. + ScreenMFAVoiceChallenge ScreenName = "mfa-voice-challenge" + + // ScreenMFAPhoneChallenge represents the mfa-phone-challenge screen. + ScreenMFAPhoneChallenge ScreenName = "mfa-phone-challenge" + + // ScreenMFAPhoneEnrollment represents the mfa-phone-enrollment screen. + ScreenMFAPhoneEnrollment ScreenName = "mfa-phone-enrollment" + + // ScreenMFAWebAuthnPlatformEnrollment represents the mfa-webauthn-platform-enrollment screen. + ScreenMFAWebAuthnPlatformEnrollment ScreenName = "mfa-webauthn-platform-enrollment" + + // ScreenMFAWebAuthnRoamingEnrollment represents the mfa-webauthn-roaming-enrollment screen. + ScreenMFAWebAuthnRoamingEnrollment ScreenName = "mfa-webauthn-roaming-enrollment" + + // ScreenMFAWebAuthnPlatformChallenge represents the mfa-webauthn-platform-challenge screen. + ScreenMFAWebAuthnPlatformChallenge ScreenName = "mfa-webauthn-platform-challenge" + + // ScreenMFAWebAuthnRoamingChallenge represents the mfa-webauthn-roaming-challenge screen. + ScreenMFAWebAuthnRoamingChallenge ScreenName = "mfa-webauthn-roaming-challenge" + + // ScreenMFAWebAuthnChangeKeyNickname represents the mfa-webauthn-change-key-nickname screen. + ScreenMFAWebAuthnChangeKeyNickname ScreenName = "mfa-webauthn-change-key-nickname" + + // ScreenMFAWebAuthnEnrollmentSuccess represents the mfa-webauthn-enrollment-success screen. + ScreenMFAWebAuthnEnrollmentSuccess ScreenName = "mfa-webauthn-enrollment-success" + + // ScreenMFAWebAuthnError represents the mfa-webauthn-error screen. + ScreenMFAWebAuthnError ScreenName = "mfa-webauthn-error" + + // ScreenMFAWebAuthnNotAvailableError represents the mfa-webauthn-not-available-error screen. + ScreenMFAWebAuthnNotAvailableError ScreenName = "mfa-webauthn-not-available-error" + + // ScreenMFACountryCodes represents the mfa-country-codes screen. + ScreenMFACountryCodes ScreenName = "mfa-country-codes" + + // ScreenMFASMSEnrollment represents the mfa-sms-enrollment screen. + ScreenMFASMSEnrollment ScreenName = "mfa-sms-enrollment" + + // ScreenMFASMSChallenge represents the mfa-sms-challenge screen. + ScreenMFASMSChallenge ScreenName = "mfa-sms-challenge" + + // ScreenMFASMSList represents the mfa-sms-list screen. + ScreenMFASMSList ScreenName = "mfa-sms-list" + + // ScreenMFAEmailChallenge represents the mfa-email-challenge screen. + ScreenMFAEmailChallenge ScreenName = "mfa-email-challenge" + + // ScreenMFAEmailList represents the mfa-email-list screen. + ScreenMFAEmailList ScreenName = "mfa-email-list" + + // ScreenMFARecoveryCodeEnrollment represents the mfa-recovery-code-enrollment screen. + ScreenMFARecoveryCodeEnrollment ScreenName = "mfa-recovery-code-enrollment" + + // ScreenMFARecoveryCodeChallenge represents the mfa-recovery-code-challenge screen. + ScreenMFARecoveryCodeChallenge ScreenName = "mfa-recovery-code-challenge" + + // ScreenMFADetectBrowserCapabilities represents the mfa-detect-browser-capabilities screen. + ScreenMFADetectBrowserCapabilities ScreenName = "mfa-detect-browser-capabilities" + + // ScreenMFAEnrollResult represents the mfa-enroll-result screen. + ScreenMFAEnrollResult ScreenName = "mfa-enroll-result" + + // ScreenMFALoginOptions represents the mfa-login-options screen. + ScreenMFALoginOptions ScreenName = "mfa-login-options" + + // ScreenMFABeginEnrollOptions represents the mfa-begin-enroll-options screen. + ScreenMFABeginEnrollOptions ScreenName = "mfa-begin-enroll-options" + + // ScreenStatus represents the status screen. + ScreenStatus ScreenName = "status" + + // ScreenDeviceCodeActivation represents the device-code-activation screen. + ScreenDeviceCodeActivation ScreenName = "device-code-activation" + + // ScreenDeviceCodeActivationAllowed represents the device-code-activation-allowed screen. + ScreenDeviceCodeActivationAllowed ScreenName = "device-code-activation-allowed" + + // ScreenDeviceCodeActivationDenied represents the device-code-activation-denied screen. + ScreenDeviceCodeActivationDenied ScreenName = "device-code-activation-denied" + + // ScreenDeviceCodeConfirmation represents the device-code-confirmation screen. + ScreenDeviceCodeConfirmation ScreenName = "device-code-confirmation" + + // ScreenEmailVerificationResult represents the email-verification-result screen. + ScreenEmailVerificationResult ScreenName = "email-verification-result" + + // ScreenEmailOTPChallenge represents the email-otp-challenge screen. + ScreenEmailOTPChallenge ScreenName = "email-otp-challenge" + + // ScreenOrganizationSelection represents the organization-selection screen. + ScreenOrganizationSelection ScreenName = "organization-selection" + + // ScreenOrganizationPicker represents the organization-picker screen. + ScreenOrganizationPicker ScreenName = "organization-picker" + + // ScreenAcceptInvitation represents the accept-invitation screen. + ScreenAcceptInvitation ScreenName = "accept-invitation" + + // ScreenRedeemTicket represents the redeem-ticket screen. + ScreenRedeemTicket ScreenName = "redeem-ticket" + + // ScreenPasskeyEnrollment represents the passkey-enrollment screen. + ScreenPasskeyEnrollment ScreenName = "passkey-enrollment" + + // ScreenPasskeyEnrollmentLocal represents the passkey-enrollment-local screen. + ScreenPasskeyEnrollmentLocal ScreenName = "passkey-enrollment-local" + + // ScreenInterstitialCaptcha represents the interstitial-captcha screen. + ScreenInterstitialCaptcha ScreenName = "interstitial-captcha" ) const ( @@ -133,6 +441,40 @@ type PromptPartials struct { Prompt PromptType `json:"-"` } +// PromptRendering is used to retrieve and set the settings for the ACUL. +type PromptRendering struct { + Tenant *string `json:"tenant,omitempty"` + Prompt *PromptType `json:"prompt,omitempty"` + Screen *ScreenName `json:"screen,omitempty"` + RenderingMode *RenderingMode `json:"rendering_mode,omitempty"` + ContextConfiguration *[]string `json:"context_configuration,omitempty"` + DefaultHeadTagsDisabled *bool `json:"default_head_tags_disabled,omitempty"` + HeadTags []interface{} `json:"head_tags,omitempty"` +} + +// MarshalJSON implements a custom [json.Marshaler]. +func (c *PromptRendering) MarshalJSON() ([]byte, error) { + type RenderingSubSet struct { + RenderingMode *RenderingMode `json:"rendering_mode,omitempty"` + ContextConfiguration *[]string `json:"context_configuration,omitempty"` + DefaultHeadTagsDisabled *bool `json:"default_head_tags_disabled,omitempty"` + HeadTags []interface{} `json:"head_tags,omitempty"` + } + + if c.RenderingMode != nil && *c.RenderingMode == RenderingModeStandard { + return json.Marshal(&RenderingSubSet{ + RenderingMode: c.RenderingMode, + }) + } + + return json.Marshal(&RenderingSubSet{ + RenderingMode: c.RenderingMode, + ContextConfiguration: c.ContextConfiguration, + DefaultHeadTagsDisabled: c.DefaultHeadTagsDisabled, + HeadTags: c.HeadTags, + }) +} + // MarshalJSON implements a custom [json.Marshaler]. func (c *PromptPartials) MarshalJSON() ([]byte, error) { body := map[string]PromptPartials{ @@ -289,3 +631,18 @@ func guardAgainstPromptTypesWithNoPartials(prompt PromptType) error { return fmt.Errorf("cannot customize partials for prompt: %q", prompt) } + +// ReadRendering retrieves the settings for the ACUL. +// +// See: https://auth0.com/docs/api/management/v2/prompts/get-rendering +func (m *PromptManager) ReadRendering(ctx context.Context, prompt PromptType, screen ScreenName, opts ...RequestOption) (c *PromptRendering, err error) { + err = m.management.Request(ctx, "GET", m.management.URI("prompts", string(prompt), "screen", string(screen), "rendering"), &c, opts...) + return +} + +// UpdateRendering updates the settings for the ACUL. +// +// See: https://auth0.com/docs/api/management/v2/prompts/patch-rendering +func (m *PromptManager) UpdateRendering(ctx context.Context, prompt PromptType, screen ScreenName, c *PromptRendering, opts ...RequestOption) error { + return m.management.Request(ctx, "PATCH", m.management.URI("prompts", string(prompt), "screen", string(screen), "rendering"), c, opts...) +} diff --git a/management/prompt_test.go b/management/prompt_test.go index 95d9fe05..97cd716c 100644 --- a/management/prompt_test.go +++ b/management/prompt_test.go @@ -127,6 +127,66 @@ func TestPromptManager_SetPartials(t *testing.T) { assert.Equal(t, expected, actual) } +func TestPromptManager_ReadRendering(t *testing.T) { + configureHTTPTestRecordings(t) + + _ = givenACustomDomain(t) + _ = givenAUniversalLoginTemplate(t) + expected := givenAPromptRendering(t) + actual, err := api.Prompt.ReadRendering(context.Background(), PromptSignup, ScreenSignup) + assert.NoError(t, err) + assert.Equal(t, expected.GetRenderingMode(), actual.GetRenderingMode()) + assert.Equal(t, expected.GetContextConfiguration(), actual.GetContextConfiguration()) + assert.Equal(t, expected.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled()) + assert.Equal(t, expected.HeadTags, actual.HeadTags) + assert.Equal(t, PromptSignup, *actual.GetPrompt()) + assert.Equal(t, ScreenSignup, *actual.GetScreen()) +} + +func TestPromptManager_UpdateRendering(t *testing.T) { + configureHTTPTestRecordings(t) + + _ = givenACustomDomain(t) + _ = givenAUniversalLoginTemplate(t) + _ = givenAPromptRendering(t) + updateData := &PromptRendering{} + updateData.ContextConfiguration = &[]string{"branding.settings", "branding.themes.default", "client.logo_uri"} + updateData.DefaultHeadTagsDisabled = auth0.Bool(true) + + err := api.Prompt.UpdateRendering(context.Background(), PromptSignup, ScreenSignup, updateData) + assert.NoError(t, err) + + actual, err := api.Prompt.ReadRendering(context.Background(), PromptSignup, ScreenSignup) + assert.NoError(t, err) + assert.Equal(t, updateData.GetContextConfiguration(), actual.GetContextConfiguration()) + assert.Equal(t, updateData.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled()) + assert.Equal(t, PromptSignup, *actual.GetPrompt()) + assert.Equal(t, ScreenSignup, *actual.GetScreen()) +} + +func TestPromptManager_UpdateRenderingWithStandardMode(t *testing.T) { + configureHTTPTestRecordings(t) + + _ = givenACustomDomain(t) + _ = givenAUniversalLoginTemplate(t) + expected := givenAPromptRendering(t) + expected.RenderingMode = &RenderingModeStandard + expected.ContextConfiguration = &[]string{"branding.settings", "branding.themes.default", "client.logo_uri"} + expected.DefaultHeadTagsDisabled = auth0.Bool(true) + + err := api.Prompt.UpdateRendering(context.Background(), PromptSignup, ScreenSignup, expected) + assert.NoError(t, err) + + actual, err := api.Prompt.ReadRendering(context.Background(), PromptSignup, ScreenSignup) + assert.NoError(t, err) + assert.Equal(t, expected.GetRenderingMode(), actual.GetRenderingMode()) + assert.NotEqual(t, expected.GetContextConfiguration(), actual.GetContextConfiguration()) + assert.NotEqual(t, expected.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled()) + assert.Equal(t, expected.HeadTags, actual.HeadTags) + assert.Equal(t, PromptSignup, *actual.GetPrompt()) + assert.Equal(t, ScreenSignup, *actual.GetScreen()) +} + func TestPromptManager_GetPartialsGuardGuardError(t *testing.T) { configureHTTPTestRecordings(t) @@ -293,6 +353,35 @@ func givenAPartialPrompt(t *testing.T, prompt PromptType) *PromptScreenPartials return partials } +func givenAPromptRendering(t *testing.T) *PromptRendering { + t.Helper() + + settings := &PromptRendering{ + RenderingMode: &RenderingModeStandard, + ContextConfiguration: &[]string{"branding.settings", "branding.themes.default"}, + DefaultHeadTagsDisabled: auth0.Bool(false), + HeadTags: []interface{}{ + map[string]interface{}{ + "tag": "script", + "content": "", + "attributes": map[string]interface{}{ + "defer": true, + "src": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js", + "async": true, + "integrity": []string{ + "sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==", + }, + }, + }, + }, + } + + err := api.Prompt.UpdateRendering(context.Background(), PromptSignup, ScreenSignup, settings) + assert.NoError(t, err) + + return settings +} + func cleanupPromptPartials(t *testing.T, prompt PromptType) { t.Helper() diff --git a/test/data/recordings/TestPromptManager_ReadRendering.yaml b/test/data/recordings/TestPromptManager_ReadRendering.yaml new file mode 100644 index 00000000..48881eab --- /dev/null +++ b/test/data/recordings/TestPromptManager_ReadRendering.yaml @@ -0,0 +1,216 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"domain":"1730881029.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 328 + uncompressed: false + body: '{"custom_domain_id":"cd_7SgKHnrmHQNuTXEs","domain":"1730881029.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-7sgkhnrmhqnutxes.edge.tenants.us.auth0.com","domain":"1730881029.auth.uat.auth0.com"}]},"tls_policy":"recommended"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 923.825708ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 165 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + "\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e{%- auth0:head -%}\u003c/head\u003e\u003cbody\u003e{%- auth0:widget -%}\u003c/body\u003e\u003c/html\u003e" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 201 Created + code: 201 + duration: 2.783568542s + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 408 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.11.2 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/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"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 345.701625ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-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://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"go-auth0-dev.eu.auth0.com","prompt":"signup","screen":"signup","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","content":"","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: 348.5575ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-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://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 433.247666ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-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://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_7SgKHnrmHQNuTXEs + 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: 383.460542ms diff --git a/test/data/recordings/TestPromptManager_UpdateRendering.yaml b/test/data/recordings/TestPromptManager_UpdateRendering.yaml new file mode 100644 index 00000000..ee082e92 --- /dev/null +++ b/test/data/recordings/TestPromptManager_UpdateRendering.yaml @@ -0,0 +1,252 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"domain":"1733383424.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 342 + uncompressed: false + body: '{"custom_domain_id":"cd_hW5C18CQPXRsKpDz","domain":"1733383424.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-hw5c18cqpxrskpdz.edge.tenants.us.auth0.com","domain":"1733383424.auth.uat.auth0.com"}]},"tls_policy":"recommended"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 994.566333ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 165 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + "\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e{%- auth0:head -%}\u003c/head\u003e\u003cbody\u003e{%- auth0:widget -%}\u003c/body\u003e\u003c/html\u003e" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 201 Created + code: 201 + duration: 2.698890708s + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 408 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/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"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 442.125917ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 126 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"context_configuration":["branding.settings","branding.themes.default","client.logo_uri"],"default_head_tags_disabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/rendering + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"context_configuration":["branding.settings","branding.themes.default","client.logo_uri"],"default_head_tags_disabled":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 431.61225ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"go-auth0-dev.eu.auth0.com","prompt":"signup","screen":"signup","rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default","client.logo_uri"],"default_head_tags_disabled":true,"head_tags":[{"tag":"script","content":"","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: 418.176625ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 464.237167ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_hW5C18CQPXRsKpDz + 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: 411.741083ms diff --git a/test/data/recordings/TestPromptManager_UpdateRenderingWithStandardMode.yaml b/test/data/recordings/TestPromptManager_UpdateRenderingWithStandardMode.yaml new file mode 100644 index 00000000..8d66438a --- /dev/null +++ b/test/data/recordings/TestPromptManager_UpdateRenderingWithStandardMode.yaml @@ -0,0 +1,252 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"domain":"1733383430.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 342 + uncompressed: false + body: '{"custom_domain_id":"cd_HuDxFi74SU24Wy5g","domain":"1733383430.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-hudxfi74su24wy5g.edge.tenants.us.auth0.com","domain":"1733383430.auth.uat.auth0.com"}]},"tls_policy":"recommended"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 460.5115ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 165 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + "\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e{%- auth0:head -%}\u003c/head\u003e\u003cbody\u003e{%- auth0:widget -%}\u003c/body\u003e\u003c/html\u003e" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 201 Created + code: 201 + duration: 2.709378583s + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 408 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"advanced","context_configuration":["branding.settings","branding.themes.default"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/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"],"default_head_tags_disabled":false,"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"},"content":"","tag":"script"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 385.032375ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"rendering_mode":"standard"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/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: 386.19325ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/signup/screen/signup/rendering + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant":"go-auth0-dev.eu.auth0.com","prompt":"signup","screen":"signup","rendering_mode":"standard","context_configuration":["branding.settings","branding.themes.default"],"default_head_tags_disabled":false,"head_tags":[{"tag":"script","content":"","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: 429.387042ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/branding/templates/universal-login + 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: 427.015708ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.12.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_HuDxFi74SU24Wy5g + 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: 381.59875ms