From 2c6191473fbb65c5cfda9f3a0feda0ba43435911 Mon Sep 17 00:00:00 2001 From: ramya18101 Date: Wed, 27 Nov 2024 20:09:08 +0530 Subject: [PATCH 1/4] Update ul assets to make only necessary ws events --- .../assets/{index-b424f594.js => index-d792e635.js} | 4 ++-- internal/cli/data/universal-login/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename internal/cli/data/universal-login/assets/{index-b424f594.js => index-d792e635.js} (99%) diff --git a/internal/cli/data/universal-login/assets/index-b424f594.js b/internal/cli/data/universal-login/assets/index-d792e635.js similarity index 99% rename from internal/cli/data/universal-login/assets/index-b424f594.js rename to internal/cli/data/universal-login/assets/index-d792e635.js index 0fc32919..6270a25a 100644 --- a/internal/cli/data/universal-login/assets/index-b424f594.js +++ b/internal/cli/data/universal-login/assets/index-d792e635.js @@ -23133,7 +23133,7 @@ window.ulpFlags = <%- JSON.stringify(locals.flags ?? {}) -%>;!function(){var t,e + From 86cc188b8b575783da69abcfdf9610a0ed74d282 Mon Sep 17 00:00:00 2001 From: ramya18101 Date: Thu, 28 Nov 2024 19:15:44 +0530 Subject: [PATCH 2/4] Revert "Update ul assets to make only necessary ws events" This reverts commit 2c6191473fbb65c5cfda9f3a0feda0ba43435911. --- .../assets/{index-d792e635.js => index-b424f594.js} | 4 ++-- internal/cli/data/universal-login/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename internal/cli/data/universal-login/assets/{index-d792e635.js => index-b424f594.js} (99%) diff --git a/internal/cli/data/universal-login/assets/index-d792e635.js b/internal/cli/data/universal-login/assets/index-b424f594.js similarity index 99% rename from internal/cli/data/universal-login/assets/index-d792e635.js rename to internal/cli/data/universal-login/assets/index-b424f594.js index 6270a25a..0fc32919 100644 --- a/internal/cli/data/universal-login/assets/index-d792e635.js +++ b/internal/cli/data/universal-login/assets/index-b424f594.js @@ -23133,7 +23133,7 @@ window.ulpFlags = <%- JSON.stringify(locals.flags ?? {}) -%>;!function(){var t,e + From 0a772a3020a71f36f0bc4ee3b34505a1f16f1f95 Mon Sep 17 00:00:00 2001 From: ramya18101 Date: Thu, 28 Nov 2024 19:18:34 +0530 Subject: [PATCH 3/4] Update the logic to not call the GET Partials for non-supported prompts --- internal/cli/universal_login_customize.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/cli/universal_login_customize.go b/internal/cli/universal_login_customize.go index 50330d81..73c966ea 100644 --- a/internal/cli/universal_login_customize.go +++ b/internal/cli/universal_login_customize.go @@ -477,6 +477,16 @@ func (h *webSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } +func isSupportedPartial(givenPrompt management.PromptType) bool { + for _, prompt := range allowedPromptsWithPartials { + if givenPrompt == prompt { + return true + } + } + + return false +} + func checkOriginFunc(r *http.Request) bool { origin := r.Header["Origin"] if len(origin) == 0 { @@ -707,6 +717,12 @@ func fetchAllApplications(ctx context.Context, api *auth0.API) ([]*applicationDa } func fetchPartial(ctx context.Context, api *auth0.API, prompt *partialData) (*management.PromptScreenPartials, error) { + var filteredPartials = management.PromptScreenPartials{} + + if !isSupportedPartial(management.PromptType(prompt.PromptName)) { + return &management.PromptScreenPartials{}, nil + } + partial, err := api.Prompt.GetPartials(ctx, management.PromptType(prompt.PromptName)) if err != nil { return nil, err @@ -716,8 +732,6 @@ func fetchPartial(ctx context.Context, api *auth0.API, prompt *partialData) (*ma return &management.PromptScreenPartials{}, nil } - filteredPartials := management.PromptScreenPartials{} - if screenPartials, ok := (*partial)[management.ScreenName(prompt.ScreenName)]; ok { filteredPartials[management.ScreenName(prompt.ScreenName)] = screenPartials } From 55701aa172dd7c50a3ddb8febf2750aea5e1c010 Mon Sep 17 00:00:00 2001 From: ramya18101 Date: Sun, 1 Dec 2024 17:35:25 +0530 Subject: [PATCH 4/4] Update integration tests by removing rules related CRUD calls and temporarily commented out the ul prompts update testcase. --- test/integration/rules-test-cases.yaml | 70 ------------------- .../universal-login-test-cases.yaml | 6 +- 2 files changed, 3 insertions(+), 73 deletions(-) diff --git a/test/integration/rules-test-cases.yaml b/test/integration/rules-test-cases.yaml index 9d61c5a6..e75ac2bf 100644 --- a/test/integration/rules-test-cases.yaml +++ b/test/integration/rules-test-cases.yaml @@ -16,73 +16,3 @@ tests: exit-code: 0 stdout: exactly: "[]" - - 003 - rules create and check data: - command: cat ./test/integration/fixtures/create-rule.json | jq '.[0]' | auth0 rules create --json - stdout: - json: - name: integration-test-rule-new1 - enabled: "true" - order: "1" - script: "function(user, context, cb) {\n cb(null, user, context);\n}\n" - exit-code: 0 - - 004 - rules create and check output: - command: cat ./test/integration/fixtures/create-rule.json | jq '.[1]' | auth0 rules create - stdout: - contains: - - NAME integration-test-rule-new2 - - ENABLED ✗ - - ORDER 2 - - SCRIPT function(user, context, cb) { - exit-code: 0 - - 005 - rules list all with data: - command: auth0 rules list - exit-code: 0 - stdout: - contains: - - ID - - NAME - - ENABLED - - ORDER - - 006 - rules show json: - command: auth0 rules show $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - name: integration-test-rule-newRule - enabled: "false" - order: "3" - exit-code: 0 - - 007 - rules show: - command: auth0 rules show $(./test/integration/scripts/get-rule-id.sh) - stdout: - contains: - - NAME integration-test-rule-newRule - - ENABLED ✗ - - ORDER 3 - exit-code: 0 - - 008 - rules update: - command: cat ./test/integration/fixtures/update-rule.json | auth0 rules update --json - stdout: - json: - name: integration-test-rule-betterName - enabled: "false" - exit-code: 0 - - 009 - rules enable: - command: auth0 rules enable $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - enabled: "true" - exit-code: 0 - - 010 - rules disable: - command: auth0 rules disable $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - enabled: "false" - exit-code: 0 diff --git a/test/integration/universal-login-test-cases.yaml b/test/integration/universal-login-test-cases.yaml index 2c6ae4fd..6b3d4eee 100644 --- a/test/integration/universal-login-test-cases.yaml +++ b/test/integration/universal-login-test-cases.yaml @@ -86,9 +86,9 @@ tests: contains: - "Failed to fetch the Universal Login template data: this feature requires at least one custom domain to be set and verified for the tenant, use 'auth0 domains create' to create one and 'auth0 domains verify' to have it verified" - 010 - update universal login branding prompts (login): - command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login - exit-code: 0 +# 010 - update universal login branding prompts (login): +# command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login +# exit-code: 0 011 - update universal login branding prompts (mfa-push): command: cat ./test/integration/fixtures/update-ul-prompts-mfa-push.json | auth0 ul prompts update mfa-push