Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5283 Move js logic from mongodb-client-encryption to the driver
  3. NODE-5470

Clean up statemachine, autoencrypter, crypto callbacks and client encryption

    • Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 6.0.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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
      • 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

      Follow Up Requirements

      • additional tickets to file, required releases, etc

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: