File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,15 @@ def send_report(
4141 bucket_report_path = remote_bucket_file_path or report_filename
4242 bucket_website_url = None
4343 logger .info (f'Uploading to S3 bucket "{ self .config .s3_bucket_name } "' )
44+
45+ extra_args = {"ContentType" : "text/html" }
46+ if self .config .s3_acl is not None :
47+ extra_args ["ACL" ] = self .config .s3_acl
4448 self .client .upload_file (
4549 local_html_file_path ,
4650 self .config .s3_bucket_name ,
4751 bucket_report_path ,
48- ExtraArgs = { "ContentType" : "text/html" } ,
52+ ExtraArgs = extra_args ,
4953 )
5054 logger .info ("Uploaded report to S3." )
5155 if self .config .update_bucket_website :
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def __init__(
6262 aws_session_token : Optional [str ] = None ,
6363 s3_endpoint_url : Optional [str ] = None ,
6464 s3_bucket_name : Optional [str ] = None ,
65+ s3_acl : Optional [str ] = None ,
6566 google_project_name : Optional [str ] = None ,
6667 google_service_account_path : Optional [str ] = None ,
6768 gcs_bucket_name : Optional [str ] = None ,
@@ -159,6 +160,7 @@ def __init__(
159160 self .aws_access_key_id = aws_access_key_id
160161 self .aws_secret_access_key = aws_secret_access_key
161162 self .aws_session_token = aws_session_token
163+ self .s3_acl = s3_acl
162164
163165 google_config = config .get (self ._GOOGLE , {})
164166 self .google_project_name = self ._first_not_none (
Original file line number Diff line number Diff line change @@ -526,6 +526,12 @@ def report(
526526 default = None ,
527527 help = "The name of the S3 bucket to upload the report to." ,
528528)
529+ @click .option (
530+ "--s3-acl" ,
531+ type = str ,
532+ default = None ,
533+ help = "S3 Canned ACL value used to modify report permissions, for example set to 'public-read' to make the report publicly accessible." ,
534+ )
529535@click .option (
530536 "--google-service-account-path" ,
531537 type = str ,
@@ -638,6 +644,7 @@ def send_report(
638644 aws_session_token ,
639645 s3_endpoint_url ,
640646 s3_bucket_name ,
647+ s3_acl ,
641648 azure_connection_string ,
642649 azure_container_name ,
643650 google_service_account_path ,
@@ -686,6 +693,7 @@ def send_report(
686693 azure_container_name = azure_container_name ,
687694 s3_endpoint_url = s3_endpoint_url ,
688695 s3_bucket_name = s3_bucket_name ,
696+ s3_acl = s3_acl ,
689697 google_service_account_path = google_service_account_path ,
690698 google_project_name = google_project_name ,
691699 gcs_bucket_name = gcs_bucket_name ,
You can’t perform that action at this time.
0 commit comments