Skip to content

Commit 354a899

Browse files
adopt changes from FLE
1 parent 263beb0 commit 354a899

File tree

3 files changed

+1
-69
lines changed

3 files changed

+1
-69
lines changed

.evergreen/install-mongodb-client-encryption.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" &
99
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
1010

1111
rm -rf mongodb-client-encryption
12-
git clone https://github.com/mongodb-js/mongodb-client-encryption.git
12+
git clone https://github.com/baileympearson/mongodb-client-encryption.git -b NODE-7043
1313
pushd mongodb-client-encryption
1414

1515
node --version

src/client-side-encryption/auto_encrypter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ export class AutoEncrypter {
254254
}
255255

256256
const mongoCryptOptions: MongoCryptOptions = {
257-
enableMultipleCollinfo: true,
258257
cryptoCallbacks,
259258
errorWrapper: defaultErrorWrapper
260259
};

test/integration/client-side-encryption/client_side_encryption.prose.25.lookup.test.ts

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -368,71 +368,4 @@ describe('$lookup support', defaultMetadata, function () {
368368
/Upgrade/i,
369369
{ requires: { ...defaultMetadata.requires, mongodb: '>=7.0.0 <8.1.0' } }
370370
);
371-
372-
describe('Node.js custom test', function () {
373-
describe('when enableMultipleCollinfo is off and a $lookup is run', function () {
374-
let client: MongoClient;
375-
376-
beforeEach(async function () {
377-
const mochaTest = { metadata: defaultMetadata };
378-
379-
if (!this.configuration.filters.MongoDBVersionFilter.filter(mochaTest)) {
380-
return;
381-
}
382-
383-
if (!this.configuration.filters.MongoDBTopologyFilter.filter(mochaTest)) {
384-
return;
385-
}
386-
387-
if (!this.configuration.filters.ClientSideEncryptionFilter.filter(mochaTest)) {
388-
return;
389-
}
390-
391-
const getMongoCrypt = sinon.stub(AutoEncrypter, 'getMongoCrypt').callsFake(function () {
392-
const MongoCrypt = getMongoCrypt.wrappedMethod.call(this);
393-
return class extends MongoCrypt {
394-
constructor(options: MongoCryptOptions) {
395-
expect(options).to.have.property('enableMultipleCollinfo', true); // assert invariant
396-
options.enableMultipleCollinfo = false;
397-
super(options);
398-
}
399-
};
400-
});
401-
402-
client = newEncryptedClient(this);
403-
});
404-
405-
afterEach(async function () {
406-
sinon.restore();
407-
await client?.close();
408-
});
409-
410-
it(
411-
'throws a TypeError about libmongocrypt not enabled to support multiple collections',
412-
defaultMetadata,
413-
async () => {
414-
const collection = client.db('db').collection('csfle');
415-
const actual = await collection
416-
.aggregate([
417-
{ $match: { csfle: 'csfle' } },
418-
{
419-
$lookup: {
420-
from: 'csfle2',
421-
as: 'matched',
422-
pipeline: [{ $match: { csfle2: 'csfle2' } }, { $project: { _id: 0 } }]
423-
}
424-
},
425-
{ $project: { _id: 0 } }
426-
])
427-
.toArray()
428-
.catch(error => error);
429-
430-
expect(actual).to.be.instanceOf(MongoCryptError);
431-
expect(actual.message).to.match(
432-
/libmongocrypt is not configured to support encrypting a command with multiple collections/i
433-
);
434-
}
435-
);
436-
});
437-
});
438371
});

0 commit comments

Comments
 (0)