[MONGOCRYPT-150] mongocrypt_ctx_setopt_key_alt_name should accept a string instead of a bson document Created: 06/Aug/19  Updated: 04/Sep/19  Resolved: 16/Aug/19

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Shane Harvey Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to PYTHON-1937 pymongocrypt add support for explicit... Closed

 Description   

This ticket is a request to simplify the mongocrypt_ctx_setopt_key_alt_name api to accept key_alt_name as a char *.

The current version:

/**
 * Set the keyAltName to use for explicit encryption.
 * keyAltName should be a binary encoding a bson document
 * with the following format:
 *
 *   { "keyAltName" : <BSON UTF8 value> }
 *
...
mongocrypt_ctx_setopt_key_alt_name (mongocrypt_ctx_t *ctx,
                                    mongocrypt_binary_t *key_alt_name);

My suggested change:

mongocrypt_ctx_setopt_key_alt_name (mongocrypt_ctx_t *ctx,
                                    const char *key_alt_name,
                                    int len);

This matches how strings are passed in other parts of the api, eg:

mongocrypt_ctx_setopt_algorithm (mongocrypt_ctx_t *ctx,
                                 const char *algorithm,
                                 int len);



 Comments   
Comment by Kevin Albertson [ 16/Aug/19 ]

We made this API back when keyAltName was not limited to strings. Unfortunately it stuck in our API, and now that we've released drivers with FLE, we don't think it's worth forcing all drivers to rewrite their bindings for a slightly cleaner API.

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