feat(plugin-encryption): enhance encryption internal plugin to support encryption of binary data#4756
feat(plugin-encryption): enhance encryption internal plugin to support encryption of binary data#4756nishantmc-test wants to merge 2 commits intowebex:nextfrom
Conversation
…t encryption of binary data
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f806de3cda
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| encryptBinaryData(kmsKeyUri, data, options) { | ||
| return this.getKey(kmsKeyUri, options).then((k) => | ||
| ensureBuffer(data).then((buffer) => |
There was a problem hiding this comment.
Convert non-Buffer inputs before encrypting binary data
encryptBinaryData() documents support for Buffer|ArrayBuffer|Blob|File, but it passes data straight into ensureBuffer(), which only accepts Buffer-like objects (constructor.isBuffer). In browser paths where callers naturally provide Blob, File, or ArrayBuffer, this method will reject with `buffer` must be a buffer and never encrypt, so the new feature does not work for the documented binary input types.
Useful? React with 👍 / 👎.
|
Vidcast demoing the manual test: https://app.vidcast.io/share/c9427663-bf97-4875-ab4b-4d25d71d6993 |
This pull request addresses
Providing support to encrypt binary data. Inputs are kmsKeyUri and binary data.
by making the following changes
Added new method encryptBinaryData in encryption.js.
Change Type
The following scenarios were tested
Unit test

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.