Skip to content

Commit fd7d590

Browse files
authored
chore(deps): bump mongodb-client-encryption MONGOSH-1261 (#1318)
1 parent ed17d3b commit fd7d590

File tree

7 files changed

+156
-496
lines changed

7 files changed

+156
-496
lines changed

packages/cli-repl/test/e2e-fle.spec.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,34 +275,32 @@ describe('FLE tests', () => {
275275
keyVault = client.getKeyVault();
276276
clientEncryption = client.getClientEncryption();
277277
278-
// Create necessary data + index keys
279-
dataKey1 = keyVault.createKey('local');
280-
dataKey2 = keyVault.createKey('local');
281-
indexKey = keyVault.createKey('local');
278+
// Create necessary data key
279+
dataKey = keyVault.createKey('local');
282280
283281
// (re-)create collection -- this needs to be done
284282
// with the plain mongo client until MONGOCRYPT-435 is done
285283
coll = client.getDB('${dbname}').encryptiontest;
286284
Mongo(${uri}).getDB('${dbname}').createCollection('encryptiontest', {
287285
encryptedFields: {
288286
fields: [{
289-
keyId: indexKey,
287+
keyId: dataKey,
290288
path: 'v',
291289
bsonType: 'string',
292290
queries: [{ queryType: 'equality' }]
293291
}]
294292
}
295293
});
296294
297-
// Encrypt and insert data encrypted with different data keys and a separate index key
298-
const insertPayload1 = clientEncryption.encrypt(dataKey1, '123', {
299-
indexKeyId: indexKey,
300-
algorithm: 'Indexed'
295+
// Encrypt and insert data encrypted with specified data key
296+
const insertPayload1 = clientEncryption.encrypt(dataKey, '123', {
297+
algorithm: 'Indexed',
298+
contentionFactor: 4
301299
});
302300
303-
const insertPayload2 = clientEncryption.encrypt(dataKey2, '456', {
304-
indexKeyId: indexKey,
305-
algorithm: 'Indexed'
301+
const insertPayload2 = clientEncryption.encrypt(dataKey, '456', {
302+
algorithm: 'Indexed',
303+
contentionFactor: 4
306304
});
307305
308306
const insertRes1 = coll.insertOne({ v: insertPayload1, _id: 'asdf' });
@@ -312,10 +310,10 @@ describe('FLE tests', () => {
312310
expect(await shell.executeLine('({ count: coll.countDocuments() })')).to.include('{ count: 2 }');
313311

314312
await shell.executeLine(`
315-
const findPayload = clientEncryption.encrypt(indexKey, '456', { // NB: the data key is irrelevant here
316-
indexKeyId: indexKey,
313+
const findPayload = clientEncryption.encrypt(dataKey, '456', { // NB: the data key is irrelevant here
317314
algorithm: 'Indexed',
318-
queryType: 'Equality'
315+
queryType: 'equality',
316+
contentionFactor: 4
319317
});`);
320318

321319
// Make sure the find payload allows searching for the encrypted value

0 commit comments

Comments
 (0)