Skip to content

Fix unintended boolean values clearing in update commands#1442

Open
bkiran6398 wants to merge 12 commits intomainfrom
DXCDT-1455/fix-boolean-disabling-in-update
Open

Fix unintended boolean values clearing in update commands#1442
bkiran6398 wants to merge 12 commits intomainfrom
DXCDT-1455/fix-boolean-disabling-in-update

Conversation

@bkiran6398
Copy link
Contributor

@bkiran6398 bkiran6398 commented Feb 16, 2026

🔧 Changes

Fixes boolean flag preservation across 9 update commands to prevent unintended state changes when updating resources.

Problem: When updating CLI resources without explicitly setting boolean flags (but explicitly setting any other value in flag), the existing boolean state was not unintentionally clearing.

Solution: Added checks before AskBoolU calls to preserve current state when flags are not explicitly set by the user.

Commands Fixed:

  • auth0 apps session-transfer update - CanCreateToken flag
  • auth0 protection breached-password-detection update - Enabled flag
  • auth0 protection brute-force-protection update - Enabled flag
  • auth0 protection suspicious-ip-throttling update - Enabled flag
  • auth0 email-provider update - Enabled flag
  • auth0 email-templates update - Enabled flag
  • auth0 log-streams splunk update - Secure flag
  • auth0 phone-provider update - Disabled flag
  • auth0 rules update - Enabled flag

📚 References

🔬 Testing

Automated Testing:

  • Existing unit tests continue to pass
  • Added new integration tests to verify the update behavior of modified commands

Manual Testing:

  • Created/updated resources and verified unintended boolean state clearing is eliminated.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

…sfer

- 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.
…hed 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.
… 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.
…cious 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.
…emplate 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.
…e 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.
@bkiran6398 bkiran6398 marked this pull request as ready for review February 16, 2026 15:06
@bkiran6398 bkiran6398 requested a review from a team as a code owner February 16, 2026 15:06
@ramya18101
Copy link
Contributor

Update testcases with the scenarios..!

…s to ensure consistency

- Affected functions include:
  - appsSessionTransferUpdateCmd
  - updateEmailProviderCmd
  - updateEmailTemplateCmd
  - updateLogStreamsSplunkCmd
  - updateBrandingPhoneProviderCmd
  - updateRuleCmd
…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
- Uncommented existing rules test cases.
- Ensured that the 'enabled' boolean flag is correctly set and maintained across various operations.
- Updated test case to verify that the disabled boolean flag remains unchanged when updating the phone provider configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments