Community hub - technical specification
Operations
Following the different communication operations expected between Moodle.org, hub servers and Moodle site.
Moodle site and Hub server
Moodle.org Hub directory and (Moodle.org) Hub server
Moodle site and Moodle.org Hub directory
Method
We are going to use web service. However we create a new /hub/webservice.php entry point, that will by pass $CFG->enablewebservice and consider a protocol as activated.
Site/Hub Registration operations
- The site/hub creates a specific ws user, a specific ws role, a specific ws service and a specific token.
- The site/hub sends by POST the web service token to the hub server/hub directory.
- The hub server/hub directory creates a specific ws user, a specific ws role, a specific ws service and a specific token.
- The hub server/hub directory calls the web service function: confirm_registration($thisisyourtokentocallme).
- Finally the hub server/hub directory calls the web service call get_info function for its first time
Unknown caller operations
the hub/webservice.php entry point should by pass token authentication for this specific listed function
Operation list
- global search
- search courses on a hub
- site user rating (TBD)
- site user comment (TBD)
- get hub list from the hub directory
Other operations
The site/hub server/directory should all have specific token to talk to each other.
Security
Disable generated service and token
the security problems: somebody uses the hub access to execute other functions (either bug in moodle or admin misconfiguration); somebody uses normal services to execute hub function (site misconfiguration)
Solution: generated service and token should not be usable through normal /webservice/ entry points. Administration should not list the generated service and token. Cannot create a service with hub function.
Hacking testing
- hack client sites and updated the hub info with spam
- hack the hub and then tried to attack all client sites - probably some exploit of older version, or at least get as much emails and personal data from all sites
Note
- we need an option on settings page that:
- delete previous user,role,service,and token.
- Then the site rebuilds them.
- The site would just call a ws function confirm_registration($thisisyourtokentocallme) on the hub server/hub directory.
- we need to decide which ws protocol the community hub will use
Capability
Moodle.org Hub directory requires the capabilities:
- moodle/hubs:view (public token for any sites) for global search
- moodle/hubs:download (public token for any sites) for downloading a course template
Hub server requires the capabilities:
- moodle/hub:view (private token for Moodle.org Hub directory) for getting hub information
- moodle/hub:view (public token for any sites) for course searches
- moodle/hub:download (private token for Moodle.org Hub directory) for downloading a course template
- moodle/hub:download (public token for any sites) for downloading a course template
- moodle/hub:publish (public token for registered sites) for publishing a course template
- moodle/hub:rate (public token for any sites) for rating a course
- moodle/hub:comment (public token for any sites) for commenting a course
Registered site requires the capabilities:
- moodle/hubsite:view (private token for hub server) for getting site information
- moodle/hubcourse:view (private token for hub server) for getting course information
- moodle/hubcourse:download (private token for hub server) for downloading a course