Skip to content

Array sorting in YAML is non-deterministic #1440

Description

@thecjharries

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this tool and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

Several arrays under attackProtection are non-deterministically sorted. This causes git thrash and unnecessary change management.

Expectation

Arrays should be sorted deterministically. The output should only change when changes are made to it.

Reproduction

  1. Enable attack protection (specifically breached password)
  2. Run a YAML export and commit the results
  3. ???
  4. Run another YAML export and diff

Here are some examples:

@@ -5681,14 +5761,14 @@ attackProtection:
   breachedPasswordDetection:
     enabled: false
     shields:
-      - user_notification
-      - block
       - admin_notification
+      - block
+      - user_notification
     admin_notification_frequency:
-      - daily
+      - weekly
       - monthly
       - immediately
-      - weekly
+      - daily
     method: standard
     stage:
       pre-user-registration:
@@ -5623,13 +5681,13 @@ attackProtection:
   breachedPasswordDetection:
     enabled: false
     shields:
-      - admin_notification
-      - block
       - user_notification
+      - block
+      - admin_notification
     admin_notification_frequency:
-      - immediately
       - daily
       - monthly
+      - immediately
       - weekly
     method: standard
     stage:
@@ -5605,9 +5628,9 @@ attackProtection:
       - user_notification
     admin_notification_frequency:
       - immediately
+      - daily
       - monthly
       - weekly
-      - daily
     method: standard
     stage:
       pre-user-registration:

Deploy CLI version

8.41.0

Node version

22.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions