fix: kinesis CBOR blob handling #11220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
A report from a customer showed that a round trip of data through a Kinesis stream from LocalStack did not preserve the data content.
For example:
PutRecord
in Kinesis stream,"test data"
GetRecords
from kinesis stream, convert 1st record toString
, which turns out different from "test data":��-u�Z
They were using the Java SDK. When testing on AWS, a
GetRecords
request returns the message body (decoded as a String) of"test data"
correctly.Since this is exercised via the Java SDK, it is the handling of the CBOR format that it as fault. It turned out that we did not parse
CBOR
blob
s correctly.BaseJSONRequestParser._parse_blob
method was removed.RequestParser._parse_blob
method, which incorrectly base64-decoded the value.tests/unit/aws/protocol/test_parser.py::test_json_cbor_blob_parsing
to test this incorrect behaviour.Changes
This PR reverts the removal of
BaseJSONRequestParser._parse_blob
and updates the relevant test accordingly.