Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Community hub - technical specification: Difference between revisions

From MoodleDocs
Line 143: Line 143:
*His service is 'Hub directory public site'
*His service is 'Hub directory public site'


"Hub servers": they all have their own $name."_directory_hub_user" user.
"Hub servers": they all have their own $huburl."_directory_hub_user" user.
*Their role is 'Directory user'
*Their role is 'Directory user'
*Their service is 'Hub directory hub server'
*Their service is 'Hub directory hub server'
Line 153: Line 153:
*His service is 'Public site'  
*His service is 'Public site'  


"Registered sites": they all have their own $name.'_registered_site_user' user.
"Registered sites": they all have their own $siteurl.'_registered_site_user' user.
*Their role is 'Registered Hub User'.
*Their role is 'Registered Hub User'.
*Their service is 'Registered site'.
*Their service is 'Registered site'.


"Hub directory": they use their own $name.'_directory_user' (in case the hub directory change his url)
"Hub directory": they use their own $hubdirectoryurl.'_directory_user' (in case the hub directory change his url)
*Their role is 'Moodle.org Hub Directory'.
*Their role is 'Moodle.org Hub Directory'.
*Their service is 'Hub directory'.
*Their service is 'Hub directory'.
Line 163: Line 163:
==Registered Site==
==Registered Site==


"Hub servers": they all have their own $name.'_hub_user' user
"Hub servers": they all have their own $huburl.'_hub_user' user
*Their role is 'Hub User'
*Their role is 'Hub User'
*Their service is 'Hub server'
*Their service is 'Hub server'

Revision as of 05:20, 27 March 2010

Operations

Following the different communication operations expected between Moodle.org, hub servers and Moodle site.

Moodle site and Hub server

Moodlesite2hubserver.png

Moodle.org Hub directory and (Moodle.org) Hub server

Hubdirectory moodleorg2hubserver moodle.org.png Correction: Moodle.org will not get any template file, just course info (and if authorised only).

Moodle site and Moodle.org Hub directory

Moodlesite2moodleorg.png

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

  1. The site/hub creates a specific ws user, a specific ws role, a specific ws service and a specific token.
  2. The site/hub sends by POST the web service token to the hub server/hub directory.
  3. The hub server/hub directory creates a specific ws user, a specific ws role, a specific ws service and a specific token.
  4. The hub server/hub directory calls the web service function: confirm_registration($thisisyourtokentocallme).
  5. 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

  1. hack client sites and updated the hub info with spam
  2. 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:
  1. delete previous user,role,service,and token.
  2. Then the site rebuilds them.
  3. 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

New Roles

Moodle.org Hub list

"Public Directory User" - Role for any sites :

  • moodle/hubs:view (public token for any sites) for searching the global listing

"Directory User" - Role for hub to update the listing:

  • moodle/hubs:updateinfo (private token for any registered hub) for updating hub information (it creates a new private token different from the one used to call this function)

Hub server

Will have one new user per registered site, plus one for Moodle.org hub directory and one for pubic users.

"Public Hub User" - Role for any site (public token)

  • moodle/hub:view for course searches
  • moodle/hub:rate for rating a course
  • moodle/hub:comment for commenting a course
  • moodle/hub:download for downloading a course template

"Registered Hub User" - Role for registered sites (private token -> each site gets a private user)

  • moodle/hub:view for course searches
  • moodle/hub:rate for rating a course
  • moodle/hub:comment for commenting a course
  • moodle/hub:download for downloading a course template
  • moodle/hub:publish for publishing a course template
  • moodle/hub:updateinfo (private token for any registered site) for updating site information (it creates a new private token different from the one used to call this function)

"Moodle.org Hub Directory" - Role for Moodle.org Hub Directory (private token)

  • moodle/hub:viewinfo for getting hub information
  • moodle/hub:view for getting course information
  • moodle/hub:confirmhubregistration confirm the registration

Registered Site

Will have one new user for every hub it registers with.

"Hub User" - Role for Hub (private token)

  • moodle/hub:registerinfo for getting site information
  • moodle/hub:registercourses for getting course listing
  • moodle/hub:confirmsiteregistration confirm the registration

New Services

We will have one hidden service per role. Following their name:

Moodle.org Hub list

the following service will exist only on Moodle.org Hub directory

"Hub directory public site":

  • global search function

"Hub directory hub server":

  • update info function

Hub server

the following services will exist on any Moodle site (but disabled till a first token is linked to it)

"Public site":

  • course searches function
  • rating a course function
  • commenting a course function
  • downloading a course template function

"Registered site"

  • course searches function
  • rating a course function
  • commenting a course function
  • downloading a course template function
  • publishing a course template function
  • update info function

"Hub directory"

  • getting hub information function
  • getting course information function
  • confirm the hub registration function

Registered Site

the following service will exist on any Moodle site (but disabled till a first token is linked to it)

"Hub server"

  • getting site information function
  • getting course listing function
  • confirm the site registration function

New Users

Moodle.org Hub list

A user is be linked to one role only and one service only

"Public sites": they all use the same public_directory_user user.

  • His role is 'Public Directory User'
  • His service is 'Hub directory public site'

"Hub servers": they all have their own $huburl."_directory_hub_user" user.

  • Their role is 'Directory user'
  • Their service is 'Hub directory hub server'

Hub server

"Public sites": they all use the same 'public_hub_user' user.

  • His role is 'Public Hub User'
  • His service is 'Public site'

"Registered sites": they all have their own $siteurl.'_registered_site_user' user.

  • Their role is 'Registered Hub User'.
  • Their service is 'Registered site'.

"Hub directory": they use their own $hubdirectoryurl.'_directory_user' (in case the hub directory change his url)

  • Their role is 'Moodle.org Hub Directory'.
  • Their service is 'Hub directory'.

Registered Site

"Hub servers": they all have their own $huburl.'_hub_user' user

  • Their role is 'Hub User'
  • Their service is 'Hub server'