Commit Graph

5 Commits

Author SHA1 Message Date
Jawayria
250c94dc6a BOM-2331: Applied pylint-amnesty to waffle_utils, xblock, xmodule_django, zendesk_proxy, __init__.py 2021-02-04 17:49:15 +05:00
Manjinder Singh
cf350f9c44 fix: Correcting logic for xblock_handler token expiration (#26224)
* fix: Correcting logic for xblock_handler token expiration

The previous math had a date math error which resulted in token expiring in 0-2 days
instead of 2-4 days

Co-authored-by: Feanil Patel <feanil@edx.org>
Co-authored-by: Tim McCormack <tmccormack@edx.org>
2021-02-02 10:52:31 -05:00
Feanil Patel
415dfe469b test: Add tests for XBLOCK_HANDLER_TOKEN_KEYS logic.
This tests the various steps of the rotation process work as we expect.

We set the reference time explicitly due to the bug we found in the
hashing logic which will be fixed in a future ticket.
2021-01-28 15:08:22 -05:00
Feanil Patel
07d11128e3 test: Add baseline tests for secure tokens for xblock handlers.
These tests did not exist so we add them first before making changes.

Add the __init__.py file to make test imports work properly.
ie. To solve https://github.com/pytest-dev/pytest/issues/774

More useful info on how that works here:
https://docs.pytest.org/en/latest/goodpractices.html#choosing-a-test-layout-import-rules
2021-01-28 15:06:35 -05:00
Braden MacDonald
7dafda6168 Support for storing an XBlock's static asset files in Blockstore
This PR introduces some backend python + REST APIs for storing static
asset files along with an XBlock in a content library. It also updates
the new runtime to be able to load such static asset files.

Example use cases:
* Store an image file with an HTML block and then use the image inline
  in the HTML block.
* Store a PDF file with an HTML block and provide a link in the HTML for
  the learner to download the PDF.
* Store .srt files or even video .mp4 files that belong to a video
  XBlock.

Within the bundle, these static asset files are stored in a "static/"
subfolder of the folder that contains the OLX file. Extending an
existing LMS/Studio convention, a static asset file such as "image.png"
is referenced within the OLX as "/static/image.png" and the URL will be
rewritten by the runtime.
2019-11-06 10:19:42 -08:00