Skip to content

Commit

Permalink
fix: Added region and signature for S3 bucket (openedx#1928)
Browse files Browse the repository at this point in the history
For a region based bucket boto3 needs to know about region and signature which edx-ora2 doesn't know about.

Signed-off-by: Farhaan Bukhsh <[email protected]>
  • Loading branch information
farhaanbukhsh authored and BryanttV committed Feb 6, 2024
1 parent a106683 commit 474a392
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Initialization Information for Open Assessment Module
"""
__version__ = '5.1.0'
__version__ = '5.1.1'
6 changes: 6 additions & 0 deletions openassessment/fileupload/backends/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ def _connect_to_s3():
aws_access_key_id = getattr(settings, "AWS_ACCESS_KEY_ID", None)
aws_secret_access_key = getattr(settings, "AWS_SECRET_ACCESS_KEY", None)
endpoint_url = getattr(settings, "AWS_S3_ENDPOINT_URL", None)
signature_version = getattr(settings, "AWS_S3_SIGNATURE_VERSION", None)
region_name = getattr(settings, "AWS_S3_REGION_NAME", None)

return boto3.client(
"s3",
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
endpoint_url=endpoint_url,
config=botocore.client.Config(
signature_version=signature_version,
region_name=region_name,
)
)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "5.1.0",
"version": "5.1.1",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "^6.1.1",
Expand Down

0 comments on commit 474a392

Please sign in to comment.