Skip to content

Commit 863d264

Browse files
committed
Combine crypt shared w/installation & db setup
Move crypt shared installation instructions to "Installation" section and crypt shared configuration steps to "Configuring the DATABASES setting" section.
1 parent c770364 commit 863d264

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

docs/howto/queryable-encryption.rst

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@ Installation
2323

2424
In addition to Django MongoDB Backend's regular :doc:`installation
2525
</intro/install>` and :doc:`configuration </intro/configure>` steps, Queryable
26-
Encryption has additional Python dependencies:
26+
Encryption requires installing optional Python dependencies and the
27+
:ref:`manual:csfle-reference-install-shared-lib`.
28+
29+
To install the optional dependencies, use pip with the ``encryption`` extra:
2730

2831
.. code-block:: console
2932
3033
$ pip install django-mongodb-backend[encryption]
3134
35+
Next, :ref:`download the shared library
36+
<manual:qe-csfle-shared-library-download>`. You can choose the latest version,
37+
even if it doesn't match your MongoDB server version. After extracting the
38+
shared library archive, :ref:`configure your Django settings
39+
<qe-configuring-databases-setting>` with the path to the shared library.
40+
3241
.. _qe-configuring-databases-setting:
3342

3443
Configuring the ``DATABASES`` setting
@@ -69,8 +78,11 @@ Here's a sample configuration using a local KMS provider::
6978
b'\x97\xea\xf8\x1e\xc3\xd49K\x18\x81\xc3\x1a"'
7079
b'\xdc\x00U\xc4u"X\xe7xy\xa5\xb2\x0e\xbc\xd6+-'
7180
b'\x80\x03\xef\xc2\xc4\x9bU'
81+
)
7282
},
7383
},
84+
crypt_shared_lib_path="/path/to/mongo_crypt_shared_v1.dylib",
85+
crypt_shared_lib_required=True,
7486
)
7587
},
7688
},
@@ -81,39 +93,13 @@ The database name of the key vault must be the same as in ``"NAME"``. The
8193
vault's collection name can be whatever you wish, but by convention, it's often
8294
``__keyVault``.
8395

84-
Configuring the Automatic Encryption Shared Library
85-
===================================================
86-
87-
Next, you'll need to configure the :ref:`manual:qe-reference-shared-library`.
88-
89-
First, :ref:`download the shared library
90-
<manual:qe-csfle-shared-library-download>`. You can choose the latest version,
91-
even if it doesn't match your MongoDB server version.
92-
93-
After extracting the shared library archive, configure your Django settings to
94-
point to the shared library. For example, on macOS, the name of the shared
95-
library is ``mongo_crypt_shared_v1.dylib``::
96-
97-
DATABASES = {
98-
# ...
99-
"encrypted": {
100-
# ...
101-
"OPTIONS": {
102-
"auto_encryption_opts": AutoEncryptionOpts(
103-
# ...
104-
crypt_shared_lib_path="/path/to/mongo_crypt_shared_v1.dylib",
105-
crypt_shared_lib_required=True,
106-
),
107-
},
108-
},
109-
}
11096

11197
.. admonition:: Dynamic library path configuration
11298

11399
If you encounter ``Pymongocrypt.errors.MongoCryptError: An existing
114100
crypt_shared library is loaded by the application at
115101
[/path/to/mongo_crypt_v1.so], but the current call to mongocrypt_init()
116-
failed to find that same library.``, you probably need to configure an
102+
failed to find that same library.``, you may need to configure an
117103
environment variable so that your system can locate the library:
118104

119105
+---------------+---------------------------------+

0 commit comments

Comments
 (0)