Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: s3 op bug with ServerSideEncryption #1479

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

saikonen
Copy link
Collaborator

fixes bug with S3 ServerSideEncryption headers affecting S3 operations (get_many / get_recursive / get_all / put_many)

@savingoyal savingoyal merged commit aecfead into master Jul 10, 2023
14 of 16 checks passed
@savingoyal savingoyal deleted the fix/s3-op-bug-with-serversideencryption branch July 10, 2023 16:44
@saikonen
Copy link
Collaborator Author

saikonen commented Jul 10, 2023

minimum tests I ran for coverage on the reported issues:

from metaflow import S3

S3_BASE="s3://sakari-tests"

def test_s3(filename: str):
    with S3(s3root=S3_BASE) as s3:
            s3.put(filename, "super secret content")

            # Additional test for multi-mode operations.
            s3.put(filename, "super secret content", overwrite=True)

            s3.put_many([(filename, "super secret content")], overwrite=True)

    with S3(s3root=S3_BASE) as s3:
        file = s3.get(filename)
        info = s3.info(filename)
        print(info.encryption)
        print(f"{file.text}")

        files = s3.get_many([filename])
        info_many = s3.info_many([filename])
        print(info_many[0].encryption)
        print(f"{files[0].text}")
        
        
        files = s3.get_all(return_info=True)
        s3.info(filename)
        print(f"{files[0].text}")

        files = s3.get_recursive([filename], return_info=True)
        s3.info(filename)
        print(f"{files[0].text}")

if __name__=="__main__":
    test_s3("testing-encryption")

wangchy27 pushed a commit that referenced this pull request Jul 13, 2023
* fix overlooked optional check for ServerSideEncryption in the response

* optional get for encryption when returning range_info

* deal with optional encryption response in get_recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants