Skip to content

Commit 4bc2c62

Browse files
committed
Updated client side encryption tests
1 parent b925162 commit 4bc2c62

File tree

7 files changed

+37
-32
lines changed

7 files changed

+37
-32
lines changed

driver-core/src/test/resources/client-side-encryption/README.rst

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ Use as integration tests
152152

153153
Do the following before running spec tests:
154154

155-
- If available for the platform under test, obtain a csfle_ binary and place it
156-
in a location accessible to the tests. Refer to: `Using csfle`_
155+
- If available for the platform under test, obtain a crypt_shared_ binary and place it
156+
in a location accessible to the tests. Refer to: `Using crypt_shared`_
157157
- Start the mongocryptd process.
158158
- Start a mongod process with **server version 4.1.9 or later**.
159159
- Place credentials to an AWS IAM user (access key ID + secret access key) somewhere in the environment outside of tracked code. (If testing on evergreen, project variables are a good place).
160160
- Start a KMIP test server on port 5698 by running `drivers-evergreen-tools/.evergreen/csfle/kms_kmip_server.py <https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/csfle/kms_kmip_server.py>`_.
161161

162-
.. _csfle: ../client-side-encryption.rst#csfle
162+
.. _crypt_shared: ../client-side-encryption.rst#crypt_shared
163163

164164
Load each YAML (or JSON) file using a Canonical Extended JSON parser.
165165

@@ -182,7 +182,8 @@ Then for each element in ``tests``:
182182
183183
{"create": <collection>, "validator": {"$jsonSchema": <json_schema>}}
184184
185-
If ``encrypted_fields`` is defined in the test, the required collections and index described in `FLE 2 CreateCollection() and Collection.Drop() <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#fle-2-createcollection-and-collection-drop>`_ must be created:
185+
If ``encrypted_fields`` is defined in the test, the required collections and index described in `FLE 2 Create and Drop Collection Helpers <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#fle-2-create-and-drop-collection-helpers>`_ must be created:
186+
186187
- Use the ``dropCollection`` helper with ``encrypted_fields`` as an option and writeConcern "majority".
187188
- Use the ``createCollection`` helper with ``encrypted_fields`` as an option.
188189

@@ -323,32 +324,35 @@ Then for each element in ``tests``:
323324
The spec test MUST be run with *and* without auth.
324325

325326

326-
Using ``csfle``
327-
===============
327+
Using ``crypt_shared``
328+
======================
328329

329-
On platforms where csfle_ is available, drivers should prefer to test with the
330-
csfle library instead of spawning mongocryptd, although having some tests
331-
dedicated to mongocryptd is recommended. Note that some tests assert on
332-
mongocryptd-related behaviors (e.g. the ``mongocryptdBypassSpawn`` test).
330+
On platforms where crypt_shared_ is available, drivers should prefer to test
331+
with the ``crypt_shared`` library instead of spawning mongocryptd, although
332+
having some tests dedicated to mongocryptd is recommended. Note that some tests
333+
assert on mongocryptd-related behaviors (e.g. the ``mongocryptdBypassSpawn``
334+
test).
333335

334-
Drivers under test should load the csfle_ library using either the ``csflePath``
335-
public API option (as part of the AutoEncryption ``extraOptions``), or by
336-
setting a special search path instead.
336+
Drivers under test should load the crypt_shared_ library using either the
337+
``cryptSharedLibPath`` public API option (as part of the AutoEncryption
338+
``extraOptions``), or by setting a special search path instead.
337339

338-
Some tests will require *not* using csfle_. For such tests, one should ensure
339-
that csfle will not be loaded. Refer to the client-side-encryption documentation
340-
for information on "disabling" csfle and setting csfle search paths.
340+
Some tests will require *not* using crypt_shared_. For such tests, one should
341+
ensure that ``crypt_shared`` will not be loaded. Refer to the
342+
client-side-encryption documentation for information on "disabling"
343+
``crypt_shared`` and setting library search paths.
341344

342345
.. note::
343346

344-
The ``csfle`` dynamic library can be obtained using the mongodl_ Python
347+
The crypt_shared_ dynamic library can be obtained using the mongodl_ Python
345348
script from drivers-evergreen-tools_:
346349

347350
.. code-block:: shell
348351
349-
$ python3 mongodl.py --component=csfle --version=6.0.0-rc4 --out=./csfle/
352+
$ python3 mongodl.py --component=crypt_shared --version=<VERSION> --out=./crypt_shared/
350353
351-
Other versions of `csfle` are available. Please use the `--list` option to see versions.
354+
Other versions of ``crypt_shared`` are also available. Please use the
355+
``--list`` option to see versions.
352356

353357
.. _mongodl: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/mongodl.py
354358
.. _drivers-evergreen-tools: https://github.com/mongodb-labs/drivers-evergreen-tools/
@@ -961,12 +965,13 @@ Test cases
961965

962966
.. note::
963967

964-
IMPORTANT: If csfle_ is visible to the operating system's library search
965-
mechanism, the expected server error generated by these
968+
IMPORTANT: If crypt_shared_ is visible to the operating system's library
969+
search mechanism, the expected server error generated by these
966970
``mongocryptdBypassSpawn`` tests will not appear because libmongocrypt will
967-
load the csfle library instead of consulting mongocryptd. For these tests, it
968-
is required that libmongocrypt *not* load csfle. Refer to the
969-
client-side-encryption document for more information on "disabling" csfle.
971+
load the ``crypt_shared`` library instead of consulting mongocryptd. For
972+
these tests, it is required that libmongocrypt *not* load ``crypt_shared``.
973+
Refer to the client-side-encryption document for more information on
974+
"disabling" ``crypt_shared``.
970975

971976

972977
Via mongocryptdBypassSpawn

driver-core/src/test/resources/client-side-encryption/legacy/fle2-Compact.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"runOn": [
33
{
44
"minServerVersion": "6.0.0",
5-
"topologies": [
5+
"topology": [
66
"replicaset",
77
"sharded"
88
]

driver-core/src/test/resources/client-side-encryption/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
}

driver-core/src/test/resources/client-side-encryption/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
}

driver-core/src/test/resources/client-side-encryption/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
}

driver-core/src/test/resources/client-side-encryption/legacy/fle2-InsertFind-Indexed.json

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

driver-core/src/test/resources/client-side-encryption/legacy/fle2-Update.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
"encryptedIndexed": {
233233
"$eq": {
234234
"$binary": {
235-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
235+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
236236
"subType": "06"
237237
}
238238
}
@@ -496,7 +496,7 @@
496496
"encryptedIndexed": {
497497
"$eq": {
498498
"$binary": {
499-
"base64": "BYkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcSY20AAAAAAAAAAAAA",
499+
"base64": "BbEAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVjACAAAAAA19X9v9NlWidu/wR5/C/7WUV54DfL5CkNmT5WYrhxdDcFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsEmNtAAAAAAAAAAAAAA==",
500500
"subType": "06"
501501
}
502502
}

0 commit comments

Comments
 (0)