Skip to content

MONGOCRYPT-432 Allow keyAltName in encryptedFieldsMap#1091

Open
mdb-ad wants to merge 58 commits intomongodb:masterfrom
mdb-ad:keyaltname
Open

MONGOCRYPT-432 Allow keyAltName in encryptedFieldsMap#1091
mdb-ad wants to merge 58 commits intomongodb:masterfrom
mdb-ad:keyaltname

Conversation

@mdb-ad
Copy link
Contributor

@mdb-ad mdb-ad commented Oct 24, 2025

Background

Adds keyAltName to keyId client-side translation to libmongocrypt that allows users to specify human-readable keyAltName strings instead of binary key IDs.

Implementation

Whenever encryptionInformation is appended to at outgoing command, libmongocrypt looks through the encrypted fields for keyAltName fields and translates them to keyId.

Testing

Tested on the C driver with spec test: https://spruce.mongodb.com/version/697803dbc0c964000764d2a4/

@mdb-ad mdb-ad marked this pull request as ready for review February 6, 2026 22:21
@mdb-ad mdb-ad requested a review from a team as a code owner February 6, 2026 22:21
@mdb-ad mdb-ad requested review from vector-of-bool and removed request for vector-of-bool February 6, 2026 22:21
mdb-ad and others added 2 commits February 19, 2026 10:53
@mdb-ad mdb-ad requested a review from kevinAlbs February 25, 2026 20:53
@mdb-ad mdb-ad requested a review from kevinAlbs March 5, 2026 06:44
@mdb-ad mdb-ad requested a review from kevinAlbs March 10, 2026 18:52
Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With minor comments addressed, LGTM!

* process. Instead, we'll do it ourselves here, if possible.
*/
static bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx) {
bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest restoring static since this is no-longer called outside of mongocrypt-ctx-encrypt.c:

Suggested change
bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx) {
static bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx) {

const char *name);

void _bson_value_from_string(const char *string, bson_value_t *value);
bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool _try_run_csfle_marking(mongocrypt_ctx_t *ctx);

@@ -15,13 +15,15 @@
*/

#include <bson/bson.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert no-longer-needed changes to mongocrypt-ctx.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants