Skip to content

Commit 3c5bcb9

Browse files
authored
test(NODE-4282): sync fle2 payload spec test updates (#3309)
1 parent bb31ef4 commit 3c5bcb9

14 files changed

+33
-29
lines changed

.evergreen/run-custom-csfle-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ABS_PATH_TO_PATCH=$(pwd)
2727
# CSFLE_GIT_REF - set the git reference to checkout for a custom CSFLE version
2828
# CDRIVER_GIT_REF - set the git reference to checkout for a custom CDRIVER version (this is for libbson)
2929

30-
CSFLE_GIT_REF=${CSFLE_GIT_REF:-master}
30+
CSFLE_GIT_REF=${CSFLE_GIT_REF:-e157c35ee4028b292883c4628dc5926f9742b34a}
3131
CDRIVER_GIT_REF=${CDRIVER_GIT_REF:-1.17.6}
3232

3333
rm -rf ../csfle-deps-tmp

.evergreen/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ else
5656
source "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
5757
fi
5858

59-
npm install mongodb-client-encryption@">=2.2.0-alpha.3"
59+
npm install mongodb-client-encryption@">=2.2.0-alpha.4"
6060
npm install @mongodb-js/zstd
6161
npm install snappy
6262

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15191519
// Store the result in insertPayload.
15201520
insertPayload = await clientEncryption.encrypt('encrypted indexed value', {
15211521
keyId: key1Id,
1522-
algorithm: 'Indexed'
1522+
algorithm: 'Indexed',
1523+
contentionFactor: 0
15231524
});
15241525
// Use encryptedClient to insert the document { "encryptedIndexed": <insertPayload> }
15251526
// into db.explicit_encryption.
@@ -1536,7 +1537,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15361537
findPayload = await clientEncryption.encrypt('encrypted indexed value', {
15371538
keyId: key1Id,
15381539
algorithm: 'Indexed',
1539-
queryType: 'equality'
1540+
queryType: 'equality',
1541+
contentionFactor: 0
15401542
});
15411543
});
15421544

@@ -1590,7 +1592,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15901592
findPayload = await clientEncryption.encrypt('encrypted indexed value', {
15911593
keyId: key1Id,
15921594
algorithm: 'Indexed',
1593-
queryType: 'equality'
1595+
queryType: 'equality',
1596+
contentionFactor: 0
15941597
});
15951598
// Use clientEncryption to encrypt the value "encrypted indexed value" with these EncryptOpts:
15961599
// class EncryptOpts {
@@ -1682,7 +1685,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16821685
// Store the result in payload.
16831686
payload = await clientEncryption.encrypt('encrypted indexed value', {
16841687
keyId: key1Id,
1685-
algorithm: 'Indexed'
1688+
algorithm: 'Indexed',
1689+
contentionFactor: 0
16861690
});
16871691
});
16881692

test/integration/client-side-encryption/driver.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ describe('Client Side Encryption Functional', function () {
5353
}
5454
});
5555

