• Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 6.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 0
    • 2
    • 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.

      This is part 1 of an internal refactor, part 2 is here: https://jira.mongodb.org/browse/NODE-5470.

      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 Typescript
        • files
          • src/client-side/client-side-encryption/providers/*ts
          • src/client-side/client-side-encryption/errors.js
      • Enable linting for the FLE bindings and fix lint issues as encountered
      • 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
      • Make all MongoCrypt errors extend from `MongoError`.
      • Move credential providers imports of aws credential providers and gcp-metadata into `deps.ts`.
        • credential providers already exists and shouldn't require additional work
        • create an optional peer dependency for `gcp-metadata`.  ensure it is lazy imported.

      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 should be converted to Typescript
        • credentialProviders.test.js
        • requirements.js (only because it needs to be done eventually and may as well do it in the first PR).
      • All unit tests and integration tests should pass
      • Add unit tests asserting that MongoCryptErrors are subclasses of MongoError.
      • Add unit tests asserting that the driver works with / without gcp-metadata following the pattern in `optional_require.test.ts`.

      Documentation Requirements

      Follow Up Requirements

      • n/a

            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: