From 8e0902112e971cb415142a5c788c1671cfd0e844 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 18:57:43 +0530 Subject: [PATCH 01/16] fix(apps): ensure CanCreateToken is set correctly in app session transfer - Added logic to set inputs.CanCreateToken based on the current session transfer state when the appSTCanCreateToken flag is not set. - Removed redundant code that set CanCreateSessionTransferToken only if the flag was supplied or prompted. --- internal/cli/apps.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/cli/apps.go b/internal/cli/apps.go index e84abe225..f13704da5 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -1161,9 +1161,13 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { } } + if !appSTCanCreateToken.IsSet(cmd) { + inputs.CanCreateToken = auth0.BoolValue(current.SessionTransfer.CanCreateSessionTransferToken) + } if err := appSTCanCreateToken.AskBoolU(cmd, &inputs.CanCreateToken, current.SessionTransfer.CanCreateSessionTransferToken); err != nil { return err } + st.CanCreateSessionTransferToken = &inputs.CanCreateToken defaultVal := stringSliceToCommaSeparatedString(current.SessionTransfer.GetAllowedAuthenticationMethods()) if err := appSTAllowedAuthMethods.AskManyU(cmd, &inputs.AllowedAuthMethods, &defaultVal); err != nil { @@ -1174,11 +1178,6 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { return err } - // Set the flag if it was supplied or entered by the prompt. - if appSTCanCreateToken.IsSet(cmd) || shouldPromptWhenNoLocalFlagsSet(cmd) { - st.CanCreateSessionTransferToken = &inputs.CanCreateToken - } - if len(inputs.AllowedAuthMethods) > 0 { st.AllowedAuthenticationMethods = &inputs.AllowedAuthMethods } From 0acc49e645443d17a61a90e894b6bb0b73d78454 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 19:11:04 +0530 Subject: [PATCH 02/16] fix(attack_protection): ensure Enabled flag is set correctly in breached password detection update command - Added logic to set the Enabled input based on the current state of the breached password detection flags if the flag is not explicitly set in the command. - This change ensures that the command behaves correctly by maintaining the previous state of the Enabled setting when the user does not provide an input. --- internal/cli/attack_protection_breached_password_detection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cli/attack_protection_breached_password_detection.go b/internal/cli/attack_protection_breached_password_detection.go index 5abc346c5..b940ed6cc 100644 --- a/internal/cli/attack_protection_breached_password_detection.go +++ b/internal/cli/attack_protection_breached_password_detection.go @@ -152,6 +152,9 @@ func updateBreachedPasswordDetectionCmdRun( return err } + if !bpdFlags.Enabled.IsSet(cmd) { + inputs.Enabled = bpd.GetEnabled() + } if err := bpdFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, bpd.Enabled); err != nil { return err } From da1026774df9237a833d1362bac18c3b1acc7e63 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 19:11:35 +0530 Subject: [PATCH 03/16] fix(attack_protection): ensure Enabled flag is set correctly in brute force protection update command - Added a check to set the Enabled input based on the current state of the brute force protection flags if it is not explicitly set by the user. - This change ensures that the command behaves correctly when the Enabled flag is not provided, improving the user experience and preventing potential misconfigurations. --- internal/cli/attack_protection_brute_force_protection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cli/attack_protection_brute_force_protection.go b/internal/cli/attack_protection_brute_force_protection.go index 944ee2d90..8c77a523d 100644 --- a/internal/cli/attack_protection_brute_force_protection.go +++ b/internal/cli/attack_protection_brute_force_protection.go @@ -163,6 +163,9 @@ func updateBruteForceDetectionCmdRun( return err } + if !bfpFlags.Enabled.IsSet(cmd) { + inputs.Enabled = bfp.GetEnabled() + } if err := bfpFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, bfp.Enabled); err != nil { return err } From 2144613f43be6735e3e029b8763a290ede41933d Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 19:12:38 +0530 Subject: [PATCH 04/16] fix(attack_protection): ensure Enabled flag is set correctly in suspicious IP throttling update - Added a check to set the Enabled flag from the current state if it is not explicitly set in the command. - This change ensures that the existing state is preserved when updating suspicious IP throttling settings. - The modification occurs in the `updateSuspiciousIPThrottlingCmdRun` function. --- internal/cli/attack_protection_suspicious_ip_throttling.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cli/attack_protection_suspicious_ip_throttling.go b/internal/cli/attack_protection_suspicious_ip_throttling.go index 256c075b9..caec37b8f 100644 --- a/internal/cli/attack_protection_suspicious_ip_throttling.go +++ b/internal/cli/attack_protection_suspicious_ip_throttling.go @@ -186,6 +186,9 @@ func updateSuspiciousIPThrottlingCmdRun( return err } + if !sitFlags.Enabled.IsSet(cmd) { + inputs.Enabled = sit.GetEnabled() + } if err := sitFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, sit.Enabled); err != nil { return err } From 1de0d0910068bbef9cf85110a5b5d707b68e0b44 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 19:18:23 +0530 Subject: [PATCH 05/16] fix(email_templates): ensure Enabled flag is set correctly in email template update - Added a check to set the Enabled flag based on the old template's value if the user does not specify it during the update command. - This ensures that the previous state of the template is preserved when updating, preventing unintended changes to the Enabled status. --- internal/cli/email_templates.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cli/email_templates.go b/internal/cli/email_templates.go index da5ac143a..b5146f73e 100644 --- a/internal/cli/email_templates.go +++ b/internal/cli/email_templates.go @@ -247,6 +247,9 @@ func updateEmailTemplateCmd(cli *cli) *cobra.Command { } } + if !emailTemplateEnabled.IsSet(cmd) { + inputs.Enabled = auth0.BoolValue(oldTemplate.Enabled) + } if err := emailTemplateEnabled.AskBoolU(cmd, &inputs.Enabled, oldTemplate.Enabled); err != nil { return err } From ff980aca66fd9c0be92d9d72af578a55077c800d Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 20:18:49 +0530 Subject: [PATCH 06/16] fix(email_provider, log_streams_splunk, phone_provider, rules): ensure Enabled/Disabled flags are set correctly - Updated `updateEmailProviderCmd`, `updateLogStreamsSplunkCmd`, `updateBrandingPhoneProviderCmd`, and `updateRuleCmd` functions to set the Enabled/Disabled flags based on existing provider values when not explicitly set by the user. - This change ensures that the current state of the providers is preserved during updates, improving user experience and preventing unintended changes. --- internal/cli/email_provider.go | 10 +++++----- internal/cli/log_streams_splunk.go | 3 +++ internal/cli/phone_provider.go | 8 ++++---- internal/cli/rules.go | 3 +++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/internal/cli/email_provider.go b/internal/cli/email_provider.go index 702d62c75..51af7fe6d 100644 --- a/internal/cli/email_provider.go +++ b/internal/cli/email_provider.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" + "github.com/auth0/go-auth0" "github.com/auth0/go-auth0/management" "github.com/spf13/cobra" @@ -302,6 +303,9 @@ func updateEmailProviderCmd(cli *cli) *cobra.Command { if err := emailProviderFrom.AskU(cmd, &inputs.defaultFromAddress, currentProvider.DefaultFromAddress); err != nil { return err } + if !emailProviderEnabled.IsSet(cmd) { + inputs.enabled = auth0.BoolValue(currentProvider.Enabled) + } if err := emailProviderEnabled.AskBoolU(cmd, &inputs.enabled, currentProvider.Enabled); err != nil { return err } @@ -354,11 +358,7 @@ func updateEmailProviderCmd(cli *cli) *cobra.Command { return fmt.Errorf("unknown provider: %s", inputs.name) } } - - // Set the flag if it was supplied or entered by the prompt. - if canPrompt(cmd) || emailProviderEnabled.IsSet(cmd) { - emailProvider.Enabled = &inputs.enabled - } + emailProvider.Enabled = &inputs.enabled if len(inputs.defaultFromAddress) > 0 { emailProvider.DefaultFromAddress = &inputs.defaultFromAddress diff --git a/internal/cli/log_streams_splunk.go b/internal/cli/log_streams_splunk.go index cfb239c18..cf0da2494 100644 --- a/internal/cli/log_streams_splunk.go +++ b/internal/cli/log_streams_splunk.go @@ -228,6 +228,9 @@ func updateLogStreamsSplunkCmd(cli *cli) *cobra.Command { if err := splunkPort.AskU(cmd, &inputs.splunkPort, splunkSink.Port); err != nil { return err } + if !splunkVerifyTLS.IsSet(cmd) { + inputs.splunkVerifyTLS = auth0.BoolValue(splunkSink.Secure) + } if err := splunkVerifyTLS.AskBoolU(cmd, &inputs.splunkVerifyTLS, splunkSink.Secure); err != nil { return err } diff --git a/internal/cli/phone_provider.go b/internal/cli/phone_provider.go index 701b88c88..6d7e745f9 100644 --- a/internal/cli/phone_provider.go +++ b/internal/cli/phone_provider.go @@ -312,6 +312,9 @@ func updateBrandingPhoneProviderCmd(cli *cli) *cobra.Command { return err } + if !phoneProviderDisabled.IsSet(cmd) { + inputs.disabled = auth0.BoolValue(existingProvider.Disabled) + } if err := phoneProviderDisabled.AskBoolU(cmd, &inputs.disabled, existingProvider.Disabled); err != nil { return err } @@ -342,10 +345,7 @@ func updateBrandingPhoneProviderCmd(cli *cli) *cobra.Command { } } - // Set the flag if it was supplied or entered by the prompt. - if canPrompt(cmd) || phoneProviderDisabled.IsSet(cmd) { - phoneProvider.Disabled = &inputs.disabled - } + phoneProvider.Disabled = &inputs.disabled if credentials != nil { phoneProvider.Credentials = credentials diff --git a/internal/cli/rules.go b/internal/cli/rules.go index 81e94ea90..3fe41511d 100644 --- a/internal/cli/rules.go +++ b/internal/cli/rules.go @@ -363,6 +363,9 @@ func updateRuleCmd(cli *cli) *cobra.Command { if err := ruleName.AskU(cmd, &inputs.Name, oldRule.Name); err != nil { return err } + if !ruleEnabled.IsSet(cmd) { + inputs.Enabled = auth0.BoolValue(oldRule.Enabled) + } if err := ruleEnabled.AskBoolU(cmd, &inputs.Enabled, oldRule.Enabled); err != nil { return err } From ad44dddee1513891130b28482d5d42e393e799e7 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 12:07:40 +0530 Subject: [PATCH 07/16] refactor(cli): replace direct boolean value access with getter methods to ensure consistency - Affected functions include: - appsSessionTransferUpdateCmd - updateEmailProviderCmd - updateEmailTemplateCmd - updateLogStreamsSplunkCmd - updateBrandingPhoneProviderCmd - updateRuleCmd --- internal/cli/apps.go | 2 +- internal/cli/email_provider.go | 3 +-- internal/cli/email_templates.go | 2 +- internal/cli/log_streams_splunk.go | 2 +- internal/cli/phone_provider.go | 2 +- internal/cli/rules.go | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/cli/apps.go b/internal/cli/apps.go index f13704da5..6e1f8fa6f 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -1162,7 +1162,7 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { } if !appSTCanCreateToken.IsSet(cmd) { - inputs.CanCreateToken = auth0.BoolValue(current.SessionTransfer.CanCreateSessionTransferToken) + inputs.CanCreateToken = current.SessionTransfer.GetCanCreateSessionTransferToken() } if err := appSTCanCreateToken.AskBoolU(cmd, &inputs.CanCreateToken, current.SessionTransfer.CanCreateSessionTransferToken); err != nil { return err diff --git a/internal/cli/email_provider.go b/internal/cli/email_provider.go index 51af7fe6d..ec0bd8c56 100644 --- a/internal/cli/email_provider.go +++ b/internal/cli/email_provider.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" - "github.com/auth0/go-auth0" "github.com/auth0/go-auth0/management" "github.com/spf13/cobra" @@ -304,7 +303,7 @@ func updateEmailProviderCmd(cli *cli) *cobra.Command { return err } if !emailProviderEnabled.IsSet(cmd) { - inputs.enabled = auth0.BoolValue(currentProvider.Enabled) + inputs.enabled = currentProvider.GetEnabled() } if err := emailProviderEnabled.AskBoolU(cmd, &inputs.enabled, currentProvider.Enabled); err != nil { return err diff --git a/internal/cli/email_templates.go b/internal/cli/email_templates.go index b5146f73e..c3b5fc836 100644 --- a/internal/cli/email_templates.go +++ b/internal/cli/email_templates.go @@ -248,7 +248,7 @@ func updateEmailTemplateCmd(cli *cli) *cobra.Command { } if !emailTemplateEnabled.IsSet(cmd) { - inputs.Enabled = auth0.BoolValue(oldTemplate.Enabled) + inputs.Enabled = oldTemplate.GetEnabled() } if err := emailTemplateEnabled.AskBoolU(cmd, &inputs.Enabled, oldTemplate.Enabled); err != nil { return err diff --git a/internal/cli/log_streams_splunk.go b/internal/cli/log_streams_splunk.go index cf0da2494..6286aa3ae 100644 --- a/internal/cli/log_streams_splunk.go +++ b/internal/cli/log_streams_splunk.go @@ -229,7 +229,7 @@ func updateLogStreamsSplunkCmd(cli *cli) *cobra.Command { return err } if !splunkVerifyTLS.IsSet(cmd) { - inputs.splunkVerifyTLS = auth0.BoolValue(splunkSink.Secure) + inputs.splunkVerifyTLS = splunkSink.GetSecure() } if err := splunkVerifyTLS.AskBoolU(cmd, &inputs.splunkVerifyTLS, splunkSink.Secure); err != nil { return err diff --git a/internal/cli/phone_provider.go b/internal/cli/phone_provider.go index 6d7e745f9..a44659b0a 100644 --- a/internal/cli/phone_provider.go +++ b/internal/cli/phone_provider.go @@ -313,7 +313,7 @@ func updateBrandingPhoneProviderCmd(cli *cli) *cobra.Command { } if !phoneProviderDisabled.IsSet(cmd) { - inputs.disabled = auth0.BoolValue(existingProvider.Disabled) + inputs.disabled = existingProvider.GetDisabled() } if err := phoneProviderDisabled.AskBoolU(cmd, &inputs.disabled, existingProvider.Disabled); err != nil { return err diff --git a/internal/cli/rules.go b/internal/cli/rules.go index 3fe41511d..75d8fa1a3 100644 --- a/internal/cli/rules.go +++ b/internal/cli/rules.go @@ -364,7 +364,7 @@ func updateRuleCmd(cli *cli) *cobra.Command { return err } if !ruleEnabled.IsSet(cmd) { - inputs.Enabled = auth0.BoolValue(oldRule.Enabled) + inputs.Enabled = oldRule.GetEnabled() } if err := ruleEnabled.AskBoolU(cmd, &inputs.Enabled, oldRule.Enabled); err != nil { return err From e26fd919cae474ff9fb4cb8b8d97e46d5abe5a73 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 12:12:43 +0530 Subject: [PATCH 08/16] refactor(apps): moved back boolean assignment command to same line --- internal/cli/apps.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/cli/apps.go b/internal/cli/apps.go index 6e1f8fa6f..e7860695a 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -1167,7 +1167,6 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { if err := appSTCanCreateToken.AskBoolU(cmd, &inputs.CanCreateToken, current.SessionTransfer.CanCreateSessionTransferToken); err != nil { return err } - st.CanCreateSessionTransferToken = &inputs.CanCreateToken defaultVal := stringSliceToCommaSeparatedString(current.SessionTransfer.GetAllowedAuthenticationMethods()) if err := appSTAllowedAuthMethods.AskManyU(cmd, &inputs.AllowedAuthMethods, &defaultVal); err != nil { @@ -1178,6 +1177,8 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { return err } + st.CanCreateSessionTransferToken = &inputs.CanCreateToken + if len(inputs.AllowedAuthMethods) > 0 { st.AllowedAuthenticationMethods = &inputs.AllowedAuthMethods } From b06fe29df5b1baa6b0ac886199a72a6654c472b8 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 15:29:29 +0530 Subject: [PATCH 09/16] test(apps, email, logs, phone): update tests to ensure boolean flags remain intact - Added tests to verify that updating specific values does not affect the boolean flags for session transfer, email provider, log streams, and phone provider. - Ensured that the `can_create_session_transfer_token`, `enabled`, `sink.splunkSecure`, and `disabled` flags retain their values after updates. - Updated the following test cases: - apps-test-cases.yaml - email-test-cases.yaml - logs-test-cases.yaml - phone-test-cases.yaml --- test/integration/apps-test-cases.yaml | 10 +++++++++- test/integration/email-test-cases.yaml | 20 ++++++++++++++++++-- test/integration/logs-test-cases.yaml | 8 ++++++++ test/integration/phone-test-cases.yaml | 10 +++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/test/integration/apps-test-cases.yaml b/test/integration/apps-test-cases.yaml index 50b6ad874..9447ebf7d 100644 --- a/test/integration/apps-test-cases.yaml +++ b/test/integration/apps-test-cases.yaml @@ -300,6 +300,14 @@ tests: can_create_session_transfer_token: "true" allowed_authentication_methods: "[cookie query]" enforce_device_binding: asn + + 039.1 - it successfully updates only specified value of the application session-transfer without affecting can_create_session_transfer_token boolean value: + command: auth0 apps session-transfer update $(./test/integration/scripts/get-app-id.sh) --enforce-device-binding=ip --json + exit-code: 0 + stdout: + json: + can_create_session_transfer_token: "true" + enforce_device_binding: ip 040 - it successfully renders the session-transfer of an application: command: auth0 apps session-transfer show $(./test/integration/scripts/get-app-id.sh) @@ -308,7 +316,7 @@ tests: contains: - CAN CREATE TOKEN ✓ - ALLOWED METHODS cookie, query - - DEVICE BINDING asn + - DEVICE BINDING ip 041 - given a test app, it successfully deletes the app: command: auth0 apps delete $(./test/integration/scripts/get-app-id.sh) --force diff --git a/test/integration/email-test-cases.yaml b/test/integration/email-test-cases.yaml index 41b205263..404489658 100644 --- a/test/integration/email-test-cases.yaml +++ b/test/integration/email-test-cases.yaml @@ -55,6 +55,14 @@ tests: command: auth0 email provider update --enabled --default-from-address='admin@auth0.invalid' exit-code: 0 + 011.1 - update only specified value without affecting the enabled boolean value: + command: auth0 email provider update --default-from-address='test@auth0.invalid' --json + exit-code: 0 + stdout: + json: + enabled: "true" + default_from_address: "test@auth0.invalid" + 012 - it successfully shows the email provider: command: auth0 email provider show exit-code: 0 @@ -62,13 +70,21 @@ tests: contains: - PROVIDER mandrill - ENABLED ✓ - - DEFAULT FROM ADDRESS admin@auth0.invalid + - DEFAULT FROM ADDRESS test@auth0.invalid - SETTINGS {"message":{"view_content_link":false}} 100 - it successfully updates welcome email template: command: auth0 email templates update welcome --enabled --body "

Welcome!

" --from "welcome@travel0.com" --lifetime 6100 --subject "Welcome to Travel0" --url "travel0.com" --force exit-code: 0 + 100.1 - it successfully updates only specified value without affecting the enabled boolean flag: + command: auth0 email templates update welcome --url "test.travel0.com" --json + exit-code: 0 + stdout: + json: + enabled: "true" + resultUrl: "test.travel0.com" + 101 - it successfully shows welcome email template: command: auth0 email templates show welcome exit-code: 0 @@ -77,7 +93,7 @@ tests: - TEMPLATE Welcome Email - FROM welcome@travel0.com - SUBJECT Welcome to Travel0 - - RESULT URL travel0.com + - RESULT URL test.travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ diff --git a/test/integration/logs-test-cases.yaml b/test/integration/logs-test-cases.yaml index c9c873bc2..d103e203c 100644 --- a/test/integration/logs-test-cases.yaml +++ b/test/integration/logs-test-cases.yaml @@ -162,6 +162,14 @@ tests: sink.splunkPort: "8000" sink.splunkSecure: "true" + 022.1 - given a splunk log stream, it successfully updates only specified value without affecting secure boolean value: + command: auth0 logs streams update splunk $(cat ./test/integration/identifiers/log-stream-splunk-id) --port 8088 --json + exit-code: 0 + stdout: + json: + sink.splunkSecure: "true" + sink.splunkPort: "8088" + 023 - given a splunk log stream, it successfully deletes the log stream: command: auth0 logs streams delete $(cat ./test/integration/identifiers/log-stream-splunk-id) --force --no-input exit-code: 0 diff --git a/test/integration/phone-test-cases.yaml b/test/integration/phone-test-cases.yaml index fb557279a..c324a0b5b 100644 --- a/test/integration/phone-test-cases.yaml +++ b/test/integration/phone-test-cases.yaml @@ -59,6 +59,14 @@ tests: command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=custom --disabled --configuration '{ "delivery_methods":["text", "voice"] }' exit-code: 0 + 10.1 - update only the specified value without affecting the disabled boolean flag: + command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --configuration '{ "delivery_methods":["text"] }' + exit-code: 0 + contains: + json: + disabled: "true" + configuration: {"delivery_methods":["text"]} + 011 - it successfully shows the phone provider: command: auth0 phone provider show $(./test/integration/scripts/get-custom-phone-provider-id.sh) exit-code: 0 @@ -66,7 +74,7 @@ tests: contains: - PROVIDER custom - DISABLED ✓ - - CONFIGURATION {"delivery_methods":["text","voice"]} + - CONFIGURATION {"delivery_methods":["text"]} 012 - delete phone provider: command: auth0 phone provider delete --force $(./test/integration/scripts/get-custom-phone-provider-id.sh) From b4a649d6dec1560351a3d3e3847a1601a38e167c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 15:40:00 +0530 Subject: [PATCH 10/16] test(rules): update test to ensure enabled boolean flags remain intact - Uncommented existing rules test cases. - Ensured that the 'enabled' boolean flag is correctly set and maintained across various operations. --- test/integration/rules-test-cases.yaml | 147 +++++++++++++------------ 1 file changed, 78 insertions(+), 69 deletions(-) diff --git a/test/integration/rules-test-cases.yaml b/test/integration/rules-test-cases.yaml index 9cf15d107..890dec20d 100644 --- a/test/integration/rules-test-cases.yaml +++ b/test/integration/rules-test-cases.yaml @@ -17,72 +17,81 @@ tests: 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 + 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 + + 011 - rules update only specified value without affecting the enabled boolean value: + command: auth0 rules update $(./test/integration/scripts/get-rule-id.sh) --name integration-test-rule-updatedName --json + stdout: + json: + enabled: "true" + name: integration-test-rule-updatedName + exit-code: 0 + + 012 - rules disable: + command: auth0 rules disable $(./test/integration/scripts/get-rule-id.sh) --json + stdout: + json: + enabled: "false" + exit-code: 0 + From ea6116cca24f0caff4ac893530790fb338c10463 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 17:08:34 +0530 Subject: [PATCH 11/16] test(phone): ensure update command preserves disabled boolean flag - Updated test case to verify that the disabled boolean flag remains unchanged when updating the phone provider configuration. --- test/integration/phone-test-cases.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/phone-test-cases.yaml b/test/integration/phone-test-cases.yaml index c324a0b5b..e5d4cd036 100644 --- a/test/integration/phone-test-cases.yaml +++ b/test/integration/phone-test-cases.yaml @@ -59,22 +59,22 @@ tests: command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=custom --disabled --configuration '{ "delivery_methods":["text", "voice"] }' exit-code: 0 - 10.1 - update only the specified value without affecting the disabled boolean flag: - command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --configuration '{ "delivery_methods":["text"] }' + 010.1 - update only the specified value without affecting the disabled boolean flag: + command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=twilio --json exit-code: 0 - contains: + stdout: json: disabled: "true" - configuration: {"delivery_methods":["text"]} + name: "twilio" 011 - it successfully shows the phone provider: command: auth0 phone provider show $(./test/integration/scripts/get-custom-phone-provider-id.sh) exit-code: 0 stdout: contains: - - PROVIDER custom + - PROVIDER twilio - DISABLED ✓ - - CONFIGURATION {"delivery_methods":["text"]} + - CONFIGURATION {"delivery_methods":["text","voice"]} 012 - delete phone provider: command: auth0 phone provider delete --force $(./test/integration/scripts/get-custom-phone-provider-id.sh) From f70d45c442171054bd8d0c2ab2e9985f98136f77 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Tue, 17 Feb 2026 17:17:51 +0530 Subject: [PATCH 12/16] Revert "test(rules): update test to ensure enabled boolean flags remain intact" This reverts commit b4a649d6dec1560351a3d3e3847a1601a38e167c. --- test/integration/rules-test-cases.yaml | 147 ++++++++++++------------- 1 file changed, 69 insertions(+), 78 deletions(-) diff --git a/test/integration/rules-test-cases.yaml b/test/integration/rules-test-cases.yaml index 890dec20d..9cf15d107 100644 --- a/test/integration/rules-test-cases.yaml +++ b/test/integration/rules-test-cases.yaml @@ -17,81 +17,72 @@ tests: 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 - - 011 - rules update only specified value without affecting the enabled boolean value: - command: auth0 rules update $(./test/integration/scripts/get-rule-id.sh) --name integration-test-rule-updatedName --json - stdout: - json: - enabled: "true" - name: integration-test-rule-updatedName - exit-code: 0 - - 012 - rules disable: - command: auth0 rules disable $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - enabled: "false" - exit-code: 0 - +# 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 From 43790b4811ac69fa1ec8ab3fe3450edfe4b5bbb5 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Thu, 26 Feb 2026 18:10:44 +0530 Subject: [PATCH 13/16] test(apps, email, logs, phone): update tests to preserve boolean flags - Renumbered test cases to maintain sequential order after updates. --- go.mod | 2 +- go.sum | 6 +-- test/integration/apps-test-cases.yaml | 16 +++---- test/integration/email-test-cases.yaml | 58 +++++++++++++------------- test/integration/logs-test-cases.yaml | 10 ++--- test/integration/phone-test-cases.yaml | 14 +++---- 6 files changed, 52 insertions(+), 54 deletions(-) diff --git a/go.mod b/go.mod index 46de237e1..c5ec2d206 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 github.com/PuerkitoBio/rehttp v1.4.0 github.com/atotto/clipboard v0.1.4 - github.com/auth0/go-auth0 v1.33.0 + github.com/auth0/go-auth0 v1.34.0 github.com/briandowns/spinner v1.23.2 github.com/charmbracelet/glamour v0.10.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e diff --git a/go.sum b/go.sum index ec3d81e44..ae956dda1 100644 --- a/go.sum +++ b/go.sum @@ -22,10 +22,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/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/auth0/go-auth0 v1.32.1 h1:AAXQqaNaFZWkRm2bg5mVVXpqDLmusv7v238uIaxuFpo= -github.com/auth0/go-auth0 v1.32.1/go.mod h1:32sQB1uAn+99fJo6N819EniKq8h785p0ag0lMWhiTaE= -github.com/auth0/go-auth0 v1.33.0 h1:7qx0UCA6Tn2udnEVA35xzKsseh/R9559f+nnGcUI0Ss= -github.com/auth0/go-auth0 v1.33.0/go.mod h1:32sQB1uAn+99fJo6N819EniKq8h785p0ag0lMWhiTaE= +github.com/auth0/go-auth0 v1.34.0 h1:5rtel4yYbYp+NYlVf3ryxSRaDHWxJubtVc+cqdLMa7o= +github.com/auth0/go-auth0 v1.34.0/go.mod h1:32sQB1uAn+99fJo6N819EniKq8h785p0ag0lMWhiTaE= 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/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= diff --git a/test/integration/apps-test-cases.yaml b/test/integration/apps-test-cases.yaml index 9447ebf7d..a337f0741 100644 --- a/test/integration/apps-test-cases.yaml +++ b/test/integration/apps-test-cases.yaml @@ -301,7 +301,7 @@ tests: allowed_authentication_methods: "[cookie query]" enforce_device_binding: asn - 039.1 - it successfully updates only specified value of the application session-transfer without affecting can_create_session_transfer_token boolean value: + 040 - it successfully updates only specified value of the application session-transfer without affecting can_create_session_transfer_token boolean value: command: auth0 apps session-transfer update $(./test/integration/scripts/get-app-id.sh) --enforce-device-binding=ip --json exit-code: 0 stdout: @@ -309,7 +309,7 @@ tests: can_create_session_transfer_token: "true" enforce_device_binding: ip - 040 - it successfully renders the session-transfer of an application: + 041 - it successfully renders the session-transfer of an application: command: auth0 apps session-transfer show $(./test/integration/scripts/get-app-id.sh) exit-code: 0 stdout: @@ -318,15 +318,15 @@ tests: - ALLOWED METHODS cookie, query - DEVICE BINDING ip - 041 - given a test app, it successfully deletes the app: + 042 - given a test app, it successfully deletes the app: command: auth0 apps delete $(./test/integration/scripts/get-app-id.sh) --force exit-code: 0 - 042 - it successfully creates a resource server app with resource-server-identifier: + 043 - it successfully creates a resource server app with resource-server-identifier: command: ./test/integration/scripts/get-resource-server-app-id.sh exit-code: 0 - 043 - it successfully creates a resource server app with resource-server-identifier and outputs in json: + 044 - it successfully creates a resource server app with resource-server-identifier and outputs in json: command: auth0 apps show $(./test/integration/scripts/get-resource-server-app-id.sh) --json exit-code: 0 stdout: @@ -335,7 +335,7 @@ tests: app_type: resource_server resource_server_identifier: http://integration-test-api-newapi - 044 - it shows resource server app with resource-server-identifier: + 045 - it shows resource server app with resource-server-identifier: command: auth0 apps show $(./test/integration/scripts/get-resource-server-app-id.sh) exit-code: 0 stdout: @@ -343,13 +343,13 @@ tests: - TYPE Resource Server - RESOURCE SERVER IDENTIFIER http://integration-test-api-newapi - 045 - it fails to update resource-server-identifier (immutable property): + 046 - it fails to update resource-server-identifier (immutable property): command: auth0 apps update $(./test/integration/scripts/get-resource-server-app-id.sh) --resource-server-identifier http://new-api.localhost --json exit-code: 1 stderr: contains: - "Unknown flag: --resource-server-identifier" - 046 - given a resource server app, it successfully deletes the app: + 047 - given a resource server app, it successfully deletes the app: command: auth0 apps delete $(./test/integration/scripts/get-resource-server-app-id.sh) --force exit-code: 0 diff --git a/test/integration/email-test-cases.yaml b/test/integration/email-test-cases.yaml index 404489658..107b8779e 100644 --- a/test/integration/email-test-cases.yaml +++ b/test/integration/email-test-cases.yaml @@ -55,15 +55,15 @@ tests: command: auth0 email provider update --enabled --default-from-address='admin@auth0.invalid' exit-code: 0 - 011.1 - update only specified value without affecting the enabled boolean value: + 012 - update only specified value without affecting the enabled boolean value: command: auth0 email provider update --default-from-address='test@auth0.invalid' --json exit-code: 0 stdout: - json: - enabled: "true" - default_from_address: "test@auth0.invalid" + contains: + - ENABLED ✓ + - DEFAULT FROM ADDRESS test@auth0.invalid - 012 - it successfully shows the email provider: + 013 - it successfully shows the email provider: command: auth0 email provider show exit-code: 0 stdout: @@ -77,15 +77,15 @@ tests: command: auth0 email templates update welcome --enabled --body "

Welcome!

" --from "welcome@travel0.com" --lifetime 6100 --subject "Welcome to Travel0" --url "travel0.com" --force exit-code: 0 - 100.1 - it successfully updates only specified value without affecting the enabled boolean flag: + 101 - it successfully updates only specified value without affecting the enabled boolean flag: command: auth0 email templates update welcome --url "test.travel0.com" --json exit-code: 0 stdout: - json: - enabled: "true" - resultUrl: "test.travel0.com" + contains: + - RESULT URL test.travel0.com + - ENABLED ✓ - 101 - it successfully shows welcome email template: + 102 - it successfully shows welcome email template: command: auth0 email templates show welcome exit-code: 0 stdout: @@ -97,11 +97,11 @@ tests: - RESULT URL LIFETIME 6100 - ENABLED ✓ - 102 - it successfully updates verify-link email template: + 103 - it successfully updates verify-link email template: command: auth0 email templates update verify-link --enabled --body "

Verify link

" --from "verify@travel0.com" --lifetime 6100 --subject "Verify link" --url "travel0.com" --force exit-code: 0 - 103 - it successfully shows verify-link email template: + 104 - it successfully shows verify-link email template: command: auth0 email templates show verify-link exit-code: 0 stdout: @@ -112,11 +112,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 104 - it successfully updates verify-code email template: + 105 - it successfully updates verify-code email template: command: auth0 email templates update verify-code --enabled --body "

Verify code

" --from "verify@travel0.com" --lifetime 6100 --subject "Verify code" --url "travel0.com" --force exit-code: 0 - 105 - it successfully shows verify-code email template: + 106 - it successfully shows verify-code email template: command: auth0 email templates show verify-code exit-code: 0 stdout: @@ -127,11 +127,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 106 - it successfully updates change-password email template: + 107 - it successfully updates change-password email template: command: auth0 email templates update change-password --enabled --body "

Change password

" --from "change-password@travel0.com" --lifetime 6100 --subject "Change password" --url "travel0.com" --force exit-code: 0 - 107 - it successfully shows change-password email template: + 108 - it successfully shows change-password email template: command: auth0 email templates show change-password exit-code: 0 stdout: @@ -142,11 +142,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 108 - it successfully updates blocked-account email template: + 109 - it successfully updates blocked-account email template: command: auth0 email templates update blocked-account --enabled --body "

Change password

" --from "blocked@travel0.com" --lifetime 6100 --subject "Blocked!" --url "travel0.com" --force exit-code: 0 - 109 - it successfully shows blocked-account email template: + 110 - it successfully shows blocked-account email template: command: auth0 email templates show blocked-account exit-code: 0 stdout: @@ -157,11 +157,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 110 - it successfully updates password-breach email template: + 111 - it successfully updates password-breach email template: command: auth0 email templates update password-breach --enabled --body "

Password breached

" --from "security@travel0.com" --lifetime 6100 --subject "Breached Password!" --url "travel0.com" --force exit-code: 0 - 111 - it successfully shows password-breach email template: + 112 - it successfully shows password-breach email template: command: auth0 email templates show password-breach exit-code: 0 stdout: @@ -172,11 +172,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 112 - it successfully updates mfa-enrollment email template: + 113 - it successfully updates mfa-enrollment email template: command: auth0 email templates update mfa-enrollment --enabled --body "

Enroll in MFA

" --from "security@travel0.com" --lifetime 6100 --subject "Enroll in MFA!" --url "travel0.com" --force exit-code: 0 - 113 - it successfully shows mfa-enrollment email template: + 114 - it successfully shows mfa-enrollment email template: command: auth0 email templates show mfa-enrollment exit-code: 0 stdout: @@ -187,11 +187,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 114 - it successfully updates mfa-code email template: + 115 - it successfully updates mfa-code email template: command: auth0 email templates update mfa-code --enabled --body "

MFA Enrollment code

" --from "security@travel0.com" --lifetime 6100 --subject "MFA Enrollment Code" --url "travel0.com" --force exit-code: 0 - 115 - it successfully shows mfa-code email template: + 116 - it successfully shows mfa-code email template: command: auth0 email templates show mfa-code exit-code: 0 stdout: @@ -202,11 +202,11 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 116 - it successfully updates user-invitation email template: + 117 - it successfully updates user-invitation email template: command: auth0 email templates update user-invitation --enabled --body "

You are invited!

" --from "invited@travel0.com" --lifetime 6100 --subject "You are invited!" --url "travel0.com" --force exit-code: 0 - 117 - it successfully shows user-invitation email template: + 118 - it successfully shows user-invitation email template: command: auth0 email templates show user-invitation exit-code: 0 stdout: @@ -217,7 +217,7 @@ tests: - RESULT URL travel0.com - RESULT URL LIFETIME 6100 - ENABLED ✓ - 118 - it successfully shows user-invitation email template (json): + 119 - it successfully shows user-invitation email template (json): command: "auth0 email templates show user-invitation --json | jq ." exit-code: 0 stdout: @@ -230,11 +230,11 @@ tests: syntax: "liquid" urlLifetimeInSeconds: "6100" enabled: "true" - 119 - it successfully updates async-approval email template: + 120 - it successfully updates async-approval email template: command: auth0 email templates update async-approval --enabled --body "

Async Approval Required

" --from "approval@travel0.com" --lifetime 6100 --subject "Approval Required" --url "travel0.com" --force exit-code: 0 - 120 - it successfully shows async-approval email template: + 121 - it successfully shows async-approval email template: command: auth0 email templates show async-approval exit-code: 0 stdout: diff --git a/test/integration/logs-test-cases.yaml b/test/integration/logs-test-cases.yaml index d103e203c..d99fc1242 100644 --- a/test/integration/logs-test-cases.yaml +++ b/test/integration/logs-test-cases.yaml @@ -162,7 +162,7 @@ tests: sink.splunkPort: "8000" sink.splunkSecure: "true" - 022.1 - given a splunk log stream, it successfully updates only specified value without affecting secure boolean value: + 023 - given a splunk log stream, it successfully updates only specified value without affecting secure boolean value: command: auth0 logs streams update splunk $(cat ./test/integration/identifiers/log-stream-splunk-id) --port 8088 --json exit-code: 0 stdout: @@ -170,15 +170,15 @@ tests: sink.splunkSecure: "true" sink.splunkPort: "8088" - 023 - given a splunk log stream, it successfully deletes the log stream: + 024 - given a splunk log stream, it successfully deletes the log stream: command: auth0 logs streams delete $(cat ./test/integration/identifiers/log-stream-splunk-id) --force --no-input exit-code: 0 - 024 - it successfully creates a sumo log stream: + 025 - it successfully creates a sumo log stream: command: ./test/integration/scripts/create-log-stream-sumo-id.sh exit-code: 0 - 025 - given a sumo log stream, it successfully updates the log stream's details: + 026 - given a sumo log stream, it successfully updates the log stream's details: command: auth0 logs streams update sumo $(cat ./test/integration/identifiers/log-stream-sumo-id) --name integration-test-updated-sumo --source "https://collectors.sumologic.com/receiver/v1/http/update" --json --no-input exit-code: 0 stdout: @@ -188,6 +188,6 @@ tests: status: "active" sink.sumoSourceAddress: "https://collectors.sumologic.com/receiver/v1/http/update" - 026 - given a sumo log stream, it successfully deletes the log stream: + 027 - given a sumo log stream, it successfully deletes the log stream: command: auth0 logs streams delete $(cat ./test/integration/identifiers/log-stream-sumo-id) --force --no-input exit-code: 0 diff --git a/test/integration/phone-test-cases.yaml b/test/integration/phone-test-cases.yaml index e5d4cd036..1600d740f 100644 --- a/test/integration/phone-test-cases.yaml +++ b/test/integration/phone-test-cases.yaml @@ -59,15 +59,15 @@ tests: command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=custom --disabled --configuration '{ "delivery_methods":["text", "voice"] }' exit-code: 0 - 010.1 - update only the specified value without affecting the disabled boolean flag: + 011 - update only the specified value without affecting the disabled boolean flag: command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=twilio --json exit-code: 0 stdout: - json: - disabled: "true" - name: "twilio" + contains: + - PROVIDER twilio + - DISABLED ✓ - 011 - it successfully shows the phone provider: + 012 - it successfully shows the phone provider: command: auth0 phone provider show $(./test/integration/scripts/get-custom-phone-provider-id.sh) exit-code: 0 stdout: @@ -76,11 +76,11 @@ tests: - DISABLED ✓ - CONFIGURATION {"delivery_methods":["text","voice"]} - 012 - delete phone provider: + 013 - delete phone provider: command: auth0 phone provider delete --force $(./test/integration/scripts/get-custom-phone-provider-id.sh) exit-code: 0 - 013 - it doesn't show the phone provider: + 014 - it doesn't show the phone provider: command: auth0 phone provider list exit-code: 0 stderr: From 9c6b5044d5db59f027a4746664e731c62e3dee0e Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Thu, 26 Feb 2026 18:17:48 +0530 Subject: [PATCH 14/16] fix(cli): ensure boolean flags are preserved in updates - Removed redundant checks for boolean flags in various update commands. - Updated logic to set boolean flags based on user input or prompt. --- internal/cli/apps.go | 8 ++++---- .../cli/attack_protection_breached_password_detection.go | 7 +++---- internal/cli/attack_protection_brute_force_protection.go | 7 +++---- .../cli/attack_protection_suspicious_ip_throttling.go | 7 +++---- internal/cli/cli.go | 8 +++++--- internal/cli/email_provider.go | 9 +++++---- internal/cli/email_templates.go | 7 +++---- internal/cli/flags.go | 2 +- internal/cli/log_streams_splunk.go | 7 +++---- internal/cli/phone_provider.go | 8 ++++---- internal/cli/rules.go | 7 +++---- 11 files changed, 37 insertions(+), 40 deletions(-) diff --git a/internal/cli/apps.go b/internal/cli/apps.go index e7860695a..a468d978c 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -1161,9 +1161,6 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { } } - if !appSTCanCreateToken.IsSet(cmd) { - inputs.CanCreateToken = current.SessionTransfer.GetCanCreateSessionTransferToken() - } if err := appSTCanCreateToken.AskBoolU(cmd, &inputs.CanCreateToken, current.SessionTransfer.CanCreateSessionTransferToken); err != nil { return err } @@ -1177,7 +1174,10 @@ func appsSessionTransferUpdateCmd(cli *cli) *cobra.Command { return err } - st.CanCreateSessionTransferToken = &inputs.CanCreateToken + // Set the flag if it was supplied or entered by the prompt. + if appSTCanCreateToken.IsSet(cmd) || noLocalFlagSet(cmd) { + st.CanCreateSessionTransferToken = &inputs.CanCreateToken + } if len(inputs.AllowedAuthMethods) > 0 { st.AllowedAuthenticationMethods = &inputs.AllowedAuthMethods diff --git a/internal/cli/attack_protection_breached_password_detection.go b/internal/cli/attack_protection_breached_password_detection.go index b940ed6cc..02b95507e 100644 --- a/internal/cli/attack_protection_breached_password_detection.go +++ b/internal/cli/attack_protection_breached_password_detection.go @@ -152,13 +152,12 @@ func updateBreachedPasswordDetectionCmdRun( return err } - if !bpdFlags.Enabled.IsSet(cmd) { - inputs.Enabled = bpd.GetEnabled() - } if err := bpdFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, bpd.Enabled); err != nil { return err } - bpd.Enabled = &inputs.Enabled + if bpdFlags.Enabled.IsSet(cmd) || noLocalFlagSet(cmd) { + bpd.Enabled = &inputs.Enabled + } shieldsString := strings.Join(bpd.GetShields(), ",") if err := bpdFlags.Shields.AskManyU(cmd, &inputs.Shields, &shieldsString); err != nil { diff --git a/internal/cli/attack_protection_brute_force_protection.go b/internal/cli/attack_protection_brute_force_protection.go index 8c77a523d..bd290d697 100644 --- a/internal/cli/attack_protection_brute_force_protection.go +++ b/internal/cli/attack_protection_brute_force_protection.go @@ -163,13 +163,12 @@ func updateBruteForceDetectionCmdRun( return err } - if !bfpFlags.Enabled.IsSet(cmd) { - inputs.Enabled = bfp.GetEnabled() - } if err := bfpFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, bfp.Enabled); err != nil { return err } - bfp.Enabled = &inputs.Enabled + if bfpFlags.Enabled.IsSet(cmd) || noLocalFlagSet(cmd) { + bfp.Enabled = &inputs.Enabled + } shieldsString := strings.Join(bfp.GetShields(), ",") if err := bfpFlags.Shields.AskManyU(cmd, &inputs.Shields, &shieldsString); err != nil { diff --git a/internal/cli/attack_protection_suspicious_ip_throttling.go b/internal/cli/attack_protection_suspicious_ip_throttling.go index caec37b8f..c844598fb 100644 --- a/internal/cli/attack_protection_suspicious_ip_throttling.go +++ b/internal/cli/attack_protection_suspicious_ip_throttling.go @@ -186,13 +186,12 @@ func updateSuspiciousIPThrottlingCmdRun( return err } - if !sitFlags.Enabled.IsSet(cmd) { - inputs.Enabled = sit.GetEnabled() - } if err := sitFlags.Enabled.AskBoolU(cmd, &inputs.Enabled, sit.Enabled); err != nil { return err } - sit.Enabled = &inputs.Enabled + if sitFlags.Enabled.IsSet(cmd) || noLocalFlagSet(cmd) { + sit.Enabled = &inputs.Enabled + } shieldsString := strings.Join(sit.GetShields(), ",") if err := sitFlags.Shields.AskManyU(cmd, &inputs.Shields, &shieldsString); err != nil { diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 61d1fb5d7..f2d292174 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -161,15 +161,17 @@ func canPrompt(cmd *cobra.Command) bool { return iostream.IsInputTerminal() && iostream.IsOutputTerminal() && !noInput } -func shouldPromptWhenNoLocalFlagsSet(cmd *cobra.Command) bool { +// noLocalFlagSet returns true if no local flags (excluding global flags) are set for the command. +func noLocalFlagSet(cmd *cobra.Command) bool { localFlagIsSet := false cmd.LocalFlags().VisitAll(func(f *pflag.Flag) { - if f.Name != "json" && f.Name != "force" && f.Changed && f.Name != "json-compact" { + if f.Changed && f.Name != "json" && f.Name != "json-compact" && f.Name != "tenant" && f.Name != "force" && f.Name != "debug" && f.Name != "no-color" { localFlagIsSet = true + return } }) - return canPrompt(cmd) && !localFlagIsSet + return !localFlagIsSet } func prepareInteractivity(cmd *cobra.Command) { diff --git a/internal/cli/email_provider.go b/internal/cli/email_provider.go index ec0bd8c56..8103cfe99 100644 --- a/internal/cli/email_provider.go +++ b/internal/cli/email_provider.go @@ -302,9 +302,6 @@ func updateEmailProviderCmd(cli *cli) *cobra.Command { if err := emailProviderFrom.AskU(cmd, &inputs.defaultFromAddress, currentProvider.DefaultFromAddress); err != nil { return err } - if !emailProviderEnabled.IsSet(cmd) { - inputs.enabled = currentProvider.GetEnabled() - } if err := emailProviderEnabled.AskBoolU(cmd, &inputs.enabled, currentProvider.Enabled); err != nil { return err } @@ -357,7 +354,11 @@ func updateEmailProviderCmd(cli *cli) *cobra.Command { return fmt.Errorf("unknown provider: %s", inputs.name) } } - emailProvider.Enabled = &inputs.enabled + + // Set the flag if it was supplied or entered by the prompt. + if emailProviderEnabled.IsSet(cmd) || noLocalFlagSet(cmd) { + emailProvider.Enabled = &inputs.enabled + } if len(inputs.defaultFromAddress) > 0 { emailProvider.DefaultFromAddress = &inputs.defaultFromAddress diff --git a/internal/cli/email_templates.go b/internal/cli/email_templates.go index c3b5fc836..59064b9f7 100644 --- a/internal/cli/email_templates.go +++ b/internal/cli/email_templates.go @@ -247,19 +247,18 @@ func updateEmailTemplateCmd(cli *cli) *cobra.Command { } } - if !emailTemplateEnabled.IsSet(cmd) { - inputs.Enabled = oldTemplate.GetEnabled() - } if err := emailTemplateEnabled.AskBoolU(cmd, &inputs.Enabled, oldTemplate.Enabled); err != nil { return err } template := apiEmailTemplateFor(inputs.Template) emailTemplate := &management.EmailTemplate{ - Enabled: &inputs.Enabled, Template: &template, Syntax: oldTemplate.Syntax, } + if emailTemplateEnabled.IsSet(cmd) || noLocalFlagSet(cmd) { + emailTemplate.Enabled = &inputs.Enabled + } if inputs.Body != "" { emailTemplate.Body = &inputs.Body } diff --git a/internal/cli/flags.go b/internal/cli/flags.go index c3eab463b..a72b43b61 100644 --- a/internal/cli/flags.go +++ b/internal/cli/flags.go @@ -438,7 +438,7 @@ func shouldAsk(cmd *cobra.Command, f *Flag, isUpdate bool) bool { if !f.IsRequired && !f.AlwaysPrompt { return false } - return shouldPromptWhenNoLocalFlagsSet(cmd) + return canPrompt(cmd) && noLocalFlagSet(cmd) } return canPrompt(cmd) && !f.IsSet(cmd) diff --git a/internal/cli/log_streams_splunk.go b/internal/cli/log_streams_splunk.go index 6286aa3ae..b8f08761a 100644 --- a/internal/cli/log_streams_splunk.go +++ b/internal/cli/log_streams_splunk.go @@ -228,9 +228,6 @@ func updateLogStreamsSplunkCmd(cli *cli) *cobra.Command { if err := splunkPort.AskU(cmd, &inputs.splunkPort, splunkSink.Port); err != nil { return err } - if !splunkVerifyTLS.IsSet(cmd) { - inputs.splunkVerifyTLS = splunkSink.GetSecure() - } if err := splunkVerifyTLS.AskBoolU(cmd, &inputs.splunkVerifyTLS, splunkSink.Secure); err != nil { return err } @@ -250,7 +247,9 @@ func updateLogStreamsSplunkCmd(cli *cli) *cobra.Command { if inputs.splunkPort != "" { splunkSink.Port = &inputs.splunkPort } - splunkSink.Secure = &inputs.splunkVerifyTLS + if splunkVerifyTLS.IsSet(cmd) || noLocalFlagSet(cmd) { + splunkSink.Secure = &inputs.splunkVerifyTLS + } updatedLogStream.Sink = splunkSink if inputs.piiConfig != "{}" { diff --git a/internal/cli/phone_provider.go b/internal/cli/phone_provider.go index a44659b0a..923858333 100644 --- a/internal/cli/phone_provider.go +++ b/internal/cli/phone_provider.go @@ -312,9 +312,6 @@ func updateBrandingPhoneProviderCmd(cli *cli) *cobra.Command { return err } - if !phoneProviderDisabled.IsSet(cmd) { - inputs.disabled = existingProvider.GetDisabled() - } if err := phoneProviderDisabled.AskBoolU(cmd, &inputs.disabled, existingProvider.Disabled); err != nil { return err } @@ -345,7 +342,10 @@ func updateBrandingPhoneProviderCmd(cli *cli) *cobra.Command { } } - phoneProvider.Disabled = &inputs.disabled + // Set the flag if it was supplied or entered by the prompt. + if phoneProviderDisabled.IsSet(cmd) || noLocalFlagSet(cmd) { + phoneProvider.Disabled = &inputs.disabled + } if credentials != nil { phoneProvider.Credentials = credentials diff --git a/internal/cli/rules.go b/internal/cli/rules.go index 75d8fa1a3..88390a119 100644 --- a/internal/cli/rules.go +++ b/internal/cli/rules.go @@ -363,9 +363,6 @@ func updateRuleCmd(cli *cli) *cobra.Command { if err := ruleName.AskU(cmd, &inputs.Name, oldRule.Name); err != nil { return err } - if !ruleEnabled.IsSet(cmd) { - inputs.Enabled = oldRule.GetEnabled() - } if err := ruleEnabled.AskBoolU(cmd, &inputs.Enabled, oldRule.Enabled); err != nil { return err } @@ -390,7 +387,9 @@ func updateRuleCmd(cli *cli) *cobra.Command { } } - updatedRule.Enabled = &inputs.Enabled + if ruleEnabled.IsSet(cmd) || noLocalFlagSet(cmd) { + updatedRule.Enabled = &inputs.Enabled + } if inputs.Name != "" { updatedRule.Name = &inputs.Name } From d919c1004837e65988722a523e7012bba901952c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Thu, 26 Feb 2026 18:28:43 +0530 Subject: [PATCH 15/16] fix(tests): remove the `--json` flag from the update commands in both email and phone test cases --- test/integration/email-test-cases.yaml | 4 ++-- test/integration/phone-test-cases.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/email-test-cases.yaml b/test/integration/email-test-cases.yaml index 107b8779e..76c389772 100644 --- a/test/integration/email-test-cases.yaml +++ b/test/integration/email-test-cases.yaml @@ -56,7 +56,7 @@ tests: exit-code: 0 012 - update only specified value without affecting the enabled boolean value: - command: auth0 email provider update --default-from-address='test@auth0.invalid' --json + command: auth0 email provider update --default-from-address='test@auth0.invalid' exit-code: 0 stdout: contains: @@ -78,7 +78,7 @@ tests: exit-code: 0 101 - it successfully updates only specified value without affecting the enabled boolean flag: - command: auth0 email templates update welcome --url "test.travel0.com" --json + command: auth0 email templates update welcome --url "test.travel0.com" exit-code: 0 stdout: contains: diff --git a/test/integration/phone-test-cases.yaml b/test/integration/phone-test-cases.yaml index 1600d740f..6a63da197 100644 --- a/test/integration/phone-test-cases.yaml +++ b/test/integration/phone-test-cases.yaml @@ -60,7 +60,7 @@ tests: exit-code: 0 011 - update only the specified value without affecting the disabled boolean flag: - command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=twilio --json + command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=twilio exit-code: 0 stdout: contains: From 42e43e38f0b0434902677c0638ad524d6cf99218 Mon Sep 17 00:00:00 2001 From: ramya18101 Date: Thu, 26 Feb 2026 20:09:47 +0530 Subject: [PATCH 16/16] update app name in script and adjust phone test cases for configuration changes --- test/integration/phone-test-cases.yaml | 8 ++++---- test/integration/scripts/get-org-inv-app-id.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/phone-test-cases.yaml b/test/integration/phone-test-cases.yaml index 6a63da197..cb385a5a9 100644 --- a/test/integration/phone-test-cases.yaml +++ b/test/integration/phone-test-cases.yaml @@ -60,11 +60,11 @@ tests: exit-code: 0 011 - update only the specified value without affecting the disabled boolean flag: - command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --provider=twilio + command: auth0 phone provider update $(./test/integration/scripts/get-custom-phone-provider-id.sh) --configuration '{ "delivery_methods":["text"] }' exit-code: 0 stdout: contains: - - PROVIDER twilio + - CONFIGURATION {"delivery_methods":["text"]} - DISABLED ✓ 012 - it successfully shows the phone provider: @@ -72,9 +72,9 @@ tests: exit-code: 0 stdout: contains: - - PROVIDER twilio + - PROVIDER custom - DISABLED ✓ - - CONFIGURATION {"delivery_methods":["text","voice"]} + - CONFIGURATION {"delivery_methods":["text"]} 013 - delete phone provider: command: auth0 phone provider delete --force $(./test/integration/scripts/get-custom-phone-provider-id.sh) diff --git a/test/integration/scripts/get-org-inv-app-id.sh b/test/integration/scripts/get-org-inv-app-id.sh index df589e6cd..cb3db9bf2 100755 --- a/test/integration/scripts/get-org-inv-app-id.sh +++ b/test/integration/scripts/get-org-inv-app-id.sh @@ -6,7 +6,7 @@ if [ -f "$FILE" ]; then exit 0 fi -app=$( auth0 apps create -n integration-test-org-inv-app -t native --description NewApp --json --no-input ) +app=$( auth0 apps create -n integration-test-app-org-inv -t native --description NewApp --json --no-input ) client_id=$( echo "$app" | jq -r '.["client_id"]' )