Skip to content

Commit 008b889

Browse files
authored
PYTHON-4206 - QE Range Protocol V2 (#828)
1 parent dfa0430 commit 008b889

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

bindings/python/CHANGELOG.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
Changelog
22
=========
33

4-
Changes in Version 2.0.0
4+
Changes in Version 1.10.0
55
------------------------
66

77
- Add Python async support.
88
- Drop support for Python 3.7 and PyPy 3.8. Python >=3.8 or PyPy >=3.9 is now required.
9+
- Add support for range-based Queryable Encryption with the new "range"
10+
algorithm on MongoDB 8.0+. This replaces the experimental "rangePreview" algorithm.
11+
912

1013
Changes in Version 1.9.2
1114
------------------------

bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def encrypt(
111111
- `contention_factor` (int): The contention factor to use
112112
when the algorithm is "Indexed".
113113
- `range_opts` (bytes): Options for explicit encryption
114-
with the "rangePreview" algorithm encoded as a BSON document.
114+
with the "range" algorithm encoded as a BSON document.
115115
- `is_expression` (boolean): True if this is an encryptExpression()
116116
context. Defaults to False.
117117

bindings/python/pymongocrypt/binding.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,7 @@ def _parse_version(version):
653653
/// String constant for setopt_algorithm "Random" encryption
654654
/// String constant for setopt_algorithm "Indexed" explicit encryption
655655
/// String constant for setopt_algorithm "Unindexed" explicit encryption
656-
/// String constant for setopt_algorithm "rangePreview" explicit encryption
657-
/// NOTE: The RangePreview algorithm is experimental only. It is not intended
658-
/// for public use.
656+
/// String constant for setopt_algorithm "Range" explicit encryption
659657
660658
/**
661659
* Identify the AWS KMS master key to use for creating a data key.
@@ -837,9 +835,7 @@ def _parse_version(version):
837835
/**
838836
* Explicit helper method to encrypt a Match Expression or Aggregate Expression.
839837
* Contexts created for explicit encryption will not go through mongocryptd.
840-
* Requires query_type to be "rangePreview".
841-
* NOTE: The RangePreview algorithm is experimental only. It is not intended for
842-
* public use.
838+
* Requires query_type to be "range".
843839
*
844840
* This method expects the passed-in BSON to be of the form:
845841
* { "v" : FLE2RangeFindDriverSpec }
@@ -1376,9 +1372,7 @@ def _parse_version(version):
13761372
bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len);
13771373
13781374
/**
1379-
* Set options for explicit encryption with the "rangePreview" algorithm.
1380-
* NOTE: The RangePreview algorithm is experimental only. It is not intended for
1381-
* public use.
1375+
* Set options for explicit encryption with the "range" algorithm.
13821376
*
13831377
* @p opts is a BSON document of the form:
13841378
* {
@@ -1398,8 +1392,6 @@ def _parse_version(version):
13981392
bool mongocrypt_ctx_setopt_algorithm_range(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *opts);
13991393
14001394
/// String constants for setopt_query_type
1401-
// NOTE: The RangePreview algorithm is experimental only. It is not intended for
1402-
// public use.
14031395
"""
14041396
)
14051397

bindings/python/pymongocrypt/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def __init__(
163163
- `contention_factor` (int): The contention factor to use
164164
when the algorithm is "Indexed".
165165
- `range_opts` (bytes): Options for explicit encryption
166-
with the "rangePreview" algorithm encoded as a BSON document.
166+
with the "range" algorithm encoded as a BSON document.
167167
- `is_expression` (boolean): True if this is an encryptExpression()
168168
context. Defaults to False.
169169

bindings/python/pymongocrypt/synchronous/explicit_encrypter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def encrypt(
111111
- `contention_factor` (int): The contention factor to use
112112
when the algorithm is "Indexed".
113113
- `range_opts` (bytes): Options for explicit encryption
114-
with the "rangePreview" algorithm encoded as a BSON document.
114+
with the "range" algorithm encoded as a BSON document.
115115
- `is_expression` (boolean): True if this is an encryptExpression()
116116
context. Defaults to False.
117117

bindings/python/test/test_mongocrypt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,9 @@ async def test_range_query_int32(self):
985985
)
986986
encrypted = await encrypter.encrypt(
987987
value,
988-
"rangePreview",
988+
"range",
989989
key_id=key_id,
990-
query_type="rangePreview",
990+
query_type="range",
991991
contention_factor=4,
992992
range_opts=range_opts,
993993
is_expression=True,
@@ -1384,9 +1384,9 @@ def test_range_query_int32(self):
13841384
expected = json_data("fle2-find-range-explicit-v2/int32/encrypted-payload.json")
13851385
encrypted = encrypter.encrypt(
13861386
value,
1387-
"rangePreview",
1387+
"range",
13881388
key_id=key_id,
1389-
query_type="rangePreview",
1389+
query_type="range",
13901390
contention_factor=4,
13911391
range_opts=range_opts,
13921392
is_expression=True,

0 commit comments

Comments
 (0)