Change ClientChannel schema data to binary; unify base64 handling #285
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.
Changelog
None
Docs
None
Description
The current websocket protocol uses JSON messages for advertisements (in both directions), which requires binary schemas to be base64-encoded. Currently the SDK handles base64-encoding when sending
protobuf
schemas to the client (although we missed also doing this forflatbuffer
schemas), but ClientAdvertisements left the base64 handling up to the user (they would just receive a String which may or may not be base64-encoded). This PR adds base64 handling for the client advertisements as well so the SDK handles both directions and doesn't require the user to mess with base64.ClientChannel.schema
toOption<Vec<u8>>
JsonClientChannel
&JsonClientAdvertise
types for deserialization, andClientChannel::try_from(JsonClientChannel)
to do the base64 decodingflatbuffer
as base64 as well as protobuf (docs)