-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: Handle unencrypted message while getting messages with crypto #120
Conversation
@@ -154,25 +154,46 @@ class BatchHistoryResultEntry { | |||
/// Otherwise, it will be `null`. | |||
Map<String, dynamic>? meta; | |||
|
|||
/// Error message. this will contain information if message decryption is failed | |||
/// for given `message`. | |||
String? error; |
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.
Don't you have custom class/type that describes an error? If there's no such a class, let's leave it as it is.
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.
Fixed
message = object['message']; | ||
} else { | ||
try { | ||
message = decryptFunction is decryptWithKey |
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.
Btw, what's the logic behind it?
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.
Ok, now I see that you could pass decrypt(...)
or decryptWithKey(...)
function from ICryptoModule
. Perhaps there's no way to split deserialization and decryption into two separate concerns, this would require significant changes. What I mean by this is parsing the objects as they came without introducing decryption there. This could be a separate layer that takes BatchHistoryResultEntry
or whatever lightweight DAO object created in the previous parsing step, decrypts its payload, and returns the decrypted result back to the caller. It's not possible to do it right now so let's leave it as it is, but anyway I wanted to mention about other possibilities :)
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.
Agreed!
Need to deal with this till the time we completely stop supporting explicit cipherKey passing mechanism.
…scribe and histroy api with crypto configuration.
@pubnub-release-bot release dart as v4.3.1 |
🚀 Release successfully completed 🚀 |
fix: Handle unencrypted message while getting messages with cryptoModule configured.
Handle unencrypted message while getting messages with cryptoModule configured.