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(signature-v4): add hoistable headers config #1421

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Sep 30, 2024

allows additive configuration over header hoisting with hoistableHeaders, where previously users could only configure the unhoistableHeaders.

For example, with S3, it was either incorrectly deduced or limited by S3 feature availability at the time that SSE headers were considered unhoistable. For backwards compatibility we will still default them to unhoisted, but as of today my testing shows this not to be true.

This change enables the following use case:

const params = {
  Key: "...",
  Bucket: "...",
  ServerSideEncryption: "aws:kms",
  SSEKMSKeyId: "arn:aws:kms:us-west-2:0000:key/abcd-1234-abcd",
};
const s3Client = new S3Client();
const command = new PutObjectCommand(params);

const preSignedUrl =
  (await getSignedUrl(s3Client, command, {
    hoistableHeaders: new Set(["x-amz-server-side-encryption", "x-amz-server-side-encryption-aws-kms-key-id"]),
  }));

context: aws/aws-sdk-js-v3#1701

@kuhe kuhe merged commit a4c1285 into smithy-lang:main Sep 30, 2024
11 checks passed
@kuhe kuhe deleted the fix/sigv4 branch September 30, 2024 17:58
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