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
Copy file name to clipboardExpand all lines: tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/tests/legacy/README.rst
+283-7Lines changed: 283 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -330,6 +330,11 @@ Using ``crypt_shared``
330
330
On platforms where crypt_shared_ is available, drivers should prefer to test
331
331
with the ``crypt_shared`` library instead of spawning mongocryptd.
332
332
333
+
crypt_shared_ is released alongside the server.
334
+
crypt_shared_ is only available in versions 6.0 and above.
335
+
Drivers SHOULD prefer testing a version of crypt_shared_ that matches the server version being tested.
336
+
Driver tests on server versions less than 6.0 SHOULD use mongocryptd.
337
+
333
338
Drivers MUST continue to run all tests with mongocryptd on at least one
334
339
platform for all tested server versions.
335
340
@@ -1656,6 +1661,7 @@ Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with the
1656
1661
classEncryptOpts {
1657
1662
keyId : <key1ID>
1658
1663
algorithm:"Indexed",
1664
+
contentionFactor:0
1659
1665
}
1660
1666
1661
1667
Store the result in ``insertPayload``.
@@ -1669,7 +1675,8 @@ Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with the
1669
1675
classEncryptOpts {
1670
1676
keyId : <key1ID>
1671
1677
algorithm:"Indexed",
1672
-
queryType:Equality
1678
+
queryType:"equality",
1679
+
contentionFactor:0
1673
1680
}
1674
1681
1675
1682
Store the result in ``findPayload``.
@@ -1704,7 +1711,8 @@ Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with the
1704
1711
classEncryptOpts {
1705
1712
keyId : <key1ID>
1706
1713
algorithm:"Indexed",
1707
-
queryType:Equality
1714
+
queryType:"equality",
1715
+
contentionFactor:0
1708
1716
}
1709
1717
1710
1718
Store the result in ``findPayload``.
@@ -1720,7 +1728,7 @@ Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with the
1720
1728
classEncryptOpts {
1721
1729
keyId : <key1ID>
1722
1730
algorithm:"Indexed",
1723
-
queryType:Equality,
1731
+
queryType:"equality",
1724
1732
contentionFactor:10
1725
1733
}
1726
1734
@@ -1760,6 +1768,7 @@ Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with the
1760
1768
classEncryptOpts {
1761
1769
keyId : <key1ID>
1762
1770
algorithm:"Indexed",
1771
+
contentionFactor:0
1763
1772
}
1764
1773
1765
1774
Store the result in ``payload``.
@@ -1785,6 +1794,8 @@ Use ``clientEncryption`` to decrypt ``payload``. Assert the returned value equal
1785
1794
13. Unique Index on keyAltNames
1786
1795
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1787
1796
1797
+
The following setup must occur before running each of the following test cases.
1798
+
1788
1799
Setup
1789
1800
`````
1790
1801
@@ -1817,8 +1828,8 @@ The command should be equivalent to:
1817
1828
1818
1829
5. Using ``client_encryption``, create a data key with a ``local`` KMS provider and the keyAltName "def".
1819
1830
1820
-
Case 1: createKey()
1821
-
```````````````````
1831
+
Case 1: createDataKey()
1832
+
```````````````````````
1822
1833
1823
1834
1. Use ``client_encryption`` to create a new local data key with a keyAltName "abc" and assert the operation does not fail.
1824
1835
@@ -1833,8 +1844,273 @@ Case 2: addKeyAltName()
1833
1844
1834
1845
2. Use ``client_encryption`` to add a keyAltName "abc" to the key created in Step 1 and assert the operation does not fail.
1835
1846
1836
-
3. Repeat Step 2 and assert the operation does not fail.
1847
+
3. Repeat Step 2, assert the operation does not fail, and assert the returned key document contains the keyAltName "abc" added in Step 2.
1837
1848
1838
1849
4. Use ``client_encryption`` to add a keyAltName "def" to the key created in Step 1 and assert the operation fails due to a duplicate key server error (error code 11000).
1839
1850
1840
-
5. Use ``client_encryption`` to add a keyAltName "def" to the existing key and assert the operation does not fail.
1851
+
5. Use ``client_encryption`` to add a keyAltName "def" to the existing key, assert the operation does not fail, and assert the returned key document contains the keyAltName "def" added during Setup.
1852
+
1853
+
14. Decryption Events
1854
+
~~~~~~~~~~~~~~~~~~~~~
1855
+
1856
+
Before running each of the following test cases, perform the following Test Setup.
1857
+
1858
+
Test Setup
1859
+
``````````
1860
+
1861
+
Create a MongoClient named ``setupClient``.
1862
+
1863
+
Drop and create the collection ``db.decryption_events``.
1864
+
1865
+
Create a ClientEncryption object named ``clientEncryption`` with these options:
Copy file name to clipboardExpand all lines: tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/tests/legacy/fle2-InsertFind-Unindexed.json
Copy file name to clipboardExpand all lines: tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/tests/legacy/fle2-InsertFind-Unindexed.yml
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -80,4 +80,8 @@ tests:
80
80
arguments:
81
81
filter: { encryptedUnindexed: "value123" }
82
82
result:
83
-
errorContains: "Cannot query"
83
+
# Expected error message changed in https://github.com/10gen/mongo-enterprise-modules/commit/212b584d4f7a44bed41c826a180a4aff00923d7a#diff-5f12b55e8d5c52c2f62853ec595dc2c1e2e5cb4fdbf7a32739a8e3acb3c6f818
84
+
# Before the message was "cannot query non-indexed fields with the randomized encryption algorithm"
85
+
# After: "can only execute encrypted equality queries with an encrypted equality index"
0 commit comments