DRIVERS-3470 case and diacritic text explicit encryption tests#1931
DRIVERS-3470 case and diacritic text explicit encryption tests#1931mdb-ad wants to merge 11 commits into
Conversation
kevinAlbs
left a comment
There was a problem hiding this comment.
Nice, LGTM with additional notes to skip server 9.0.0+ and require libmongocrypt 1.18.1.
| Expect an error from libmongocrypt with a message containing the string: "contention factor is required for textPreview | ||
| algorithm". | ||
|
|
||
| #### Case 8: can find a case and diacritic-insensitively indexed document by prefix and suffix |
There was a problem hiding this comment.
Also note: "Skip this test case if testing MongoDB server 9.0.0+." note (similar to Case 7) to cases 8 and 9 (requiring prefixPreview and suffixPreview).
And note that libmongocrypt 1.18.1 is required for test cases 8 and 9 since those are regression tests for MONGOCRYPT-903.
|
I'm gonna have to wait for JAVA-6187 to land before being able to test this with Java. |
| Expect an error from libmongocrypt with a message containing the string: "contention factor is required for textPreview | ||
| algorithm". | ||
|
|
||
| #### Case 8: can find a case and diacritic-insensitively indexed document by prefix and suffix |
| Read the `"_id"` field of `key1Document` as `key1ID`. | ||
|
|
||
| Load the file | ||
| [key2-document.json](https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/etc/data/keys/key2-document.json) |
There was a problem hiding this comment.
key2-document is referenced in other tests (e.g. fle2v2-Compact). Regenerating those test files might have unintended changes.
Rather than have the substring test use two fields in the same schema (which requires two keys due to QE needing a unique key-per-field), I suggest following the pattern with prefix-suffix. Add another schema: encryptedFields-substring-ci-di.json to test the insensitive cases.
|
|
||
| #### Case 8: can find a case and diacritic-insensitively indexed document by prefix and suffix | ||
|
|
||
| Skip this test case if testing MongoDB server 9.0.0+. |
There was a problem hiding this comment.
| Skip this test case if testing MongoDB server 9.0.0+. | |
| Skip this test case if testing MongoDB server 9.0.0+. This test requires libmongocrypt 1.18.1+. |
|
|
||
| #### Case 9: can find a diacritic-insensitively indexed document by prefix and suffix | ||
|
|
||
| Skip this test case if testing MongoDB server 9.0.0+. |
There was a problem hiding this comment.
| Skip this test case if testing MongoDB server 9.0.0+. | |
| Skip this test case if testing MongoDB server 9.0.0+. This test requires libmongocrypt 1.18.1+. |
| { "encryptedText": "cafébarbäz" } | ||
| ``` | ||
|
|
||
| #### Case 10: can find a case-insensitively indexed document by substring |
There was a problem hiding this comment.
| #### Case 10: can find a case-insensitively indexed document by substring | |
| #### Case 10: can find a case-insensitively indexed document by substring | |
| This test requires libmongocrypt 1.18.1+. |
| { "encryptedTextInsensitive": "FooBarBaz" } | ||
| ``` | ||
|
|
||
| #### Case 11: can find a diacritic-insensitively indexed document by substring |
There was a problem hiding this comment.
| #### Case 11: can find a diacritic-insensitively indexed document by substring | |
| #### Case 11: can find a diacritic-insensitively indexed document by substring | |
| This test requires libmongocrypt 1.18.1+. |
Background
Tests case and diacritic insensitivity. Also serves as a regression test for MONGOCRYPT-903. Note: the fix was released in libmongocrypt 1.18.1
Test implementation
Unlike other text prose tests, the new case and diacritic tests use automatic encryption to insert the test document. This is because the libmongocrypt bug reversed case and diacritic sensitivity both on the insert and find, causing the tests to pass.
C driver implementation: mongodb/mongo-c-driver#2289
Evergreen patch (C driver): https://spruce.corp.mongodb.com/version/69fe3b156c09fa0007dd4f45
Libmongocrypt build (for drivers testing): https://spruce.corp.mongodb.com/version/libmongocrypt_d64db0ad9db89b8ba85e6330133e2df55b5eb9ff