Fix - Changed encoding from Base64 (with padding) to Base64URL (no padding) for SenML JSON format #710
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.
According to the SenML JSON specification defined at RFC8428§4.3- SenML Labels the Base64 URL safe alphabet must be used (without padding) for Data Value
vd
:So, encoding and decoding has been changed from Base64 (with padding) to Base64Url (without padding) for data over SenML JSON format.
Note that the behavior of the code in
data/json.c
has not changed, data in JSON format will continue to be encoded in Base64 (with padding), see eclipse/leshan#1444 (comment).New tests has been added in order to test the Base64Url (without padding) encode and decode functions, and the previous tests have been modified by adding a new entry to be tested.
Fix: #698
also see: OpenMobileAlliance/OMA_LwM2M_for_Developers#553