Skip to content

Fix In-Use Encryption examples #2457

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

Merged
merged 4 commits into from
Aug 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions doc/examples/encryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -670,8 +670,6 @@ as demonstrated by the following example:

encrypted_fields_map = {
"default.encryptedCollection": {
"escCollection": "encryptedCollection.esc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -768,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,
Expand Down
Loading