Description
Team,
Java SDK has two classes for signing requests with AWS4 signing protocol
AWS4UnsignedPayloadSigner.java - https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4UnsignedPayloadSigner.java
AWS4Signer.java - https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java
AWS4UnsignedPayloadSigner adds "UNSIGNED-PAYLOAD" as body if the request is sent over HTTPS whereas AWS4Signer doesn't add "UNSIGNED-PAYLOAD" as request body for pre-signing
Background:
I'm trying to authenticate with AWS MSK via AWS_MSK_IAM SASL mechanism in Elixir and it needs me to presign the request without adding "UNSIGNED-PAYLOAD" as part of its canonical request. I see that aws_signature adds "UNSIGNED-PAYLOAD" as part of pre-signing here
aws_signature/src/aws_signature.erl
Line 170 in 9dff1ba
This causes issues when I try to pre-sign requests to authenticate with services like Amazon MSK via IAM. Rather than always sending "UNSIGNED-PAYLOAD" as body, is it possible to have a provision to send "UNSIGNED-PAYLOAD" only when Body parameter is nil, otherwise use what is sent as Body? This needs modifying the api's definition to add Body as an additional parameter. Let me know if there are better alternatives to tackle this.
https://hexdocs.pm/aws_signature/aws_signature.html#sign_v4_query_params/8
Activity