From 8b1bc2ededc3f2ffe536c7232f755f8e83fe2448 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Mon, 4 Aug 2025 20:20:44 -0400 Subject: [PATCH 1/4] remove incorrect metadata collection names --- doc/examples/encryption.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/examples/encryption.rst b/doc/examples/encryption.rst index 338b177be3..fdb919f67e 100644 --- a/doc/examples/encryption.rst +++ b/doc/examples/encryption.rst @@ -670,8 +670,6 @@ as demonstrated by the following example: encrypted_fields_map = { "default.encryptedCollection": { - "escCollection": "encryptedCollection.esc", - "ecocCollection": "encryptedCollection.ecoc", "fields": [ { "path": "firstName", From fdaa7787de3b28411c31ff29fd06e1d0ee08a362 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Mon, 4 Aug 2025 20:21:08 -0400 Subject: [PATCH 2/4] remove unnecessary metadata collections --- doc/examples/encryption.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/examples/encryption.rst b/doc/examples/encryption.rst index fdb919f67e..f1fdb9d777 100644 --- a/doc/examples/encryption.rst +++ b/doc/examples/encryption.rst @@ -766,8 +766,6 @@ using an ``encrypted_fields`` mapping, as demonstrated by the following example: unindexed_key_id = client_encryption.create_data_key("local") encrypted_fields = { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", "fields": [ { "keyId": indexed_key_id, From ebf876614c32b11b5f68d37cf6d94c435d074434 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Mon, 4 Aug 2025 20:21:22 -0400 Subject: [PATCH 3/4] remove unnecessary imports --- doc/examples/encryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/encryption.rst b/doc/examples/encryption.rst index f1fdb9d777..004fee2835 100644 --- a/doc/examples/encryption.rst +++ b/doc/examples/encryption.rst @@ -647,7 +647,7 @@ as demonstrated by the following example: import os from bson.codec_options import CodecOptions from pymongo import MongoClient - from pymongo.encryption import Algorithm, ClientEncryption, QueryType + from pymongo.encryption import ClientEncryption from pymongo.encryption_options import AutoEncryptionOpts local_master_key = os.urandom(96) From a203f5c6ee7f87217d868b13d16ac706ddeb8f93 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Mon, 4 Aug 2025 20:24:26 -0400 Subject: [PATCH 4/4] remove incorrect tuple wrapping fixes error: ``` ValueError: kms_providers must be a dict ``` --- doc/examples/encryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/encryption.rst b/doc/examples/encryption.rst index 004fee2835..4b3de8d8d0 100644 --- a/doc/examples/encryption.rst +++ b/doc/examples/encryption.rst @@ -614,7 +614,7 @@ An application using Azure credentials would look like, this time using from pymongo.encryption_options import AutoEncryptionOpts # The empty dictionary enables on-demand credentials. - kms_providers = ({"azure": {}},) + kms_providers = {"azure": {}} key_vault_namespace = "keyvault.datakeys" auto_encryption_opts = AutoEncryptionOpts(kms_providers, key_vault_namespace) client = MongoClient(auto_encryption_opts=auto_encryption_opts)