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

Retrieve server-side encryption setting on HeadObject #1143

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

passaro
Copy link
Contributor

@passaro passaro commented Nov 19, 2024

Description of change

Add two new fields to HeadObjectResult:

  • sse_type: The server-side encryption algorithm used to store the object (header: "x-amz-server-side-encryption"),
  • sse_kms_key_id: The ID of the KMS key was used for object encryption, if present (header: "x-amz-server-side-encryption-aws-kms-key-id").

Does this change impact existing behavior?

No. Only adds fields to a non-exhaustive type.

Does this change need a changelog entry in any of the crates?

Yes: mountpoint-s3-client.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 09:33 — with GitHub Actions Inactive
@passaro passaro marked this pull request as ready for review November 19, 2024 09:34
muddyfish
muddyfish previously approved these changes Nov 19, 2024
vladem
vladem previously approved these changes Nov 19, 2024
Copy link
Contributor

@vladem vladem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of non-blocking questions

let key = format!("{prefix}hello");
let expected_sdk_sse = match sse_type {
None => aws_sdk_s3::types::ServerSideEncryption::Aes256,
Some("AES256") => aws_sdk_s3::types::ServerSideEncryption::Aes256,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, aws_sdk_s3::types::ServerSideEncryption implements From<&str>

@@ -300,6 +300,12 @@ pub struct HeadObjectResult {
/// HeadObject must explicitly request for this field to be included,
/// otherwise the values will be empty.
pub checksum: Checksum,

/// Server-side encryption type that was used to store the object.
pub sse_type: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we expect this to be set for all objects? I think, Option<String> in the client is fine, but in mountpoint code, what are we going to do if it is not set? (and what assumptions do we make about the state of such object)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not currently used in Mountpoint.


/// See [Server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-data-protection.html#s3-express-ecnryption) for directory buckets.
#[test_case(None, None)]
#[test_case(Some("AES256"), None)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those cases actually different from the HeadObject perspective?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Remove and explained the limitation on directory bucket tests. If we want to expand them in the future, we'll need to configure a different bucket in the CI.

Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro dismissed stale reviews from vladem and muddyfish via 970da11 November 19, 2024 10:59
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 19, 2024 10:59 — with GitHub Actions Inactive
@passaro passaro added this pull request to the merge queue Nov 19, 2024
Merged via the queue into awslabs:main with commit 02f8dda Nov 19, 2024
23 checks passed
@passaro passaro deleted the head-object-sse branch November 19, 2024 11:33
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.

3 participants