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

Received Message Attribute via XML is not decoded from base 64 #343

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

Conversation

kojisaikiAtSony
Copy link
Contributor

@kojisaikiAtSony kojisaikiAtSony commented Jan 14, 2025

Problem:
JSON requests has decoded from base 64 on JSON marshaller, but for XML, the SetAttributesFromForm does not have decoding step. So internal BinaryValue was still base 64 string (as binary) value.

This is a part of XML protocol, but today the actual AWS SNS and the SDK for SNS is still using XML whereas SQS has already moved to SQS (#337). We have acknowledged that by our investigation and lack of JSON description on official SNS doc. This blocks tests that use SNS apis.

Fix:
Add base 64 decoding step in SetAttributesFromForm.

Squashed commits:
[a52b572] added base 64 deconde on publish
@@ -370,7 +372,7 @@ func TestSendMessageBatchV1_Xml_Success_including_attributes(t *testing.T) {
WithFormField("Entries.1.MessageBody", messageBody2).
WithFormField("Entries.1.MessageAttributes.1.Name", binaryAttributeKey).
WithFormField("Entries.1.MessageAttributes.1.Value.DataType", binaryType).
WithFormField("Entries.1.MessageAttributes.1.Value.BinaryValue", binaryValue).
WithFormField("Entries.1.MessageAttributes.1.Value.BinaryValue", binaryValueEncodeString).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is for blobs are sent and received after being base64 encoded.
BinaryValue in XML should be base 64 encoded.

@kojisaikiAtSony
Copy link
Contributor Author

Hi @Admiral-Piett , can you please review this? This is the last piece to update our AWS SDK version...

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