Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(service-provider-server): pass in driver to fle addon directly COMPASS-6342 #1368

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/service-provider-server/src/cli-service-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ class CliServiceProvider extends ServiceProviderCore implements ServiceProvider
this.baseCmdOptions = { ... DEFAULT_BASE_OPTIONS }; // currently do not have any user-specified connection-wide command options, but I imagine we will eventually
this.dbcache = new WeakMap();
try {
this.fle = require('mongodb-client-encryption');
// The .extension() call may seem unnecessary, since that is the default
// for the top-level exports from mongodb-client-encryption anyway.
// However, for the browser runtime, we externalize mongodb-client-encryption
// since it is a native addon package; that means that if 'mongodb' is
// included in the bundle, it won't be able to find it, and instead needs
// to receive it as an explicitly passed dependency.
this.fle = require('mongodb-client-encryption').extension(require('mongodb'));
} catch { /* not empty */ }
}

Expand Down