From 8e0902112e971cb415142a5c788c1671cfd0e844 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Mon, 16 Feb 2026 18:57:43 +0530 Subject: [PATCH 01/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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