-
Notifications
You must be signed in to change notification settings - Fork 147
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
base: master
Are you sure you want to change the base?
Received Message Attribute via XML is not decoded from base 64 #343
Conversation
@@ -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). |
There was a problem hiding this comment.
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.
Hi @Admiral-Piett , can you please review this? This is the last piece to update our AWS SDK version... |
@kojisaikiAtSony I thought we talked about this change before a bit didn't we? Maybe I'm misremembering. It has been a while. What this change looks like it's trying to do is that if you were to send in a So what I want to know, is what chain of events or calls exactly are you having trouble with, and in a way that is GoAWS behaving differently than what AWS would do in production? Screenshots and a full list of the different endpoints you are calling, in order would be helpful. The reason I am asking, is that I just tested this on my real-life AWS account. I sent a message via an SNS Publish to a Topic which was subscribed to a queue, and then I received the message. Now, look at the picture below, that's the response my SDK got back from AWS. You can see in the We know AWS is encoding it's Binary Values on the way in and decoding them on the way out. That is happening in AWS internally, but the way I see it, that's not relevant to what GoAWS needs to do. It's the request and response contracts that I want to mimic. How we do that internally is up to us, and what I see between the 2 seems to match. The SendMessage requested values are not base64 encoded and the ReceiveMessage response values are not base64 encoded. Same. The only real difference I can see in my testing, is that if I did a Publish > RecieveMessage, and by the Subscription between my Topic and Queue has disabled Raw Delivery, then I think I am getting the attributes back in an base64 encoded state, as a part of that full message block. But I don't think that's what we're talking about here is it? That seems like a different issue to this one, and one I will need to look into more. Let me know if I am misunderstanding anything here. Let's get this issue sorted for you once and for all. |
Currently, when we test our scenario with various protocols, we get the following distortion:
With this PR, the behaviors will be simplified.
|
a450346
to
f774423
Compare
Hi @Admiral-Piett , I've expressed the above what we found in raw HTTP, not via the SDK. Does this make sense to you? |
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
.