MONGOCRYPT-432 Allow keyAltName in encryptedFieldsMap#1091
MONGOCRYPT-432 Allow keyAltName in encryptedFieldsMap#1091mdb-ad wants to merge 42 commits intomongodb:masterfrom
Conversation
| mongocrypt_status_destroy(status); | ||
| } | ||
|
|
||
| static void _test_qe_keyAltName(_mongocrypt_tester_t *tester) { |
There was a problem hiding this comment.
I expect the "create" command is not translating a "keyAltName":
{
"create": "coll",
"encryptedFields": {
"fields": [
{
"path": "secret",
"bsonType": "string",
"keyAltName": "keyDocumentName"
}
]
}
}See this test to exercise this scenario.
Without support for the "create" command or ClientEncryption.createEncryptedCollection helper, I expect keyAltName may be difficult to use (creation would still require a key ID).
If this is a significant effort, consider filing a MONGOCRYPT ticket to track supporting "create", and update the scope to note this as future work.
| ASSERT_OK(mongocrypt_ctx_mongo_done(ctx), ctx); | ||
| } | ||
|
|
||
| // MONGOCRYPT_CTX_MARKINGS is entered to send command to mongocryptd. |
There was a problem hiding this comment.
When mongocrypt_setopt_bypass_query_analysis is called, the MONGOCRYPT_CTX_MARKINGS state appears to be incorrectly entered. See this test.
Co-authored-by: Kevin Albertson <kevin.eric.albertson@gmail.com>
| /* If an encrypted_field_config was set, check if keys are required for | ||
| * compactionTokens. */ | ||
|
|
||
| if (!mc_schema_broker_need_more_schemas(ectx->sb) && !_fle2_collect_keys_for_compaction(ctx)) { |
There was a problem hiding this comment.
_fle2_collect_keys_for_compaction requests keys by ID. I expect it will also need to request keys by keyAltName.
Suggest implementing this draft test of the compact command with keyAltname. It currently fails with:
expected UUID for key id.
Background
Adds
keyAltNametokeyIdclient-side translation to libmongocrypt that allows users to specify human-readablekeyAltNamestrings instead of binary key IDs.Implementation
Whenever
encryptionInformationis appended to at outgoing command, libmongocrypt looks through the encrypted fields forkeyAltNamefields and translates them tokeyId.Testing
Tested on the C driver with spec test: https://spruce.mongodb.com/version/697803dbc0c964000764d2a4/