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

Migrate to Dropbox API v2

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Prerequisites
      1. A dropbox API key from https://www.dropbox.com/developers/apps
        1. At this stage do not fill in the OAuth2 Redirect URI
      2. You'll want some ngrok, and to adjust your config.php to use the SSL host, and to set $CFG->sslproxy = true;
      3. Download the attached test.php and place it in your dirroot.
      Tests
      1. Navigate to your private files area
      2. Confirm that the Dropbox repository works:
        1. thumbnails should be generated for any image in your dropbox account
        2. you should be able to navigate subfolders
        3. you should be able to 'Make a copy' of a file into your private files
        4. you should be able to Make an alias/reference of a file into your private files
        5. after making a copy and and alias of an image, the thumbnail should be generated for that file
        6. after saving the private files, you should be able to download any file copies and the content should be correct
        7. after saving the private files, you should be able to download any file reference and the content should be correct
        8. open a connection to your DB and run a query to update the lastsync field of files_reference to 0 (e.g. UPDATE mdl_files_reference SET lastsync = 0;).
      3. Refresh the private files page
        1. Thumbnails of references should be correct
        2. Re-download the referenced files and check content
      4. clear the lastsync field again
      5. Run the attached test.php and check for errors
      6. Open the Dropbox configuration
      7. Set a cachelimit of something like 512KB (524288 bytes)
      8. Navigate to your private files area
      9. Choose two files from Dropbox as references - one under the limit you set, one over it
      10. Open your browser dev tools and look at the network tab
      11. Download each of the files
        1. Confirm that the file under the size limit was served from your host
        2. Confirm that the file over the size limit was served direct from dropbox
      Initial testing
      1. Hop on over to your Moodle and before you upgrade set up Dropbox with the credentials you have generated
      2. Navigate to your private files area
      3. Use the Dropbox repo to choose two files:
        1. One as a copy
        2. One as a reference
      Main testing on 30/31 branches only
      1. Upgrade your site
      2. View the dropbox configuration
        1. *Confirm that the 'legacy' option is selected
      3. Re-run the First tests again
      4. View the dropbox configuration
      5. Opt to use the new V2 API
      Main testing on 30/31/master branches
      1. View dropbox configuration and grab the oauth2 callback URI
      2. Hop back over to dropbox and enter the value into the list of OAuth2 Redirect URIs
      3. Re-run the tests again
      Show
      Prerequisites A dropbox API key from https://www.dropbox.com/developers/apps At this stage do not fill in the OAuth2 Redirect URI You'll want some ngrok, and to adjust your config.php to use the SSL host, and to set $CFG->sslproxy = true; Download the attached test.php and place it in your dirroot . Tests Navigate to your private files area Confirm that the Dropbox repository works: thumbnails should be generated for any image in your dropbox account you should be able to navigate subfolders you should be able to 'Make a copy' of a file into your private files you should be able to Make an alias/reference of a file into your private files after making a copy and and alias of an image , the thumbnail should be generated for that file after saving the private files, you should be able to download any file copies and the content should be correct after saving the private files, you should be able to download any file reference and the content should be correct open a connection to your DB and run a query to update the lastsync field of files_reference to 0 (e.g. UPDATE mdl_files_reference SET lastsync = 0; ). Refresh the private files page Thumbnails of references should be correct Re-download the referenced files and check content clear the lastsync field again Run the attached test.php and check for errors Open the Dropbox configuration Set a cachelimit of something like 512KB (524288 bytes) Navigate to your private files area Choose two files from Dropbox as references - one under the limit you set, one over it Open your browser dev tools and look at the network tab Download each of the files Confirm that the file under the size limit was served from your host Confirm that the file over the size limit was served direct from dropbox Initial testing Hop on over to your Moodle and before you upgrade set up Dropbox with the credentials you have generated Navigate to your private files area Use the Dropbox repo to choose two files: One as a copy One as a reference Main testing on 30/31 branches only Upgrade your site View the dropbox configuration *Confirm that the 'legacy' option is selected Re-run the First tests again View the dropbox configuration Opt to use the new V2 API Main testing on 30/31/master branches View dropbox configuration and grab the oauth2 callback URI Hop back over to dropbox and enter the value into the list of OAuth2 Redirect URIs Re-run the tests again
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-52051-master
    • Story Points:
      5
    • Sprint:
      3.2 Sprint 4

      Description

      Dropbox have release a new API increment, we probably should update to v2 before we get caught out when they drop v1:

      https://blogs.dropbox.com/developers/2015/11/dropbox-api-v2-launches-today/

      At some point we'll likely deprecate the previous API v1, but we don't have specific plans to share now. We'll be sure to give developers plenty of warning.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                9 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Nov/16