[MONGOCRYPT-378] Replace use of mongocryptd with csfle Created: 04/Feb/22  Updated: 01/May/22  Resolved: 30/Mar/22

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0-alpha0, 1.5.0

Type: Improvement Priority: Unknown
Reporter: Kevin Albertson Assignee: Colby Pike
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes PYTHON-3188 Test Failure - TestEncryptedBulkWrite... Closed
Related
is related to DRIVERS-2260 Add CSFLE spec test for auto encrypti... Closed
Epic Link: FLE 1.0 Shared Library
Binding Changes: Not Needed

 Description   

Background
The libmongocrypt state machine enters the MONGOCRYPT_CTX_NEED_MONGO_MARKINGS state to request a driver send a command to mongocryptd.

Scope
Once csfle is dynamically linked, replace use of mongocryptd with the csfle library. Do not enter the MONGOCRYPT_CTX_NEED_MONGO_MARKINGS state.



 Comments   
Comment by Githook User [ 01/Apr/22 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: MONGOCRYPT-378 append empty jsonSchema as fallback (#282)

Resolves a regression: jsonSchema is not appended if there is no local jsonSchema or remote jsonSchema used.
Branch: master
https://github.com/mongodb/libmongocrypt/commit/b4beca89c4071cc0c67c4ef6c1766d6ee03b6acb

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: Integrate csfle dynamic library as part of mongocrypt's encryption routines (#263)

Refer: MONGOCRYPT-378

  • Explicit options to request a test mongocrypt_t with csfle loaded
  • Add csfle to intercept the `NEED_MARKINGS` state
  • Example state machine logs to stderr
  • Fix collinfo for example-state-machine
  • Fix expected command reply to expect a keyId array
  • Add a simple test for the real csfle library
  • Ensure command given to csfle has a $db field, not required for other markings ops
  • Stubbed csfle library generates a valid command response, even if useless
  • API to obtain a filepath for a loaded dynamic libary
  • Load only a single global csfle_lib at any time.

This requires synchronization and global var management.
Each time we try to load csfle, compare
against a global result. If there is no global result, replace the
global with our own result. If there is a global result, compare our
attempt against that global result. Each subsequent attempt to load
csfle must have found the same library, otherwise it is a hard error.

  • Disable warning C4359,

C4359 only appears in C++ for 32bit with bson-types.h
Branch: master
https://github.com/mongodb/libmongocrypt/commit/c425e08f1ca8c5b930f5b4c6c5850e7524761b7e

Generated at Thu Feb 08 09:08:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.