Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84177

Upgrade JMESPath to 2.8.0

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0
    • 5.0
    • Libraries
    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • MDL-84177_upgrade-JMESPath-to-2-8-0
    • Hide

      (Copied from MDL-80641 and adjusted for the new SMS gateway feature)

      When it comes to testing, this resource for testing SMS sending in AWS will likely come in handy: https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html

      Prerequisites

      • To test this issue, you'll need a Moodle to which you have admin access.
      • You will need a resource to test SMS sending in AWS.
      • An admin account makes it easier to move through all the test settings. If you don't have CLI access to the instance, ensure access to two separate admin accounts. As part of the testing, it will lock out a user.

      Setup

      More detailed setup instructions for MFA testing can be found in MDL-78509, the following setup are just the basics and there is some assumed knowledge.

      Set up your SMS Sandbox

      1. Access to https://signin.aws.amazon.com with your credentials.
      2. From your AWS Console, go to Amazon SNS > Mobile > Text messaging(SMS) and enable it.
      3. Include some "Sandbox destination phone numbers"
      4. From Security credentials: create a new Access keys for this and save the "Key", "Secret" and "Region" for the configuration in Moodle. 

      More information about SMS sandbox can be found at:

      Test third-party libraries

      1. As an admin, go to Site Administration > Development > Third-party libraries.
      2. Verify that the library "JMESPath" is at version 2.8.0. 

      Test Mobile phone SMS Authentication:

      1. Access your Moodle as an admin user.
      2. Go to Site Administration > Plugins > Admin tools > Multi-factor authentication
      3. Enable the "MFA plugin enabled" Checkbox
      4. Go to Site Administration > Plugins > SMS > Manage SMS gateways
      5. Click "Create a new SMS gateway"
      6. Enter "AWS SNS" as Gateway name and enter the AWS credentials created before as Access key, Secret access key and Amazon API gateway region.
      7. Go to Site Administration > Plugins > Admin tools > Multi-factor authentication > Mobile phone SMS
      8. Select the "AWS SNS" gateway created just before, enable the factor and save the changes.
      9. Access to your user preferences / "Multi-factor authentication preferences"
      10. Set up the "Mobile phone SMS" factor with a test phone number.
      11. Verify you have received an SMS on your phone number
      12. Enter the code you received and continue. 
      13. Open another browser and access Moodle with your user 
      14. Enter your username and password, 
      15. Verify that a new screen will be displayed where it will ask for the mobile phone SMS.
      16. Verify you have received an SMS on your mobile. 
      17. Enter the code in the box and click on verify code
      18. Verify that you have been logged in successfully and you have access to Moodle.

       

      NOTE 1: If you mess things up and lock yourself out, you can disable the whole MFA plugin from the CLI:

      php admin/cli/cfg.php --component=tool_mfa --name=enabled --set=0

      NOTE 2: Reset user authentication factors

      1. Access to your Moodle as an admin user
      2. Go to Site Administration > Plugins > Admin tools > Multi-factor authentication > Reset user authentication factors
      3. Search by one user with authentication factors
      4. Click on the button "Reset user factor"

      PHP Unit tests 

      Please run PHPUnit for admin/tool/mfa/factor/sms/tests/factor_test.php

      for the MDK can use the below command:

      mdk phpunit -r -u admin/tool/mfa/factor/sms/tests/factor_test.php

      Or

      vendor/bin/phpunit admin/tool/mfa/factor/sms/tests/factor_test.php

      Show
      (Copied from MDL-80641 and adjusted for the new SMS gateway feature) When it comes to testing, this resource for testing SMS sending in AWS will likely come in handy: https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html Prerequisites To test this issue, you'll need a Moodle to which you have admin access. You will need a resource to test SMS sending in AWS. An admin account makes it easier to move through all the test settings. If you don't have CLI access to the instance, ensure access to two separate admin accounts. As part of the testing, it will lock out a user. Setup More detailed setup instructions for MFA testing can be found in  MDL-78509 , the following setup are just the basics and there is some assumed knowledge. Set up your SMS Sandbox Access to https://signin.aws.amazon.com with your credentials. From your AWS Console, go to Amazon SNS > Mobile > Text messaging(SMS) and enable it. Include some "Sandbox destination phone numbers" From Security credentials: create a new Access keys for this and save the "Key", "Secret" and "Region" for the configuration in Moodle.  More information about SMS sandbox can be found at: https://aws.amazon.com/blogs/compute/introducing-the-sms-sandbox-for-amazon-sns/ https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox-verifying-phone-numbers.html https://docs.aws.amazon.com/sns/latest/dg/sns-getting-started.html Test third-party libraries As an admin, go to Site Administration > Development > Third-party libraries. Verify that the library "JMESPath" is at version 2.8.0.  Test Mobile phone SMS Authentication: Access your Moodle as an admin user. Go to Site Administration > Plugins > Admin tools > Multi-factor authentication Enable the "MFA plugin enabled" Checkbox Go to  Site Administration > Plugins > SMS > Manage SMS gateways Click "Create a new SMS gateway" Enter "AWS SNS" as Gateway name and enter the AWS credentials created before as Access key , Secret access key and Amazon API gateway region . Go to  Site Administration > Plugins > Admin tools > Multi-factor authentication > Mobile phone SMS Select the "AWS SNS" gateway created just before, enable the factor and save the changes. Access to your user preferences / "Multi-factor authentication preferences" Set up the "Mobile phone SMS" factor with a test phone number. Verify you have received an SMS on your phone number Enter the code you received and continue.  Open another browser and access Moodle with your user  Enter your username and password,  Verify that a new screen will be displayed where it will ask for the mobile phone SMS. Verify you have received an SMS on your mobile.  Enter the code in the box and click on verify code Verify that you have been logged in successfully and you have access to Moodle.   NOTE 1: If you mess things up and lock yourself out, you can disable the whole MFA plugin from the CLI: php admin /cli/cfg .php --component=tool_mfa --name=enabled -- set =0 NOTE 2: Reset user authentication factors Access to your Moodle as an admin user Go to Site Administration > Plugins > Admin tools > Multi-factor authentication > Reset user authentication factors Search by one user with authentication factors Click on the button "Reset user factor" PHP Unit tests  Please run PHPUnit for  admin/tool/mfa/factor/sms/tests/factor_test.php for the MDK can use the below command: mdk phpunit -r -u admin /tool/mfa/factor/sms/tests/factor_test .php Or vendor /bin/phpunit admin /tool/mfa/factor/sms/tests/factor_test .php
    • Hide

      Code verified against automated checks.

      Checked MDL-84177 using repository: https://github.com/ziegenberg/moodle

      More information about this report

      Built on: Sat Mar 8 08:52:47 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84177 using repository: https://github.com/ziegenberg/moodle main (0 errors / 0 warnings) [branch: MDL-84177_upgrade-JMESPath-to-2-8-0 | CI Job ] More information about this report Built on: Sat Mar 8 08:52:47 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84177 _upgrade-JMESPath-to-2-8-0 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18214/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62216/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62217/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62218/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62219/ App tests (stable app version) Built on: Mon Feb 10 10:25:41 UTC 2025

      JMESPath    lib/jmespath    2.7.0  -->  2.8.0    https://github.com/jmespath/jmespath.php

        1. MDL-84177.png
          832 kB
          Ron Carl Alfon Yu

            Daniel Ziegenberg Daniel Ziegenberg
            sarjona Sara Arjona (@sarjona)
            Paul Holden Paul Holden
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 minutes
                4m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.