From e31d23f7939789713917d4d215c5f3fc075e5980 Mon Sep 17 00:00:00 2001
From: KunalOfficial <35455566+developerkunal@users.noreply.github.com>
Date: Mon, 2 Sep 2024 20:38:23 +0530
Subject: [PATCH] Add support for new Prompts and Screens for Prompt Partial
(#437)
---
management/management.gen.go | 13 +
management/management.gen_test.go | 18 ++
management/prompt.go | 105 +++++++-
management/prompt_test.go | 97 +++++++
.../TestPromptManager_GetPartials.yaml | 252 ++++++++++++++++++
...mptManager_GetPartialsGuardGuardError.yaml | 3 +
.../TestPromptManager_SetPartials.yaml | 252 ++++++++++++++++++
...mptManager_SetPartialsGuardGuardError.yaml | 3 +
8 files changed, 742 insertions(+), 1 deletion(-)
create mode 100644 test/data/recordings/TestPromptManager_GetPartials.yaml
create mode 100644 test/data/recordings/TestPromptManager_GetPartialsGuardGuardError.yaml
create mode 100644 test/data/recordings/TestPromptManager_SetPartials.yaml
create mode 100644 test/data/recordings/TestPromptManager_SetPartialsGuardGuardError.yaml
diff --git a/management/management.gen.go b/management/management.gen.go
index b13c23bd..37dffd15 100644
--- a/management/management.gen.go
+++ b/management/management.gen.go
@@ -9609,6 +9609,19 @@ func (s *SCIMToken) String() string {
return Stringify(s)
}
+// GetContent returns the Content map if it's non-nil, an empty map otherwise.
+func (s *ScreenPartials) GetContent() map[InsertionPoint]string {
+ if s == nil || s.Content == nil {
+ return map[InsertionPoint]string{}
+ }
+ return s.Content
+}
+
+// String returns a string representation of ScreenPartials.
+func (s *ScreenPartials) String() string {
+ return Stringify(s)
+}
+
// GetBranding returns the Branding field.
func (s *SelfServiceProfile) GetBranding() *Branding {
if s == nil {
diff --git a/management/management.gen_test.go b/management/management.gen_test.go
index adbcb9ea..b7f7ab02 100644
--- a/management/management.gen_test.go
+++ b/management/management.gen_test.go
@@ -12076,6 +12076,24 @@ func TestSCIMToken_String(t *testing.T) {
}
}
+func TestScreenPartials_GetContent(tt *testing.T) {
+ zeroValue := map[InsertionPoint]string{}
+ s := &ScreenPartials{Content: zeroValue}
+ s.GetContent()
+ s = &ScreenPartials{}
+ s.GetContent()
+ s = nil
+ s.GetContent()
+}
+
+func TestScreenPartials_String(t *testing.T) {
+ var rawJSON json.RawMessage
+ v := &ScreenPartials{}
+ if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil {
+ t.Errorf("failed to produce a valid json")
+ }
+}
+
func TestSelfServiceProfile_GetBranding(tt *testing.T) {
s := &SelfServiceProfile{}
s.GetBranding()
diff --git a/management/prompt.go b/management/prompt.go
index fa032bb8..45c68857 100644
--- a/management/prompt.go
+++ b/management/prompt.go
@@ -24,6 +24,9 @@ const (
// PromptLoginPassword represents the login-password prompt.
PromptLoginPassword PromptType = "login-password"
+
+ // PromptLoginPasswordLess represents the login-passwordless prompt.
+ PromptLoginPasswordLess PromptType = "login-passwordless"
)
var allowedPromptsWithPartials = []PromptType{
@@ -33,11 +36,73 @@ var allowedPromptsWithPartials = []PromptType{
PromptLogin,
PromptLoginID,
PromptLoginPassword,
+ PromptLoginPasswordLess,
}
// PromptType defines the prompt that we are managing.
type PromptType string
+// ScreenName is a type that represents the name of a screen.
+type ScreenName string
+
+// InsertionPoint is a type that represents the insertion point of a screen.
+type InsertionPoint string
+
+const (
+ // ScreenLogin represents the login screen.
+ ScreenLogin ScreenName = "login"
+
+ // ScreenLoginID represents the login-id screen.
+ ScreenLoginID ScreenName = "login-id"
+
+ // ScreenLoginPassword represents the login-password screen.
+ ScreenLoginPassword ScreenName = "login-password"
+
+ // ScreenSignup represents the signup screen.
+ ScreenSignup ScreenName = "signup"
+
+ // ScreenSignupID represents the signup-id screen.
+ ScreenSignupID ScreenName = "signup-id"
+
+ // ScreenSignupPassword represents the signup-password screen.
+ ScreenSignupPassword ScreenName = "signup-password"
+
+ // ScreenLoginPasswordlessSMSOTP represents the login-passwordless-sms-otp screen.
+ ScreenLoginPasswordlessSMSOTP ScreenName = "login-passwordless-sms-otp"
+
+ // ScreenLoginPasswordlessEmailCode represents the login-passwordless-email-code screen.
+ ScreenLoginPasswordlessEmailCode ScreenName = "login-passwordless-email-code"
+)
+
+const (
+ // InsertionPointFormContentStart represents the form-content-start insertion point.
+ InsertionPointFormContentStart InsertionPoint = "form-content-start"
+
+ // InsertionPointFormContentEnd represents the form-content-end insertion point.
+ InsertionPointFormContentEnd InsertionPoint = "form-content-end"
+
+ // InsertionPointFormFooterStart represents the form-footer-start insertion point.
+ InsertionPointFormFooterStart InsertionPoint = "form-footer-start"
+
+ // InsertionPointFormFooterEnd represents the form-footer-end insertion point.
+ InsertionPointFormFooterEnd InsertionPoint = "form-footer-end"
+
+ // InsertionPointSecondaryActionsStart represents the secondary-actions-start insertion point.
+ InsertionPointSecondaryActionsStart InsertionPoint = "secondary-actions-start"
+
+ // InsertionPointSecondaryActionsEnd represents the secondary-actions-end insertion point.
+ InsertionPointSecondaryActionsEnd InsertionPoint = "secondary-actions-end"
+)
+
+// ScreenPartials is a map of insertion points to partials.
+type ScreenPartials struct {
+ // Define InsertionPoints for the screen partials here
+ Content map[InsertionPoint]string
+}
+
+// PromptScreenPartials is a map of screen names to insertion points.
+type PromptScreenPartials map[ScreenName]map[InsertionPoint]string
+
// Prompt is used within the Login Page.
//
// See: https://auth0.com/docs/customize/universal-login-pages/customize-login-text-prompts
@@ -54,6 +119,8 @@ type Prompt struct {
// PromptPartials to be used for Custom Prompt Partials.
//
+// Deprecated: Use [PromptScreenPartials] instead.
+//
// See: https://auth0.com/docs/sign-up-prompt-customizations
type PromptPartials struct {
FormContentStart string `json:"form-content-start,omitempty"`
@@ -127,6 +194,10 @@ func (m *PromptManager) SetCustomText(ctx context.Context, p string, l string, b
// CreatePartials creates new custom prompt partials for a given segment.
//
+// Deprecated: Use [ SetPartials ] instead. The [ SetPartials ] method is preferred for setting prompt partials and provides a more consistent API.
+//
+// To create a partial with a different screen name and prompt name, use the [ SetPartials ] method with the [PromptScreenPartials] struct.
+//
// See: https://auth0.com/docs/sign-up-prompt-customizations#use-the-api-to-edit-custom-prompts
func (m *PromptManager) CreatePartials(ctx context.Context, c *PromptPartials, opts ...RequestOption) error {
if err := guardAgainstPromptTypesWithNoPartials(c.Prompt); err != nil {
@@ -138,6 +209,10 @@ func (m *PromptManager) CreatePartials(ctx context.Context, c *PromptPartials, o
// UpdatePartials updates custom prompt partials for a given segment.
//
+// Deprecated: Use [ SetPartials ] instead. The [ SetPartials ] method offers more flexibility and is the recommended approach for updating prompt partials.
+//
+// To update a partial with a different screen name and prompt name, use the [ SetPartials ] method with the [PromptScreenPartials] struct.
+//
// See: https://auth0.com/docs/sign-up-prompt-customizations#use-the-api-to-edit-custom-prompts
func (m *PromptManager) UpdatePartials(ctx context.Context, c *PromptPartials, opts ...RequestOption) error {
if err := guardAgainstPromptTypesWithNoPartials(c.Prompt); err != nil {
@@ -147,8 +222,36 @@ func (m *PromptManager) UpdatePartials(ctx context.Context, c *PromptPartials, o
return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(c.Prompt), "partials"), c, opts...)
}
+// GetPartials retrieves custom prompt partials for a given segment.
+//
+// See : https://auth0.com/docs/api/management/v2/prompts/get-partials
+func (m *PromptManager) GetPartials(ctx context.Context, prompt PromptType, opts ...RequestOption) (c *PromptScreenPartials, err error) {
+ if err := guardAgainstPromptTypesWithNoPartials(prompt); err != nil {
+ return nil, err
+ }
+
+ err = m.management.Request(ctx, "GET", m.management.URI("prompts", string(prompt), "partials"), &c, opts...)
+
+ return
+}
+
+// SetPartials sets custom prompt partials for a given segment.
+//
+// See : https://auth0.com/docs/api/management/v2/prompts/put-partials
+func (m *PromptManager) SetPartials(ctx context.Context, prompt PromptType, c *PromptScreenPartials, opts ...RequestOption) error {
+ if err := guardAgainstPromptTypesWithNoPartials(prompt); err != nil {
+ return err
+ }
+
+ return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(prompt), "partials"), &c, opts...)
+}
+
// ReadPartials reads custom prompt partials for a given segment.
//
+// Deprecated: Use [ GetPartials ] instead. The [ GetPartials ] method provides the same functionality with improved support and additional features.
+//
+// If there are multiple screen partials for a prompt, this method will return only the first screen partial. To retrieve all screen partials for a prompt, use the [ GetPartials ] method.
+//
// See: https://auth0.com/docs/sign-up-prompt-customizations#use-the-api-to-edit-custom-prompts
func (m *PromptManager) ReadPartials(ctx context.Context, prompt PromptType, opts ...RequestOption) (c *PromptPartials, err error) {
if err := guardAgainstPromptTypesWithNoPartials(prompt); err != nil {
@@ -174,7 +277,7 @@ func (m *PromptManager) DeletePartials(ctx context.Context, prompt PromptType, o
return err
}
- return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(prompt), "partials"), &PromptPartials{Prompt: prompt}, opts...)
+ return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(prompt), "partials"), &PromptScreenPartials{}, opts...)
}
func guardAgainstPromptTypesWithNoPartials(prompt PromptType) error {
diff --git a/management/prompt_test.go b/management/prompt_test.go
index f4615a04..95d9fe05 100644
--- a/management/prompt_test.go
+++ b/management/prompt_test.go
@@ -79,6 +79,76 @@ func TestPromptCustomText(t *testing.T) {
assert.Equal(t, "Welcome", texts["login"].(map[string]interface{})["title"])
}
+func TestPromptManager_GetPartials(t *testing.T) {
+ configureHTTPTestRecordings(t)
+
+ _ = givenACustomDomain(t)
+ _ = givenAUniversalLoginTemplate(t)
+
+ prompt := PromptLogin
+
+ expected := givenAPartialPrompt(t, prompt)
+
+ actual, err := api.Prompt.GetPartials(context.Background(), prompt)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, actual)
+}
+
+func TestPromptManager_SetPartials(t *testing.T) {
+ configureHTTPTestRecordings(t)
+
+ _ = givenACustomDomain(t)
+ _ = givenAUniversalLoginTemplate(t)
+
+ prompt := PromptLoginPasswordLess
+
+ expected := &PromptScreenPartials{
+ ScreenLoginPasswordlessSMSOTP: {
+ InsertionPointFormContentStart: `
Form Content Start
`,
+ InsertionPointFormContentEnd: `Form Content Start
`,
+ },
+ ScreenLoginPasswordlessEmailCode: {
+ InsertionPointFormContentStart: `Form Content Start
`,
+ InsertionPointFormContentEnd: `Form Content Start
`,
+ },
+ }
+
+ err := api.Prompt.SetPartials(context.Background(), prompt, expected)
+ assert.NoError(t, err)
+
+ t.Cleanup(func() {
+ cleanupPromptPartials(t, prompt)
+ })
+
+ actual, err := api.Prompt.GetPartials(context.Background(), prompt)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, actual)
+}
+
+func TestPromptManager_GetPartialsGuardGuardError(t *testing.T) {
+ configureHTTPTestRecordings(t)
+
+ prompt := PromptType("OtherPrompt")
+
+ _, err := api.Prompt.GetPartials(context.Background(), prompt)
+ assert.Error(t, err)
+ assert.ErrorContains(t, err, "cannot customize partials for prompt")
+}
+
+func TestPromptManager_SetPartialsGuardGuardError(t *testing.T) {
+ configureHTTPTestRecordings(t)
+
+ prompt := PromptType("OtherPrompt")
+
+ expected := &PromptScreenPartials{}
+
+ err := api.Prompt.SetPartials(context.Background(), prompt, expected)
+ assert.Error(t, err)
+ assert.ErrorContains(t, err, "cannot customize partials for prompt")
+}
+
func TestPromptManager_ReadPartials(t *testing.T) {
configureHTTPTestRecordings(t)
@@ -202,3 +272,30 @@ func deleteUniversalLoginTemplate(t *testing.T) {
err := api.Branding.DeleteUniversalLogin(context.Background())
assert.NoError(t, err)
}
+
+func givenAPartialPrompt(t *testing.T, prompt PromptType) *PromptScreenPartials {
+ t.Helper()
+
+ partials := &PromptScreenPartials{
+ ScreenLogin: {
+ InsertionPointFormContentStart: `Form Content Start
`,
+ InsertionPointFormContentEnd: `Form Content Start
`,
+ },
+ }
+
+ err := api.Prompt.SetPartials(context.Background(), prompt, partials)
+ assert.NoError(t, err)
+
+ t.Cleanup(func() {
+ cleanupPromptPartials(t, prompt)
+ })
+
+ return partials
+}
+
+func cleanupPromptPartials(t *testing.T, prompt PromptType) {
+ t.Helper()
+
+ err := api.Prompt.DeletePartials(context.Background(), prompt)
+ assert.NoError(t, err)
+}
diff --git a/test/data/recordings/TestPromptManager_GetPartials.yaml b/test/data/recordings/TestPromptManager_GetPartials.yaml
new file mode 100644
index 00000000..54927380
--- /dev/null
+++ b/test/data/recordings/TestPromptManager_GetPartials.yaml
@@ -0,0 +1,252 @@
+---
+version: 2
+interactions:
+ - id: 0
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 99
+ transfer_encoding: []
+ trailer: {}
+ host: go-auth0-dev.eu.auth0.com
+ remote_addr: ""
+ request_uri: ""
+ body: |
+ {"domain":"1724659065.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
+ form: {}
+ headers:
+ Content-Type:
+ - application/json
+ User-Agent:
+ - Go-Auth0/1.9.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: 373
+ uncompressed: false
+ body: '{"custom_domain_id":"cd_h3Zz4noJ4gzl10ND","domain":"1724659065.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-h3zz4noj4gzl10nd.edge.tenants.sus.auth0.com","domain":"1724659065.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 201 Created
+ code: 201
+ duration: 2.062053709s
+ - 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.9.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: 924.149083ms
+ - id: 2
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 156
+ transfer_encoding: []
+ trailer: {}
+ host: go-auth0-dev.eu.auth0.com
+ remote_addr: ""
+ request_uri: ""
+ body: |
+ {"login":{"form-content-end":"\u003cdiv\u003eForm Content Start\u003c/div\u003e","form-content-start":"\u003cdiv\u003eForm Content Start\u003c/div\u003e"}}
+ form: {}
+ headers:
+ Content-Type:
+ - application/json
+ User-Agent:
+ - Go-Auth0/1.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login/partials
+ method: PUT
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: -1
+ uncompressed: true
+ body: '{"login":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"}}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 649.10675ms
+ - 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login/partials
+ method: GET
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: -1
+ uncompressed: true
+ body: '{"login":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"}}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 407.373167ms
+ - id: 4
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 3
+ 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login/partials
+ method: PUT
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: 2
+ uncompressed: false
+ body: '{}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 460.128459ms
+ - 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.9.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: 472.003458ms
+ - 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_h3Zz4noJ4gzl10ND
+ 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: 967.181667ms
diff --git a/test/data/recordings/TestPromptManager_GetPartialsGuardGuardError.yaml b/test/data/recordings/TestPromptManager_GetPartialsGuardGuardError.yaml
new file mode 100644
index 00000000..2797c38e
--- /dev/null
+++ b/test/data/recordings/TestPromptManager_GetPartialsGuardGuardError.yaml
@@ -0,0 +1,3 @@
+---
+version: 2
+interactions: []
diff --git a/test/data/recordings/TestPromptManager_SetPartials.yaml b/test/data/recordings/TestPromptManager_SetPartials.yaml
new file mode 100644
index 00000000..1bfb170c
--- /dev/null
+++ b/test/data/recordings/TestPromptManager_SetPartials.yaml
@@ -0,0 +1,252 @@
+---
+version: 2
+interactions:
+ - id: 0
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 81
+ transfer_encoding: []
+ trailer: {}
+ host: go-auth0-dev.eu.auth0.com
+ remote_addr: ""
+ request_uri: ""
+ body: |
+ {"domain":"1724659065.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
+ form: {}
+ headers:
+ Content-Type:
+ - application/json
+ User-Agent:
+ - Go-Auth0/1.9.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: 304
+ uncompressed: false
+ body: '{"custom_domain_id":"cd_itzPuKdJ8NdyfDpI","domain":"1724659065.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-itzpukdj8ndyfdpi.edge.tenants.us.auth0.com","domain":"kunal.dawar"}]},"tls_policy":"recommended"}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 201 Created
+ code: 201
+ duration: 1.658834625s
+ - 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.9.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.838140417s
+ - id: 2
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 355
+ transfer_encoding: []
+ trailer: {}
+ host: go-auth0-dev.eu.auth0.com
+ remote_addr: ""
+ request_uri: ""
+ body: |
+ {"login-passwordless-email-code":{"form-content-end":"\u003cdiv\u003eForm Content Start\u003c/div\u003e","form-content-start":"\u003cdiv\u003eForm Content Start\u003c/div\u003e"},"login-passwordless-sms-otp":{"form-content-end":"\u003cdiv\u003eForm Content Start\u003c/div\u003e","form-content-start":"\u003cdiv\u003eForm Content Start\u003c/div\u003e"}}
+ form: {}
+ headers:
+ Content-Type:
+ - application/json
+ User-Agent:
+ - Go-Auth0/1.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login-passwordless/partials
+ method: PUT
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: -1
+ uncompressed: true
+ body: '{"login-passwordless-email-code":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"},"login-passwordless-sms-otp":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"}}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 411.334083ms
+ - 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login-passwordless/partials
+ method: GET
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: -1
+ uncompressed: true
+ body: '{"login-passwordless-email-code":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"},"login-passwordless-sms-otp":{"form-content-end":"Form Content Start
","form-content-start":"Form Content Start
"}}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 367.680375ms
+ - id: 4
+ request:
+ proto: HTTP/1.1
+ proto_major: 1
+ proto_minor: 1
+ content_length: 3
+ 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/prompts/login-passwordless/partials
+ method: PUT
+ response:
+ proto: HTTP/2.0
+ proto_major: 2
+ proto_minor: 0
+ transfer_encoding: []
+ trailer: {}
+ content_length: 2
+ uncompressed: false
+ body: '{}'
+ headers:
+ Content-Type:
+ - application/json; charset=utf-8
+ status: 200 OK
+ code: 200
+ duration: 382.801458ms
+ - 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.9.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: 503.549041ms
+ - 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.9.0
+ url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_itzPuKdJ8NdyfDpI
+ 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: 1.395291834s
diff --git a/test/data/recordings/TestPromptManager_SetPartialsGuardGuardError.yaml b/test/data/recordings/TestPromptManager_SetPartialsGuardGuardError.yaml
new file mode 100644
index 00000000..2797c38e
--- /dev/null
+++ b/test/data/recordings/TestPromptManager_SetPartialsGuardGuardError.yaml
@@ -0,0 +1,3 @@
+---
+version: 2
+interactions: []