-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat(NODE-4136): adjust Node.js bindings for shared library spec #306
Conversation
Specifically, pass a default `csfleSearchPaths` list of `['$SYSTEM']`, and add support for `csfleRequired`. As drive-by fixes, fix a typo that currently (unintentionally) leads to `_mongocryptdClient` and `_mongocryptdManager` being initialized even if `bypassAutoEncryption` was specified, and adjust the tests and the `.teardown()` method for those cases.
// Only instantiate mongocryptd manager/client once we know for sure | ||
// that we are not using the CSFLE shared library. | ||
if (!this._bypassAutoEncryption && !this.csfleVersionInfo) { | ||
if (!this._bypassEncryption && !this.csfleVersionInfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn’t realize in efad8b6 that this condition (before the addition of csfleVersionInfo
) would never actually have been hit due to the typo.
Obviously it would be possible to go the other way here as well, i.e. drop the conditional entirely and always create _mongocryptdManager
and _mongocryptdClient
. Let me know if you have a specific preference 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to not have the cryptdManager exist when we are using the lib. Good catch!
// Only instantiate mongocryptd manager/client once we know for sure | ||
// that we are not using the CSFLE shared library. | ||
if (!this._bypassAutoEncryption && !this.csfleVersionInfo) { | ||
if (!this._bypassEncryption && !this.csfleVersionInfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to not have the cryptdManager exist when we are using the lib. Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Specifically, pass a default
csfleSearchPaths
list of['$SYSTEM']
,and add support for
csfleRequired
.As drive-by fixes, fix a typo that currently (unintentionally) leads to
_mongocryptdClient
and_mongocryptdManager
being initialized evenif
bypassAutoEncryption
was specified, and adjust the tests and the.teardown()
method for those cases.Typings changes: mongodb/node-mongodb-native#3206