fixes RECNVS-12
and make public links explicit. note that for non-inst-fs file storage,
the user parameter to the existing authenticated_url method is unused.
so for non-inst-fs, the following sets of methods are equivalent:
* authenticated_url_for_user(*) == public_url == authenticated_url
* download_url_for_user(*) == public_download_url (was download_url)
* inline_url_for_user(*) == public_inline_url (was inline_url)
the choice of `public_...` over `..._for_user` methods in the refactoring
should thus be a no-op except when inst-fs is enabled. with inst-fs enabled,
the `public_...` methods produce URLs usable by any user (including
those not logged in!); this matches non-inst-fs behavior. the
`..._for_user` methods produce URLs usable only by the user for whom
they were generated, and should be preferred where public access is not
necessary.
after this refactor, make public links for google doc previews short
lived and consolidate some code around google doc preview links.
test-plan:
- enable inst-fs
[per-user inst-fs JWTs]
- have a student and a teacher in a course with an assignment
- as the teacher upload an image to the course files, then add the
image to the course syllabus
- as the student, attempt to view the course syllabus. should see the
image in the course syllabus (prior to this commit would fail)
- copy the inst-fs URL the student's browser was redirected to when
viewing the file
- as the teacher attempt to access the image directly using the
student's inst-fs URL; should fail
[public inst-fs JWTs]
- as the teacher, upload a course card image (example of public file)
- as the teacher, view the course card image and copy the inst-fs URL
redirected to
- as the student, attempt to access the course card image directly
using the copied inst-fs URL; should succeed
[google docs preview]
- disable canvadocs on the account if enabled
- as the teacher, upload a PDF to the course files
- find the PDF in the course files and preview it
- preview should be displayed via embedded google docs iframe
- preview should succeed
Change-Id: I8384cbb89f1522022e2f06579e6381de5ed0076c
Reviewed-on: https://gerrit.instructure.com/133889
Tested-by: Jenkins
Reviewed-by: Andrew Huff <ahuff@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>