56-
describe('Collection', function () {
57-
describe('#bulkWrite()', function () {
56+
describe('Collection', metadata, function () {
57+
describe('#bulkWrite()', metadata, function () {
5858
context('when encryption errors', function () {
5959
let client;
6060

@@ -89,15 +89,15 @@ describe('Client Side Encryption Functional', function () {
8989
await client.close();
9090
});
9191

92-
it('bubbles up the mongocrypt error', async function () {
92+
it('bubbles up the error', metadata, async function () {
9393
try {
9494
await client
9595
.db('test')
9696
.collection('coll')
9797
.bulkWrite([{ insertOne: { ssn: 'foo' } }]);
9898
expect.fail('expected error to be thrown');
9999
} catch (error) {
100-
expect(error.message).to.equal('not all keys requested were satisfied');
100+
expect(error.name).to.equal('MongoBulkWriteError');
101101
}
102102
});
103103
});

test/spec/client-side-encryption/tests/legacy/fle2-Delete.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
"encryptedIndexed": {
226226
"$eq": {
227227
"$binary": {
228-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
228+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
229229
"subType": "06"
230230
}
231231
}

test/spec/client-side-encryption/tests/legacy/fle2-Delete.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ tests:
7171
"encryptedIndexed": {
7272
"$eq": {
7373
"$binary": {
74-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
74+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
7575
"subType": "06"
7676
}
7777
}
@@ -104,4 +104,4 @@ tests:
104104
command_name: delete
105105
outcome:
106106
collection:
107-
data: []
107+
data: []

test/spec/client-side-encryption/tests/legacy/fle2-EncryptedFields-vs-jsonSchema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"encryptedIndexed": {
231231
"$eq": {
232232
"$binary": {
233-
"base64": "BYkAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVjACAAAAAAWuidNu47c9A4Clic3DvFhn1AQJVC+FJtoE5bGZuz6PsSY20AAAAAAAAAAAAA",
233+
"base64": "BbEAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVjACAAAAAAWuidNu47c9A4Clic3DvFhn1AQJVC+FJtoE5bGZuz6PsFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
234234
"subType": "06"
235235
}
236236
}

test/spec/client-side-encryption/tests/legacy/fle2-EncryptedFields-vs-jsonSchema.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ tests:
7272
"encryptedIndexed": {
7373
"$eq": {
7474
"$binary": {
75-
"base64": "BYkAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVjACAAAAAAWuidNu47c9A4Clic3DvFhn1AQJVC+FJtoE5bGZuz6PsSY20AAAAAAAAAAAAA",
75+
"base64": "BbEAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVjACAAAAAAWuidNu47c9A4Clic3DvFhn1AQJVC+FJtoE5bGZuz6PsFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
7676
"subType": "06"
7777
}
7878
}
@@ -87,4 +87,4 @@ tests:
8787
collection:
8888
# Outcome is checked using a separate MongoClient without auto encryption.
8989
data:
90-
- { "_id": 1, "encryptedIndexed": { $$type: "binData" }, "__safeContent__": [{ "$binary" : { "base64" : "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=", "subType" : "00" } }] }
90+
- { "_id": 1, "encryptedIndexed": { $$type: "binData" }, "__safeContent__": [{ "$binary" : { "base64" : "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=", "subType" : "00" } }] }

test/spec/client-side-encryption/tests/legacy/fle2-FindOneAndUpdate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"encryptedIndexed": {
231231
"$eq": {
232232
"$binary": {
233-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
233+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
234234
"subType": "06"
235235
}
236236
}
@@ -490,7 +490,7 @@
490490
"encryptedIndexed": {
491491
"$eq": {
492492
"$binary": {
493-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
493+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
494494
"subType": "06"
495495
}
496496
}

test/spec/client-side-encryption/tests/legacy/fle2-FindOneAndUpdate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ tests:
7070
"encryptedIndexed": {
7171
"$eq": {
7272
"$binary": {
73-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
73+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
7474
"subType": "06"
7575
}
7676
}
@@ -172,7 +172,7 @@ tests:
172172
"encryptedIndexed": {
173173
"$eq": {
174174
"$binary": {
175-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
175+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
176176
"subType": "06"
177177
}
178178
}
@@ -210,4 +210,4 @@ tests:
210210
outcome:
211211
collection:
212212
data:
213-
- { "_id": 1, "encryptedIndexed": { "$$type": "binData" }, "__safeContent__": [{ "$binary" : { "base64" : "rhe7/w8Ob8Unl44rGr/moScx6m5VODQnscDhF4Nkn6g=", "subType" : "00" } }] }
213+
- { "_id": 1, "encryptedIndexed": { "$$type": "binData" }, "__safeContent__": [{ "$binary" : { "base64" : "rhe7/w8Ob8Unl44rGr/moScx6m5VODQnscDhF4Nkn6g=", "subType" : "00" } }] }

0 commit comments

Comments
 (0)