Skip to content

Commit

Permalink
Fix the AccessPolicy type and configure the S3_CONTROLLED_ACCESS_BUCK…
Browse files Browse the repository at this point in the history
…ET variable for testing purposes.
  • Loading branch information
Chrystinne committed Dec 3, 2024
1 parent 99ff391 commit 751b827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion physionet-django/project/cloud/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ def upload_project_to_S3(project):
bucket_created = False

# Set the bucket policy only if the bucket was newly created and has controlled access
if bucket_created and project.access_policy == AccessPolicy.CONTROLLED:
if bucket_created and project.access_policy == AccessPolicy.CREDENTIALED:
controlled_policy = create_controlled_bucket_policy(bucket_name)
s3.put_bucket_policy(Bucket=bucket_name, Policy=controlled_policy)

Expand Down
1 change: 1 addition & 0 deletions physionet-django/project/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
AWS_ACCOUNT_ID='123456789012',
S3_OPEN_ACCESS_BUCKET='datashare-public',
S3_SERVER_ACCESS_LOG_BUCKET='datashare-logs',
S3_CONTROLLED_ACCESS_BUCKET='datashare-protected',
)
class TestS3(TestMixin):
"""
Expand Down

0 comments on commit 751b827

Please sign in to comment.