awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
3.01k stars 248 forks source link

Missing `PayloadChecksumKind` variant for `vpc-lattice-svcs` #843

Open nmoutschen opened 1 year ago

nmoutschen commented 1 year ago

Describe the feature

The PayloadChecksumKind enum in aws-sigv4 only supports two variants at the moment: XAmzSha256 and NoHeader.

However, making SigV4 requests for VPC Lattice services requre to set the x-amz-content-sha256 header with a value UNSIGNED-PAYLOAD.

Documentation: https://docs.aws.amazon.com/vpc-lattice/latest/ug/sigv4-authenticated-requests.html

Use Case

This would enable support for SigV4 for VPC Lattice.

Proposed Solution

Add a new variant to PayloadChecksumKind that will inject an UNSIGNED-PAYLOAD value, and modify the rest of aws-sigv4 to use this information.

Other Information

No response

Acknowledgements

A note for the community

Community Note

nmoutschen commented 1 year ago

After diving into the code, it looks like we could already do this, but not with the PayloadChecksumKind enum.

I'll let you fine folks decide if you see an opportunity to improve the SDK itself. Also happy to contribute with an example for this specific use-case. ๐Ÿ˜„

Velfi commented 1 year ago

Thanks for submitting this @nmoutschen.

To whomever picks up https://github.com/awslabs/smithy-rs/issues/1798, they should also take a look at implementing this too, since it touches the same code in the signer.

rcoh commented 1 year ago

As @nmoutschen notes you can do this by using SignableBody::UnsignedPayload when you invoke the SigV4 crate.