Skip to content

Commit 93ea909

Browse files
authored
CDRIVER-6044 Text search explicit encryption API and prose tests (#2084)
1 parent b5338a5 commit 93ea909

File tree

37 files changed

+1603
-14
lines changed

37 files changed

+1603
-14
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,10 @@ elseif (NOT ENABLE_CLIENT_SIDE_ENCRYPTION STREQUAL OFF)
489489
find_package (mongocrypt QUIET)
490490
endif ()
491491

492-
if (mongocrypt_FOUND AND "${mongocrypt_VERSION}" VERSION_LESS 1.15.0)
492+
if (mongocrypt_FOUND AND "${mongocrypt_VERSION}" VERSION_LESS 1.15.1)
493493
message (STATUS " libmongocrypt found at ${mongocrypt_DIR}")
494494
message (STATUS " libmongocrypt version ${mongocrypt_VERSION} found")
495-
message (STATUS " libmongocrypt version 1.15.0 is required to enable In-Use Encryption Support.")
495+
message (STATUS " libmongocrypt version 1.15.1 is required to enable In-Use Encryption Support.")
496496
set (REQUIRED_MONGOCRYPT_VERSION_FOUND OFF)
497497
elseif (mongocrypt_FOUND)
498498
set (REQUIRED_MONGOCRYPT_VERSION_FOUND ON)

src/libmongoc/doc/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ API Reference
2323
mongoc_client_encryption_datakey_opts_t
2424
mongoc_client_encryption_rewrap_many_datakey_result_t
2525
mongoc_client_encryption_encrypt_opts_t
26+
mongoc_client_encryption_encrypt_text_opts_t
2627
mongoc_client_encryption_encrypt_range_opts_t
2728
mongoc_client_encryption_opts_t
2829
mongoc_client_pool_t

src/libmongoc/doc/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ def _maybe_update_inventories(app: Sphinx):
193193
.. |bson_t-opt-storage-ptr| replace::
194194
maybe-``NULL`` pointer to `overwritable storage <bson_lifetimes_>`_ for a :symbol:`bson_t`
195195
196+
.. |encrypt-text-is-experimental| replace::
197+
The "TextPreview" algorithm is in preview and should be used for experimental workloads only.
198+
These features are unstable and their security is not guaranteed until released as Generally
199+
Available (GA). The GA version of these features may not be backwards compatible with the
200+
preview version.
201+
196202
.. _mongodb_docs_cdriver: https://www.mongodb.com/docs/languages/c/c-driver/current/
197203
198204
.. _queryable-encryption: https://www.mongodb.com/docs/languages/c/c-driver/current/libmongoc/guides/queryable-encryption/
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
:man_page: mongoc_client_encryption_encrypt_opts_set_text_opts
2+
3+
mongoc_client_encryption_encrypt_opts_set_text_opts()
4+
=====================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_opts_set_text_opts(
13+
mongoc_client_encryption_encrypt_opts_t *opts,
14+
const mongoc_client_encryption_encrypt_text_opts_t *text_opts);
15+
16+
.. versionadded:: 2.2.0
17+
18+
Sets the text search encryption options for explicit encryption.
19+
20+
|encrypt-text-is-experimental|
21+
22+
Parameters
23+
----------
24+
25+
* ``opts``: A :symbol:`mongoc_client_encryption_encrypt_opts_t`.
26+
* ``text_opts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t` specifying text search options.
27+
28+
.. seealso::
29+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_t`
30+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_new`
31+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_prefix`
32+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_suffix`
33+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_substring`
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_destroy
2+
3+
mongoc_client_encryption_encrypt_text_opts_destroy()
4+
====================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_text_opts_destroy(mongoc_client_encryption_encrypt_text_opts_t *topts);
13+
14+
.. versionadded:: 2.2.0
15+
16+
Frees a :symbol:`mongoc_client_encryption_encrypt_text_opts_t` created with :symbol:`mongoc_client_encryption_encrypt_text_opts_new()`.
17+
18+
|encrypt-text-is-experimental|
19+
20+
Parameters
21+
----------
22+
23+
* ``topts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t` to destroy.
24+
25+
.. seealso::
26+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_new`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_new
2+
3+
mongoc_client_encryption_encrypt_text_opts_new()
4+
================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
mongoc_client_encryption_encrypt_text_opts_t *
12+
mongoc_client_encryption_encrypt_text_opts_new(void);
13+
14+
.. versionadded:: 2.2.0
15+
16+
|encrypt-text-is-experimental|
17+
18+
Returns
19+
-------
20+
21+
A new :symbol:`mongoc_client_encryption_encrypt_text_opts_t` that must be freed with :symbol:`mongoc_client_encryption_encrypt_text_opts_destroy()`.
22+
23+
.. seealso::
24+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_destroy`
25+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_prefix`
26+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_suffix`
27+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_set_substring`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_set_case_sensitive
2+
3+
mongoc_client_encryption_encrypt_text_opts_set_case_sensitive()
4+
===============================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_text_opts_set_case_sensitive(
13+
mongoc_client_encryption_encrypt_text_opts_t *opts,
14+
bool case_sensitive);
15+
16+
.. versionadded:: 2.2.0
17+
18+
Sets whether text search is case sensitive.
19+
20+
|encrypt-text-is-experimental|
21+
22+
Parameters
23+
----------
24+
25+
* ``opts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t`.
26+
* ``case_sensitive``: If true, text search is case sensitive.
27+
28+
.. seealso::
29+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_t`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_set_diacritic_sensitive
2+
3+
mongoc_client_encryption_encrypt_text_opts_set_diacritic_sensitive()
4+
====================================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_text_opts_set_diacritic_sensitive(
13+
mongoc_client_encryption_encrypt_text_opts_t *opts,
14+
bool diacritic_sensitive);
15+
16+
.. versionadded:: 2.2.0
17+
18+
Sets whether text search is diacritic sensitive.
19+
20+
|encrypt-text-is-experimental|
21+
22+
Parameters
23+
----------
24+
25+
* ``opts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t`.
26+
* ``diacritic_sensitive``: If true, text search is diacritic sensitive.
27+
28+
.. seealso::
29+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_t`
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_set_prefix
2+
3+
mongoc_client_encryption_encrypt_text_opts_set_prefix()
4+
=======================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_text_opts_set_prefix(
13+
mongoc_client_encryption_encrypt_text_opts_t *opts,
14+
mongoc_client_encryption_encrypt_text_prefix_opts_t *popts);
15+
16+
.. versionadded:: 2.2.0
17+
18+
Sets the prefix options for text search encryption.
19+
20+
|encrypt-text-is-experimental|
21+
22+
Parameters
23+
----------
24+
25+
* ``opts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t`.
26+
* ``popts``: A :symbol:`mongoc_client_encryption_encrypt_text_prefix_opts_t` to set as prefix options.
27+
28+
.. seealso::
29+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_new`
30+
| :symbol:`mongoc_client_encryption_encrypt_text_prefix_opts_new`
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
:man_page: mongoc_client_encryption_encrypt_text_opts_set_substring
2+
3+
mongoc_client_encryption_encrypt_text_opts_set_substring()
4+
==========================================================
5+
6+
Synopsis
7+
--------
8+
9+
.. code-block:: c
10+
11+
void
12+
mongoc_client_encryption_encrypt_text_opts_set_substring(
13+
mongoc_client_encryption_encrypt_text_opts_t *opts,
14+
mongoc_client_encryption_encrypt_text_substring_opts_t *ssopts);
15+
16+
.. versionadded:: 2.2.0
17+
18+
Sets the substring options for text search encryption.
19+
20+
|encrypt-text-is-experimental|
21+
22+
Parameters
23+
----------
24+
25+
* ``opts``: A :symbol:`mongoc_client_encryption_encrypt_text_opts_t`.
26+
* ``ssopts``: A :symbol:`mongoc_client_encryption_encrypt_text_substring_opts_t` to set as substring options.
27+
28+
.. seealso::
29+
| :symbol:`mongoc_client_encryption_encrypt_text_opts_new`
30+
| :symbol:`mongoc_client_encryption_encrypt_text_substring_opts_new`

0 commit comments

Comments
 (0)