feat(NODE-4136): adjust Node.js bindings for shared library spec#306
Merged
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.
addaleax
commented
Apr 19, 2022
| // 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) { |
Contributor
Author
There was a problem hiding this comment.
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 🙂
Contributor
There was a problem hiding this comment.
I think it makes sense to not have the cryptdManager exist when we are using the lib. Good catch!
addaleax
commented
Apr 19, 2022
nbbeeken
approved these changes
Apr 20, 2022
| // 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) { |
Contributor
There was a problem hiding this comment.
I think it makes sense to not have the cryptdManager exist when we are using the lib. Good catch!
baileympearson
approved these changes
Apr 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specifically, pass a default
csfleSearchPathslist of['$SYSTEM'],and add support for
csfleRequired.As drive-by fixes, fix a typo that currently (unintentionally) leads to
_mongocryptdClientand_mongocryptdManagerbeing initialized evenif
bypassAutoEncryptionwas specified, and adjust the tests and the.teardown()method for those cases.Typings changes: mongodb/node-mongodb-native#3206