From 751b827c2b8342e0da9603700a9308e242619b78 Mon Sep 17 00:00:00 2001 From: chrystinne Date: Tue, 3 Dec 2024 16:34:00 -0500 Subject: [PATCH] Fix the AccessPolicy type and configure the S3_CONTROLLED_ACCESS_BUCKET variable for testing purposes. --- physionet-django/project/cloud/s3.py | 2 +- physionet-django/project/test_s3.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/physionet-django/project/cloud/s3.py b/physionet-django/project/cloud/s3.py index 215461ce2f..ff85640fb2 100644 --- a/physionet-django/project/cloud/s3.py +++ b/physionet-django/project/cloud/s3.py @@ -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) diff --git a/physionet-django/project/test_s3.py b/physionet-django/project/test_s3.py index 572bf68983..7581b59869 100644 --- a/physionet-django/project/test_s3.py +++ b/physionet-django/project/test_s3.py @@ -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): """