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

Create Matrix (Synapse) communication plugin

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MDL-76701-master
    • Hide

      Test scenario

      1. Navigate to Site Administration > Development.
      2. Click on Experimental settings.
      3. Verify that you will see a setting called Enable communications subsystems.
      4. Verify that the default value is unchecked (No).
      5. Enable the setting.
      6. Navigate to Site Administration > Plugins.
      7. Verify that you will see the Communication section.
      8. Verify that you will see the Manage communication providers.
      9. Click on the Manage communication providers link.
      10. Verify that you will see the Manage communication providers page.
      11. Verify that you will see Matrix.
      12. Verify that you can enable/disable the Matrix plugin by clicking on the "eye" icon.
      13. Click on the Settings link of Matrix plugin.
      14. Verify that you will see the settings page for the Matrix plugin.
      15. Navigate back to the Manage communication providers page.
      16. Verify that you can not uninstall the plugin.
      17. Navigate back to the Matrix settings page.
      18. Verify the following fields are required and can not save changes without them:
        1. Home server URL
        2. Access token 
        3. Refresh token
        4. Element web URL 
      19. Verify the following field enabled/checked as default:
        1. Create rooms for new courses
      20. Verify the following fields are password masked:
        1. Access token 
        2. Refresh token
      21. Add some information in the required fields.
      22. Click save changes.
      23. Verify the fields are saved properly.

       

      Show
      Test scenario Navigate to Site Administration > Development. Click on Experimental settings. Verify that you will see a setting called Enable communications subsystems. Verify that the default value is unchecked (No). Enable the setting. Navigate to Site Administration > Plugins. Verify that you will see the Communication section. Verify that you will see the Manage communication providers. Click on the Manage communication providers link. Verify that you will see the Manage communication providers page. Verify that you will see Matrix. Verify that you can enable/disable the Matrix plugin by clicking on the "eye" icon. Click on the Settings link of Matrix plugin. Verify that you will see the settings page for the Matrix plugin. Navigate back to the Manage communication providers page. Verify that you can not uninstall the plugin. Navigate back to the Matrix settings page. Verify the following fields are required and can not save changes without them: Home server URL Access token  Refresh token Element web URL  Verify the following field enabled/checked as default: Create rooms for new courses Verify the following fields are password masked: Access token  Refresh token Add some information in the required fields. Click save changes. Verify the fields are saved properly.  
    • 20
    • Team Hedgehog Sprint 1 review, Team Hedgehog Sprint 2.1
    • Large

    Description

      Create the initial plugin to interface with the Matrix Synapse server. This will be the plugin that does the actual API communication with the Matrix server. It should leverage the Guzzle PHP lib (MDL-76135) for comms and test mocking.

      The scope of this task is to create the “basics” of the plugin, which allows admins to set up their Matrix connection and configure the sitewide settings as outlined in the user stories below. Using admin settings pages.

      This plugin will likely need to implement webservices to support Matrix integration for the Moodle Mobile App as well as some Ajax related calls. For example linking/redirection to a Matrix homeserver. Some specific webservices will be added by other related trackers (such as creating rooms).

      Proposed plugin name: comm_matrix

      User stories:

      1. As an admin I want to be able to enter the details of my organisation's homeserver, including the administration user details. So my Moodle can connect to my organisation's Matrix server.
      2. As an admin I expect that Matrix chat rooms for new courses are enabled by default when I upgrade to Moodle 4.2 (providing I have configured my Moodle to connect to a Matrix homeserver).  So that going forward new courses have a better communication experience.
      3. As an admin I want to be able to set a default for new courses to either have Matrix rooms created or not. To assist my teachers.

      Admin Fields:

      The initial set of site wide plugins settings for admins, should be:

      • Access Token
        • An admin access token to authenticate against the Synapse Homeserver
        • This is a required field
        • This should be a password field
      • Refresh Token
        • The admin refresh token to associated with the access token
        • This field is required
        • This should be a password field.
      • Element Web URL
        • The URL to your Element Web instance.
        • This field is required.
      • Create rooms for new courses checkbox
        • When selected, new courses will have Matrix rooms enabled by default.
        • Defaults to on.

      The original idea was to have an admin username and password to access the Synapse server. However, the rationale in the Synapse docs makes a good case for using the access and refresh tokens. See: https://matrix-org.github.io/synapse/latest/usage/configuration/user_authentication/refresh_tokens.html 

      For the first iteration of development we’ll make the element web client url a requirement. This makes the workflow from Moodle to element for students and teachers easier. It will also give more time to work on the UX workflows for when an element web client isn’t available and/or the dedicated element app is available.

      Existing plugin

      It looks like the Matrix team have made a Moodle plugin themselves, here: https://github.com/matrix-org/moodle-mod_matrix/

      It would be good to review their approach, particularly around which Matrix API calls they used.

       

      Attachments

        1. result_2.png
          result_2.png
          137 kB
        2. result_1.png
          result_1.png
          54 kB

        Issue Links

          Activity

            People

              safat.shahin@moodle.com Safat Shahin
              matt.porritt@moodle.com Matt Porritt
              Huong Nguyen Huong Nguyen
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 1 day, 30 minutes
                  1w 1d 30m

                  Clockify

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