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

[s3] Pass object parameters to head_object in exists #1451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

czosel
Copy link

@czosel czosel commented Sep 17, 2024

When using server-side-encryption with customer-provided keys (SSE-C), the head_object call needs the SSE-C key and algorithm - otherwise the call will fail with botocore.exceptions.ClientError: An error occurred (400) when calling the HeadObject operation: Bad Request if the file already exists.

From the docs:

If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:

  • x-amz-server-side-encryption-customer-algorithm
  • x-amz-server-side-encryption-customer-key
  • x-amz-server-side-encryption-customer-key-MD5

Since head_object is similar to get, we're reusing the existing logic to infer and filter the needed parameters.

Thank you in advance for your feedback!

When using server-side-encryption with customer-provided keys (SSE-C),
the head_object call needs the SSE-C key and algorithm - otherwise the
call will fail with `botocore.exceptions.ClientError: An error occurred (400)
when calling the HeadObject operation: Bad Request` if the file already
exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant