[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17064135#comment-17064135 ] ASF subversion and git services commented on AIRFLOW-4175: -- Commit c64a6df2ccc2a4637a85b231c72c24fb8c433112 in airflow's branch refs/heads/v1-10-test from Kaxil Naik [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=c64a6df ] [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete (#7733) cherry-picked from a8b5fc74d07e50c91bb64cb66ca1a450aa5ce6e1 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function Co-authored-by: retornam > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Assignee: Omair Khan >Priority: Major > Labels: gsoc, gsoc2020, mentor > Fix For: 1.10.10 > > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17064041#comment-17064041 ] ASF subversion and git services commented on AIRFLOW-4175: -- Commit 8d4541f4489c1a81591172bf0df76dec7c59603f in airflow's branch refs/heads/v1-10-test from Kaxil Naik [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=8d4541f ] [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete (#7733) cherry-picked from a8b5fc74d07e50c91bb64cb66ca1a450aa5ce6e1 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function Co-authored-by: retornam > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Assignee: Omair Khan >Priority: Major > Labels: gsoc, gsoc2020, mentor > Fix For: 1.10.10 > > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062515#comment-17062515 ] ASF subversion and git services commented on AIRFLOW-4175: -- Commit 78e8389f2373b08aee06396da4431bc71262f159 in airflow's branch refs/heads/v1-10-test from Kaxil Naik [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=78e8389 ] [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete (#7733) cherry-picked from a8b5fc74d07e50c91bb64cb66ca1a450aa5ce6e1 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function Co-authored-by: retornam > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Assignee: Omair Khan >Priority: Major > Labels: gsoc, gsoc2020, mentor > Fix For: 1.10.10 > > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062189#comment-17062189 ] ASF subversion and git services commented on AIRFLOW-4175: -- Commit 7646b50b66f4051a94f6d792490a26699612b3ba in airflow's branch refs/heads/v1-10-test from Kaxil Naik [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=7646b50 ] [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete (#7733) cherry-picked from a8b5fc74d07e50c91bb64cb66ca1a450aa5ce6e1 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function Co-authored-by: retornam > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Assignee: Omair Khan >Priority: Major > Labels: gsoc, gsoc2020, mentor > Fix For: 1.10.10 > > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17060293#comment-17060293 ] ASF GitHub Bot commented on AIRFLOW-4175: - potiuk commented on pull request #7733: [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete URL: https://github.com/apache/airflow/pull/7733 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Assignee: Omair Khan >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059826#comment-17059826 ] ASF GitHub Bot commented on AIRFLOW-4175: - OmairK commented on pull request #7733: [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete URL: https://github.com/apache/airflow/pull/7733 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function Co-authored-by: retornam --- Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg) Make sure to mark the boxes below before creating PR: [x] - [x] Description above provides context of the change - [x] Commit message/PR title starts with `[AIRFLOW-]`. AIRFLOW- = JIRA ID* - [x] Unit tests coverage for changes (not needed for documentation changes) - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)" - [x] Relevant documentation is updated including usage instructions. - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example). * For document-only changes commit message can start with `[AIRFLOW-]`. --- In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md). Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059818#comment-17059818 ] ASF GitHub Bot commented on AIRFLOW-4175: - OmairK commented on pull request #7732: [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete URL: https://github.com/apache/airflow/pull/7732 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059817#comment-17059817 ] ASF GitHub Bot commented on AIRFLOW-4175: - OmairK commented on pull request #7732: [AIRFLOW-4175] S3Hook load_file should support ACL policy paramete URL: https://github.com/apache/airflow/pull/7732 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() function - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function --- Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg) Make sure to mark the boxes below before creating PR: [x] - [x] Description above provides context of the change - [x] Commit message/PR title starts with `[AIRFLOW-]`. AIRFLOW- = JIRA ID* - [x] Unit tests coverage for changes (not needed for documentation changes) - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)" - [x] Relevant documentation is updated including usage instructions. - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example). * For document-only changes commit message can start with `[AIRFLOW-]`. --- In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md). Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information. Co-authored-by: @retornam This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059727#comment-17059727 ] ASF GitHub Bot commented on AIRFLOW-4175: - feluelle commented on pull request #7726: [AIRFLOW-4175] S3Hook load_file should support ACL policy parameter URL: https://github.com/apache/airflow/pull/7726 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059503#comment-17059503 ] ASF GitHub Bot commented on AIRFLOW-4175: - OmairK commented on pull request #7726: [AIRFLOW-4175] S3Hook load_file should support ACL policy parameter URL: https://github.com/apache/airflow/pull/7726 - Added acl_policy parameter to all the S3Hook.load_*() and S3Hook.copy_object() functions - Added unittest to test the response permissions when the policy is passed - Updated the docstring of the function --- Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg) Make sure to mark the boxes below before creating PR: [x] - [x] Description above provides context of the change - [x] Commit message/PR title starts with `[AIRFLOW-]`. AIRFLOW- = JIRA ID* - [x] Unit tests coverage for changes (not needed for documentation changes) - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)" - [x] Relevant documentation is updated including usage instructions. - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example). * For document-only changes commit message can start with `[AIRFLOW-]`. --- In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md). Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17056307#comment-17056307 ] Ephraim E Anierobi commented on AIRFLOW-4175: - Hello [~jackjack10] , Can I submit a PR on this as part of my outreachy application? > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > Labels: gsoc, gsoc2020, mentor > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (AIRFLOW-4175) S3Hook load_file should support ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16831461#comment-16831461 ] jack commented on AIRFLOW-4175: --- [~kbobr...@gmail.com] You are welcome to submit PR for this > S3Hook load_file should support ACL policy parameter > > > Key: AIRFLOW-4175 > URL: https://issues.apache.org/jira/browse/AIRFLOW-4175 > Project: Apache Airflow > Issue Type: Improvement > Components: hooks >Affects Versions: 1.10.2 >Reporter: Keith O'Brien >Priority: Major > > We have a use case where we are uploading files to an S3 bucket in a > different AWS account to the one Airflow is running in. AWS S3 supports this > situation using the pre canned ACL policy, specifically > {{bucket-owner-full-control. }} > However, the current implementations of the {{S3Hook.load_*}}() and > {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for > the file being uploaded/copied to S3. > It would be good to add another optional parameter to the {{S3Hook}} methods > called {{acl_policy}} which would then be passed into the boto3 client method > calls like so > > {code} > # load_file > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > > {code} > # load_bytes > ... > if encrypt: >extra_args['ServerSideEncryption'] = "AES256" > if acl_policy: >extra_args['ACL'] = acl_policy > client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code} > {code} > # copy_object > self.get_conn().copy_object(Bucket=dest_bucket_name, >Key=dest_bucket_key, >CopySource=CopySource, >ACL=acl_policy) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)