Skip to content

Commit 45b809e

Browse files
authored
Mention crypt_shared in encryption examples pages and fix formatting (#1088)
1 parent 3d3ffaf commit 45b809e

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

doc/examples/encryption.rst

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ encrypted data.
1919
.. seealso:: The MongoDB documentation on `Client Side Field Level Encryption <https://dochub.mongodb.org/core/client-side-field-level-encryption>`_.
2020

2121
Dependencies
22-
------------
22+
~~~~~~~~~~~~
2323

2424
To get started using client-side field level encryption in your project,
2525
you will need to install the
@@ -34,8 +34,30 @@ support. For more information about installing pymongocrypt see
3434
`the installation instructions on the project's PyPI page
3535
<https://pypi.org/project/pymongocrypt/>`_.
3636

37+
Additionally, either `crypt_shared`_ or `mongocryptd`_ are required in order
38+
to use *automatic* client-side encryption.
39+
40+
crypt_shared
41+
````````````
42+
43+
The Automatic Encryption Shared Library (crypt_shared) provides the same
44+
functionality as `mongocryptd`_, but does not require you to spawn another
45+
process to perform automatic encryption.
46+
47+
By default, pymongo attempts to load crypt_shared from the system and if
48+
found uses it automatically. To load crypt_shared from another location,
49+
use the ``crypt_shared_lib_path`` argument to
50+
:class:`~pymongo.encryption_options.AutoEncryptionOpts`.
51+
If pymongo cannot load crypt_shared it will attempt to fallback to using
52+
`mongocryptd`_ by default. Set ``crypt_shared_lib_required=True`` to make
53+
the app always use crypt_shared and fail if it could not be loaded.
54+
55+
For detailed installation instructions see
56+
`the MongoDB documentation on Automatic Encryption Shared Library
57+
<https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/shared-library>`_.
58+
3759
mongocryptd
38-
-----------
60+
```````````
3961

4062
The ``mongocryptd`` binary is required for automatic client-side encryption
4163
and is included as a component in the `MongoDB Enterprise Server package
@@ -341,19 +363,13 @@ data key and create a collection with the
341363
Automatic Queryable Encryption (Beta)
342364
`````````````````````````````````````
343365

344-
PyMongo 4.2 brings beta support for Queryable Encryption with MongoDB 6.0.
366+
PyMongo 4.2 brings beta support for Queryable Encryption with MongoDB >=6.0.
345367

346368
Queryable Encryption is the second version of Client-Side Field Level Encryption.
347369
Data is encrypted client-side. Queryable Encryption supports indexed encrypted fields,
348370
which are further processed server-side.
349371

350-
You must have MongoDB 6.0rc8+ Enterprise to preview the capability.
351-
352-
Until PyMongo 4.2 release is finalized, it can be installed using::
353-
354-
pip install "pymongo@git+ssh://git@github.com/mongodb/mongo-python-driver.git@4.2.0b0#egg=pymongo[encryption]"
355-
356-
Additionally, ``libmongocrypt`` must be installed from `source <https://github.com/mongodb/libmongocrypt/blob/master/bindings/python/README.rst#installing-from-source>`_.
372+
You must have MongoDB 6.0 Enterprise to preview the capability.
357373

358374
Automatic encryption in Queryable Encryption is configured with an ``encrypted_fields`` mapping, as demonstrated by the following example::
359375

@@ -412,20 +428,12 @@ automatically encrypted and decrypted.
412428
Explicit Queryable Encryption (Beta)
413429
````````````````````````````````````
414430

415-
PyMongo 4.2 brings beta support for Queryable Encryption with MongoDB 6.0.
431+
PyMongo 4.2 brings beta support for Queryable Encryption with MongoDB >=6.0.
416432

417433
Queryable Encryption is the second version of Client-Side Field Level Encryption.
418434
Data is encrypted client-side. Queryable Encryption supports indexed encrypted fields,
419435
which are further processed server-side.
420436

421-
You must have MongoDB 6.0rc8+ to preview the capability.
422-
423-
Until PyMongo 4.2 release is finalized, it can be installed using::
424-
425-
pip install "pymongo@git+ssh://git@github.com/mongodb/mongo-python-driver.git@4.2.0b0#egg=pymongo[encryption]"
426-
427-
Additionally, ``libmongocrypt`` must be installed from `source <https://github.com/mongodb/libmongocrypt/blob/master/bindings/python/README.rst#installing-from-source>`_.
428-
429437
Explicit encryption in Queryable Encryption is performed using the ``encrypt`` and ``decrypt``
430438
methods. Automatic encryption (to allow the ``find_one`` to automatically decrypt) is configured
431439
using an ``encrypted_fields`` mapping, as demonstrated by the following example::

0 commit comments

Comments
 (0)