Skip to content

Commit

Permalink
fix: work around libmongocrypt createIndex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Jun 1, 2022
1 parent ccd8f6d commit ad9c6bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli-repl/src/cli-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,13 @@ class CliRepl implements MongoshIOProvider {

if (driverOptions.autoEncryption) {
const origExtraOptions = driverOptions.autoEncryption.extraOptions ?? {};
if (origExtraOptions.csflePath) {
// @ts-expect-error next driver release updates library name
if (origExtraOptions.cryptSharedLibPath) {
// If a CSFLE path has been specified through 'driverOptions', save it
// for later use.
this.cachedCryptLibraryPath = Promise.resolve({
csflePath: origExtraOptions.csflePath
// @ts-expect-error next driver release updates library name
cryptSharedLibPath: origExtraOptions.cryptSharedLibPath
});
}

Expand Down
3 changes: 3 additions & 0 deletions packages/shell-api/src/field-level-encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ export class KeyVault extends ShellApiWithMongoClass {
}

async _init(): Promise<void> {
if (this._mongo._fleOptions?.bypassQueryAnalysis) {
return; // TODO: Re-enable after libmongocrypt createIndex bug is fixed
}
try {
const existingIndexKeys = await this._keyColl.getIndexKeys();
if (existingIndexKeys.some(key => key.keyAltNames)) {
Expand Down

0 comments on commit ad9c6bc

Please sign in to comment.