-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
Use Case
As a Node engineer,
I want our FLE bindings to operation on Uint8Arrays,
So that so that they are generic and we can accurately type our TS.
All "public" APIs from our C++ bindings that take arguments from JS should check if the arguments are Uint8Arrays instead of Buffers, since we do not rely on any Buffer-specific APIs in C++.
- MongoCrypt::MongoCrypt
- MongoCrypt::MakeEncryptionContext
- MongoCrypt::MakeExplicitEncryptionContext
- MongoCrypt::MakeDecryptionContext
- MongoCrypt::MakeExplicitDecryptionContext
- MongoCrypt::MakeDataKeyContext
- MongoCrypt::MakeRewrapManyDataKeyContext
- MongoCryptContext::AddMongoOperationResponse
- MongoCryptContext::ProvideKMSProviders
- MongoCryptKMSRequest::AddResponse
User Impact
n/a
Dependencies
- n/a
Unknowns
- n/a
Acceptance Criteria
Implementation Requirements
- Adjust any usages of `Value::IsBuffer()` to `Value::IsTypedArray()` and casts of `Value::As<Uint8Array>()`.
Testing Requirements
- We will update the unit tests added to Node's libmongocrypt bindings. We will test happy and unhappy path:
-
- Given an API that takes a Buffer currently, we will provide a Uint8Array and confirm it succeeds with no error.
- Given an API that takes a Buffer currently (and Uint8Array after this work), we will provide a non-uint8Array value and confirm it throws a TypeError with a relevant error message.
Documentation Requirements
- n/a
Follow Up Requirements
- n/a
- duplicates
-
NODE-5432 Add testing to bindings in libmongocrypt
- Closed