-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDRIVER-5644 Add option to configure DEK cache lifetime #1779
base: master
Are you sure you want to change the base?
Changes from all commits
d762bf7
b819838
ac395ad
8f5cf7f
134dec7
5bf2b63
6cab18d
d4ba4d2
99c2703
e3f909c
acdc927
c25c856
b948894
2952bd1
c53b793
566fb88
b803b46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
:man_page: mongoc_auto_encryption_opts_set_key_expiration | ||
|
||
mongoc_auto_encryption_opts_set_key_expiration() | ||
======================================================== | ||
|
||
Synopsis | ||
-------- | ||
|
||
.. code-block:: c | ||
|
||
void | ||
mongoc_auto_encryption_opts_set_key_expiration ( | ||
mongoc_auto_encryption_opts_t *opts, uint64_t cache_expiration_ms); | ||
|
||
|
||
Parameters | ||
---------- | ||
|
||
* ``opts``: The :symbol:`mongoc_auto_encryption_opts_t` | ||
* ``cache_expiration_ms``: The data encryption key cache expiration time in milliseconds. | ||
|
||
.. seealso:: | ||
|
||
| :symbol:`mongoc_client_enable_auto_encryption()` | ||
|
||
| `In-Use Encryption <in-use-encryption_>`_ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
:man_page: mongoc_client_encryption_opts_set_key_expiration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
|
||
mongoc_client_encryption_opts_set_key_expiration() | ||
======================================================== | ||
|
||
Synopsis | ||
-------- | ||
|
||
.. code-block:: c | ||
|
||
void | ||
mongoc_client_encryption_opts_set_key_expiration ( | ||
mongoc_client_encryption_opts_t *opts, uint64_t cache_expiration_ms); | ||
|
||
|
||
Parameters | ||
---------- | ||
|
||
* ``opts``: The :symbol:`mongoc_client_encryption_opts_t` | ||
* ``cache_expiration_ms``: The data encryption key cache expiration time in milliseconds. | ||
|
||
.. seealso:: | ||
|
||
| :symbol:`mongoc_client_encryption_new()` | ||
|
||
| `In-Use Encryption <in-use-encryption_>`_ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1380,6 +1380,7 @@ _mongoc_crypt_new (const bson_t *kms_providers, | |
bool bypass_auto_encryption, | ||
bool bypass_query_analysis, | ||
mc_kms_credentials_callback creds_cb, | ||
mcd_optional_u64_t cache_expiration_ms, | ||
bson_error_t *error) | ||
{ | ||
_mongoc_crypt_t *crypt; | ||
|
@@ -1457,6 +1458,13 @@ _mongoc_crypt_new (const bson_t *kms_providers, | |
goto fail; | ||
} | ||
|
||
if (cache_expiration_ms.set) { | ||
mongocrypt_setopt_key_expiration (crypt->handle, cache_expiration_ms.value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest doing |
||
if (!_crypt_check_error (crypt->handle, error, false)) { | ||
goto fail; | ||
} | ||
} | ||
|
||
if (!mongocrypt_init (crypt->handle)) { | ||
_crypt_check_error (crypt->handle, error, true); | ||
goto fail; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
mongoc_auto_encryption_opts_set_key_expiration
to thetoctree
ofmongoc_auto_encryption_opts_t.rst
to include in the docs. Fixes error from the docs build:CONTRIBUTING.md documents how to build docs locally. To build libmongoc docs, I use: