-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: encode new line characters in public-key value #623
Conversation
at_client/lib/src/transformer/request_transformer/put_request_transformer.dart
Outdated
Show resolved
Hide resolved
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.
Tests are failing
Fixed the failing tests. |
if (updateVerbBuilder.value.contains('\n')) { | ||
updateVerbBuilder.value = | ||
AtEncoderImpl().encodeData(updateVerbBuilder.value, encodingType); | ||
updateVerbBuilder.encoding = encodingType.toString().split('.')[1]; |
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.
please check how to get name from enum in a cleaner way.
we can replace with encodingType.name using extensions
https://stackoverflow.com/questions/29567236/dart-how-to-get-the-name-of-an-enum-as-a-string
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.
This change is implemented.
will approve this PR once server and persistence changes are released |
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.
Will approve once server changes are in prod
Sure Gary, Thank you. |
# Conflicts: # at_client/pubspec.yaml # at_end2end_test/pubspec.yaml # at_functional_test/pubspec.yaml
- What I did
- How I did it
In
PutRequestTransformer
check if the value contains \n character. If yes, encode the data using base64 and set the encoding attribute to type of encoding used.In
GetResponseTransformer
, if the key is public or cached:public: key the data is decoded based on the metadata.encoding which represents the type of encoding used.In sync_service_impl, add encoding attribute in metadata to sync the field between cloud and local secondaries and if metadata.encoding is not null, use updata:json version of regex to sync the data to cloud secondary.
Add unit tests to test the PutRequestTransformer and GetResponseTransformer
- How to verify it
- Description for the changelog