Skip to content
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 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

naumanshafi
Copy link

@naumanshafi naumanshafi commented May 13, 2023

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:

  • Created a custom storage implementation to facilitate data storage in a private S3 bucket.
  • Implemented a custom XBlock view to handle SCORM content requests.
  • Modified the routing of SCORM XBlock resource requests to pass through the custom view for signature addition.
  • Added configuration options in Django settings to control the reading of SCORM content from a private bucket.

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:

  • The custom storage solution follows best practices for secure data handling and authentication.
  • The custom XBlock view integrates seamlessly into the existing SCORM content loading process.
  • The provided Django settings allow for easy configuration of the SCORM content retrieval from private buckets.

Related Issues

  • EDE-2041: Discusses the need for secure storage and handling of SCORM content.

Configuration Changes (lms/envs/private.py and cms/envs/private.py)

# XBlock settings for ScormXBlock
XBLOCK_SETTINGS["ScormXBlock"] = {
    "STORAGE_FUNC": "openedxscorm.storage.s3",
    "SCORM_S3_BUCKET_NAME": "<your-bucket-name>",
    "SCORM_S3_QUERY_AUTH": True,
    "SCORM_S3_EXPIRES_IN": 86400
}

@naumanshafi naumanshafi requested a review from ziafazal May 13, 2023 18:20
@naumanshafi naumanshafi added the enhancement New feature or request label May 13, 2023
Copy link

@ziafazal ziafazal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naumanshafi I have added few questions and a suggestion. Could please look into those?

openedxscorm/scormxblock.py Outdated Show resolved Hide resolved
openedxscorm/storage.py Outdated Show resolved Hide resolved
openedxscorm/scormxblock.py Outdated Show resolved Hide resolved
@naumanshafi naumanshafi force-pushed the noman/EDE-2041 branch 7 times, most recently from ba830d6 to 9fddeff Compare May 18, 2023 12:11
@naumanshafi naumanshafi force-pushed the noman/EDE-2041 branch 3 times, most recently from eac2757 to 65865a4 Compare May 25, 2023 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants