-
Type: Sub-task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
Use Case
As a driver engineer,
I want the FLE bindings in the driver to be modernized and de-duplicated,
So that we can have a modern development environment that matches the driver.
User Impact
n/a, internal refactor.
Dependencies
- n/a
Unknowns
- Can we share connection creation logic between the driver and FLE (FLE opens sockets to connect to KMS servers)?
- Follow up ticket, can be done after the FLE refactor.
- Should we attempt to consolidate the Azure kms provider's implementation of `get` with `request` from our utils?
- Not in this PR. The signatures and return types for both utilities are different enough that it doesn't make sense to share them without a larger refactor.
Acceptance Criteria
Implementation Requirements
- Convert to AutoEncrypter, StateMachine, ClientEncryption and MongoCryptdManager (and associated tests) to Typescript
- Add types where appropriate. For public types, move the types from https://github.com/mongodb/libmongocrypt/blob/8588825112a93145bf82b4b7519070c101c45a43/bindings/node/index.d.ts into the driver.
- Enable linting for the FLE bindings and fix lint issues as encountered
- Remove the duplicate `BufferPool` implementation and its associated tests. Change all references to `BufferPool` to point to the driver's bufferpool.
- Lazy import child_process and `on` in the MongocryptdManager.
- Remove all jsdoc types
- If the jsdoc is a doc comment, convert to TSDoc
- If the jsdoc is a type documentation, convert to TS and use the Typescript type instead
- Remove `databaseNamespace` and `collectionNamespace` helpers in favor of MongoDBNamespace from the driver utils.
If all of FLE is converted to TS:
- disable allowJs in the tsconfig
- enable linting for the src/client-side-encryption and test/client-side-encryption directories.
Out of scope:
- Adding overloads for async methods that take callbacks. we plan to remove these later, so we can `ts-expect-error` any TS errors that arise and link to <Jira ticket>
- adding TS support for `maybeCallback` or `maybePromise` (same reason as above)
Testing Requirements
- All FLE unit tests for the mongocryptd manager, state machine, auto encrypter and client encryption should be converted to TS
- All unit tests and integration tests should pass
Documentation Requirements
- _Docs changes are deferred to https://jira.mongodb.org/browse/NODE-5423._
Follow Up Requirements
- additional tickets to file, required releases, etc
- is duplicated by
-
NODE-4731 Remove KMS Providers Refresh Function
- Closed