You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 2. Using ``client``, drop and create the collection ``db.coll`` configured with the included JSON schema `corpus/corpus-schema.json <../corpus/corpus-schema.json>`_.
@@ -197,7 +179,7 @@ describe('Client Side Encryption Corpus', function() {
197
179
// Configure both objects with ``keyVaultNamespace`` set to ``admin.datakeys``.
@@ -230,128 +212,132 @@ describe('Client Side Encryption Corpus', function() {
230
212
},Promise.resolve());
231
213
}
232
214
233
-
it(`should pass corpus ${useClientSideSchema ? 'with' : 'without'} client schema`,function(){
234
-
constcorpusCopied={};
235
-
returnPromise.resolve()
236
-
.then(()=>{
237
-
// 5. Load `corpus/corpus.json <../corpus/corpus.json>`_ to a variable named ``corpus``. The corpus contains subdocuments with the following fields:
238
-
//
239
-
// - ``kms`` is either ``aws`` or ``local``
240
-
// - ``type`` is a BSON type string `names coming from here <https://docs.mongodb.com/manual/reference/operator/query/type/>`_)
241
-
// - ``algo`` is either ``rand`` or ``det`` for random or deterministic encryption
242
-
// - ``method`` is either ``auto``, for automatic encryption or ``explicit`` for explicit encryption
243
-
// - ``identifier`` is either ``id`` or ``altname`` for the key identifier
244
-
// - ``allowed`` is a boolean indicating whether the encryption for the given parameters is permitted.
245
-
// - ``value`` is the value to be tested.
246
-
//
247
-
// Create a new BSON document, named ``corpus_copied``.
248
-
//
249
-
// Iterate over each field of ``corpus``.
250
-
// - If the field name is ``_id``, ``altname_aws`` and ``altname_local``, copy the field to ``corpus_copied``.
251
-
// - If ``method`` is ``auto``, copy the field to ``corpus_copied``.
252
-
// - If ``method`` is ``explicit``, use ``client_encryption`` to explicitly encrypt the value.
253
-
// - Encrypt with the algorithm described by ``algo``.
254
-
// - If ``identifier`` is ``id``
255
-
// - If ``kms`` is ``local`` set the key_id to the UUID with base64 value ``LOCALAAAAAAAAAAAAAAAAA==``.
256
-
// - If ``kms`` is ``aws`` set the key_id to the UUID with base64 value ``AWSAAAAAAAAAAAAAAAAAAA==``.
257
-
// - If ``identifier`` is ``altname``
258
-
// - If ``kms`` is ``local`` set the key_alt_name to "local".
259
-
// - If ``kms`` is ``aws`` set the key_alt_name to "aws".
260
-
// If ``allowed`` is true, copy the field and encrypted value to ``corpus_copied``.
261
-
// If ``allowed`` is false. verify that an exception is thrown. Copy the unencrypted value to to ``corpus_copied``.
`should pass corpus ${useClientSideSchema ? 'with' : 'without'} client schema`,
217
+
metadata,
218
+
function(){
219
+
constcorpusCopied={};
220
+
returnPromise.resolve()
221
+
.then(()=>{
222
+
// 5. Load `corpus/corpus.json <../corpus/corpus.json>`_ to a variable named ``corpus``. The corpus contains subdocuments with the following fields:
223
+
//
224
+
// - ``kms`` is either ``aws`` or ``local``
225
+
// - ``type`` is a BSON type string `names coming from here <https://docs.mongodb.com/manual/reference/operator/query/type/>`_)
226
+
// - ``algo`` is either ``rand`` or ``det`` for random or deterministic encryption
227
+
// - ``method`` is either ``auto``, for automatic encryption or ``explicit`` for explicit encryption
228
+
// - ``identifier`` is either ``id`` or ``altname`` for the key identifier
229
+
// - ``allowed`` is a boolean indicating whether the encryption for the given parameters is permitted.
230
+
// - ``value`` is the value to be tested.
231
+
//
232
+
// Create a new BSON document, named ``corpus_copied``.
233
+
//
234
+
// Iterate over each field of ``corpus``.
235
+
// - If the field name is ``_id``, ``altname_aws`` and ``altname_local``, copy the field to ``corpus_copied``.
236
+
// - If ``method`` is ``auto``, copy the field to ``corpus_copied``.
237
+
// - If ``method`` is ``explicit``, use ``client_encryption`` to explicitly encrypt the value.
238
+
// - Encrypt with the algorithm described by ``algo``.
239
+
// - If ``identifier`` is ``id``
240
+
// - If ``kms`` is ``local`` set the key_id to the UUID with base64 value ``LOCALAAAAAAAAAAAAAAAAA==``.
241
+
// - If ``kms`` is ``aws`` set the key_id to the UUID with base64 value ``AWSAAAAAAAAAAAAAAAAAAA==``.
242
+
// - If ``identifier`` is ``altname``
243
+
// - If ``kms`` is ``local`` set the key_alt_name to "local".
244
+
// - If ``kms`` is ``aws`` set the key_alt_name to "aws".
245
+
// If ``allowed`` is true, copy the field and encrypted value to ``corpus_copied``.
246
+
// If ``allowed`` is false. verify that an exception is thrown. Copy the unencrypted value to to ``corpus_copied``.
// 8. Load `corpus/corpus_encrypted.json <../corpus/corpus-encrypted.json>`_ to a variable named ``corpus_encrypted_expected``.
331
-
// Using ``client`` find the inserted document from ``db.coll`` to a variable named ``corpus_encrypted_actual``.
332
-
333
-
// Iterate over each field of ``corpus_encrypted_expected`` and check the following:
334
-
335
-
// - If the ``algo`` is ``det``, that the value equals the value of the corresponding field in ``corpus_encrypted_actual``.
336
-
// - If the ``algo`` is ``rand`` and ``allowed`` is true, that the value does not equal the value of the corresponding field in ``corpus_encrypted_actual``.
337
-
// - If ``allowed`` is true, decrypt the value with ``client_encryption``. Decrypt the value of the corresponding field of ``corpus_encrypted`` and validate that they are both equal.
338
-
// - If ``allowed`` is false, validate the value exactly equals the value of the corresponding field of ``corpus`` (neither was encrypted).
// 8. Load `corpus/corpus_encrypted.json <../corpus/corpus-encrypted.json>`_ to a variable named ``corpus_encrypted_expected``.
316
+
// Using ``client`` find the inserted document from ``db.coll`` to a variable named ``corpus_encrypted_actual``.
317
+
318
+
// Iterate over each field of ``corpus_encrypted_expected`` and check the following:
319
+
320
+
// - If the ``algo`` is ``det``, that the value equals the value of the corresponding field in ``corpus_encrypted_actual``.
321
+
// - If the ``algo`` is ``rand`` and ``allowed`` is true, that the value does not equal the value of the corresponding field in ``corpus_encrypted_actual``.
322
+
// - If ``allowed`` is true, decrypt the value with ``client_encryption``. Decrypt the value of the corresponding field of ``corpus_encrypted`` and validate that they are both equal.
323
+
// - If ``allowed`` is false, validate the value exactly equals the value of the corresponding field of ``corpus`` (neither was encrypted).
0 commit comments