-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom storage for SCORM Xblock #29
Conversation
c11e4f1
to
9a5b80c
Compare
Hi @regisb could you please review this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have some important comments here. Please see them below. In particular, the setup instructions that are currently in the PR description must be added to the xblock README to make it very clear to the end users how to make use of the new S3 storage backend.
I acknowledge the concerns you raised. If large files are fetched using the current approach, it could indeed lead to memory issues on the server. However, if we switch to issuing a 302 redirect, it would expose the signed URL in the network tab of the user's browser, which can lead to potential security risks. Additionally, another challenge arises when serving HTML files that include relative links. After a 302 redirect, the base URL changes to the S3 bucket's URL, so the relative links within the HTML file will fail to load the resources as expected. |
I understand the confusion here. but in this scenario, runtime is typically associated with an XBlock instance, not the storage class. Therefore, it is difficult to make the runtime.handler_url method was available in S3ScormStorage. |
Right. But notice that the storage instance is created by the What I am trying to avoid here is to add s3-specific code to the core. |
Thank you for your thorough review and feedback on the PR. I have made all the requested changes and addressed the concerns raised. I kindly request you to review the PR again to ensure that the modifications meet the requirements and address your feedback appropriately. |
In the future @naumanshafi please reply to each comment in its dedicated thread. If you put all your answers in the main conversation it makes it very difficult to track what was the initial question. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience!
I believe this was originally written to serve redirects in overhangio#29 but before merge it was changed to proxy the contents.
PR Description
Summary:
Implement a custom storage solution to store and retrieve data from a private S3 bucket. Modify the handling of SCORM content requests loaded via JavaScript from a primary file, ensuring they are routed through a custom XBlock view instead of directly accessing the S3 storage. All SCORM XBlock resource requests should be intercepted by the custom view to add signatures before forwarding them to the S3 storage, allowing secure access to private content. Additionally, the ability to read SCORM content from a private bucket should be configurable via Django settings.
Changes Made:
Motivation:
This PR addresses EDE-2041, the Jira issue discussing the need for secure storage and retrieval of SCORM content. By leveraging a private S3 bucket and introducing a custom XBlock view, we ensure that SCORM content requests are processed securely with the addition of signatures. The configurable settings enable flexibility in managing access to SCORM content stored in private buckets.
Additional Notes:
Related Issues
Configuration Changes (lms/envs/private.py and cms/envs/private.py)