diff --git a/bindings/python/CHANGELOG.rst b/bindings/python/CHANGELOG.rst index 73d5bd440..f43631e3f 100644 --- a/bindings/python/CHANGELOG.rst +++ b/bindings/python/CHANGELOG.rst @@ -1,11 +1,14 @@ Changelog ========= -Changes in Version 2.0.0 +Changes in Version 1.10.0 ------------------------ - Add Python async support. - Drop support for Python 3.7 and PyPy 3.8. Python >=3.8 or PyPy >=3.9 is now required. +- Add support for range-based Queryable Encryption with the new "range" + algorithm on MongoDB 8.0+. This replaces the experimental "rangePreview" algorithm. + Changes in Version 1.9.2 ------------------------ diff --git a/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py b/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py index dd0cf7f31..dcab42d82 100644 --- a/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py +++ b/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py @@ -111,7 +111,7 @@ async def encrypt( - `contention_factor` (int): The contention factor to use when the algorithm is "Indexed". - `range_opts` (bytes): Options for explicit encryption - with the "rangePreview" algorithm encoded as a BSON document. + with the "range" algorithm encoded as a BSON document. - `is_expression` (boolean): True if this is an encryptExpression() context. Defaults to False. diff --git a/bindings/python/pymongocrypt/binding.py b/bindings/python/pymongocrypt/binding.py index 88f67cfd0..66c14c22c 100644 --- a/bindings/python/pymongocrypt/binding.py +++ b/bindings/python/pymongocrypt/binding.py @@ -653,9 +653,7 @@ def _parse_version(version): /// String constant for setopt_algorithm "Random" encryption /// String constant for setopt_algorithm "Indexed" explicit encryption /// String constant for setopt_algorithm "Unindexed" explicit encryption -/// String constant for setopt_algorithm "rangePreview" explicit encryption -/// NOTE: The RangePreview algorithm is experimental only. It is not intended -/// for public use. +/// String constant for setopt_algorithm "Range" explicit encryption /** * Identify the AWS KMS master key to use for creating a data key. @@ -837,9 +835,7 @@ def _parse_version(version): /** * Explicit helper method to encrypt a Match Expression or Aggregate Expression. * Contexts created for explicit encryption will not go through mongocryptd. - * Requires query_type to be "rangePreview". - * NOTE: The RangePreview algorithm is experimental only. It is not intended for - * public use. + * Requires query_type to be "range". * * This method expects the passed-in BSON to be of the form: * { "v" : FLE2RangeFindDriverSpec } @@ -1376,9 +1372,7 @@ def _parse_version(version): bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len); /** - * Set options for explicit encryption with the "rangePreview" algorithm. - * NOTE: The RangePreview algorithm is experimental only. It is not intended for - * public use. + * Set options for explicit encryption with the "range" algorithm. * * @p opts is a BSON document of the form: * { @@ -1398,8 +1392,6 @@ def _parse_version(version): bool mongocrypt_ctx_setopt_algorithm_range(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *opts); /// String constants for setopt_query_type -// NOTE: The RangePreview algorithm is experimental only. It is not intended for -// public use. """ ) diff --git a/bindings/python/pymongocrypt/options.py b/bindings/python/pymongocrypt/options.py index db638c626..0fe83e69c 100644 --- a/bindings/python/pymongocrypt/options.py +++ b/bindings/python/pymongocrypt/options.py @@ -163,7 +163,7 @@ def __init__( - `contention_factor` (int): The contention factor to use when the algorithm is "Indexed". - `range_opts` (bytes): Options for explicit encryption - with the "rangePreview" algorithm encoded as a BSON document. + with the "range" algorithm encoded as a BSON document. - `is_expression` (boolean): True if this is an encryptExpression() context. Defaults to False. diff --git a/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py b/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py index 404dd0175..f9095c5f0 100644 --- a/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py +++ b/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py @@ -111,7 +111,7 @@ def encrypt( - `contention_factor` (int): The contention factor to use when the algorithm is "Indexed". - `range_opts` (bytes): Options for explicit encryption - with the "rangePreview" algorithm encoded as a BSON document. + with the "range" algorithm encoded as a BSON document. - `is_expression` (boolean): True if this is an encryptExpression() context. Defaults to False. diff --git a/bindings/python/test/test_mongocrypt.py b/bindings/python/test/test_mongocrypt.py index 26e298e5f..28d17bb46 100644 --- a/bindings/python/test/test_mongocrypt.py +++ b/bindings/python/test/test_mongocrypt.py @@ -985,9 +985,9 @@ async def test_range_query_int32(self): ) encrypted = await encrypter.encrypt( value, - "rangePreview", + "range", key_id=key_id, - query_type="rangePreview", + query_type="range", contention_factor=4, range_opts=range_opts, is_expression=True, @@ -1384,9 +1384,9 @@ def test_range_query_int32(self): expected = json_data("fle2-find-range-explicit-v2/int32/encrypted-payload.json") encrypted = encrypter.encrypt( value, - "rangePreview", + "range", key_id=key_id, - query_type="rangePreview", + query_type="range", contention_factor=4, range_opts=range_opts, is_expression=True,