Skip to content

Commit c74dc4f

Browse files
committed
Code review fixes (8/x)
- Removed all signs of client side vs. server side configuration of Queryable Encryption which can be too easily confused with client-side encryption, which is what Queryable Encryption is.
1 parent fcf8e5a commit c74dc4f

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

docs/source/howto/queryable-encryption.rst

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _configuring-queryable-encryption:
2+
13
================================
24
Configuring Queryable Encryption
35
================================
@@ -11,8 +13,6 @@ Configuring Queryable Encryption
1113
:ref:`This table <manual:qe-compatibility-reference>` shows which MongoDB
1214
server products support which Queryable Encryption mechanisms.
1315

14-
.. _server-side-queryable-encryption:
15-
1616
Configuring Queryable Encryption in Django is similar to
1717
:doc:`manual:core/queryable-encryption/quick-start` but with some additional
1818
steps required for Django.
@@ -23,20 +23,10 @@ Prerequisites
2323
In addition to :doc:`installing </intro/install>` and :doc:`configuring
2424
</intro/configure>` Django MongoDB Backend, you will need to install some
2525
additional packages to use Queryable Encryption. This can be done with the
26-
optional dependency ``encryption`` in the ``django-mongodb-backend`` package.
26+
optional dependency ``encryption`` in the ``django-mongodb-backend`` package::
2727

2828
pip install django-mongodb-backend[encryption]
2929

30-
.. _server-side-queryable-encryption-settings:
31-
32-
Server-side Queryable Encryption
33-
--------------------------------
34-
35-
Queryable Encryption is considered "server-side" when the encrypted fields map
36-
is not known at the time of connection to the database and this approach allows
37-
you to begin developing applications without needing to define the encrypted
38-
fields map at the time of connection to the database.
39-
4030
Settings
4131
--------
4232

@@ -88,9 +78,6 @@ Here's how to set it up in your Django settings::
8878

8979
DATABASE_ROUTERS = [EncryptedRouter()]
9080

91-
You are now ready to use server-side :doc:`Queryable Encryption
92-
</topics/queryable-encryption>`.
93-
9481
.. admonition:: KMS providers and credentials
9582

9683
The above example uses a local KMS provider with a randomly generated
@@ -105,21 +92,11 @@ You are now ready to use server-side :doc:`Queryable Encryption
10592
You can also refer to the `Python Queryable Encryption Tutorial
10693
<https://github.com/mongodb/docs/tree/adad2b1ae41ec81a6e5682842850030813adc1e5/source/includes/qe-tutorials/python>`_.
10794

108-
.. _client-side-queryable-encryption:
109-
110-
Client-side Queryable Encryption
111-
--------------------------------
112-
113-
Queryable Encryption is considered "client-side" when the encrypted fields map
114-
is known at the time of connection to the database. This approach can be used
115-
when you have finished development and you have a fixed set of encrypted fields
116-
that you want to use in your production environment.
117-
11895
Encrypted fields map
11996
~~~~~~~~~~~~~~~~~~~~
12097

12198
In addition to the :ref:`settings described in the how-to guide
122-
<server-side-queryable-encryption-settings>` you will need to provide a
99+
<queryable-encryption-settings>` you will need to provide a
123100
``encrypted_fields_map`` to the ``AutoEncryptionOpts``.
124101

125102
You can use the :djadmin:`showencryptedfieldsmap` management command to generate
@@ -145,14 +122,16 @@ facilitate Queryable Encryption operations.
145122
Settings
146123
~~~~~~~~
147124

148-
Now include the generated schema map in your Django settings::
125+
Now include the crypt shared library path and generated schema map in your
126+
Django settings::
149127

150128
151129
DATABASES["encrypted"] = {
152130
153131
"OPTIONS": {
154132
"auto_encryption_opts": AutoEncryptionOpts(
155133
134+
crypt_shared_lib_path="/path/to/mongo_crypt_v1",
156135
encrypted_fields_map = {
157136
"encryption__patientrecord": {
158137
"fields": [
@@ -172,5 +151,5 @@ Now include the generated schema map in your Django settings::
172151
173152
}
174153

175-
You are now ready to use client-side :doc:`Queryable Encryption
154+
You are now ready to use :doc:`Queryable Encryption
176155
</topics/queryable-encryption>`.

docs/source/ref/models/fields.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,13 @@ These indexes use 0-based indexing.
424424
.. _encrypted-fields:
425425

426426
Encrypted fields
427-
----------------
427+
================
428428

429429
.. versionadded:: 5.2.0b2
430430

431431
Encrypted fields are subclasses of Django's built-in fields and can be used to
432432
store sensitive data with MongoDB's :ref:`Queryable Encryption
433-
<server-side-queryable-encryption>` feature. They are subclasses of Django's
433+
<queryable-encryption>` feature. They are subclasses of Django's
434434
built-in fields before storing it in the database.
435435

436436
+----------------------------------------+------------------------------------------------------+
@@ -469,11 +469,14 @@ built-in fields before storing it in the database.
469469
| ``EncryptedURLField`` | :class:`~django.db.models.URLField` |
470470
+----------------------------------------+------------------------------------------------------+
471471

472-
.. class:: EncryptedFieldMixin
473-
474472
``EncryptedFieldMixin``
475473
-----------------------
476474

475+
.. class:: EncryptedFieldMixin
476+
477+
A mixin that can be used to create custom encrypted fields
478+
that support MongoDB's Queryable Encryption.
479+
477480
You can use the ``EncryptedFieldMixin`` to create your own encrypted fields. This mixin
478481
supports the use of a ``queries`` argument in the field definition to specify query type
479482
for the field::

docs/source/ref/settings.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,24 @@
22
Settings
33
========
44

5-
Core Settings
6-
=============
5+
.. _queryable-encryption-settings:
76

8-
Here's a list of settings available in Django MongoDB Backend and their default
9-
values.
7+
Queryable Encryption
8+
====================
9+
10+
The following :setting:`django:DATABASES` inner options have been added to
11+
support KMS configuration for Queryable Encryption.
12+
13+
.. setting:: DATABASE-KMS-PROVIDERS
14+
15+
``KMS_PROVIDERS``
16+
-----------------
17+
18+
Default: ``{}``
19+
20+
.. setting:: DATABASE-KMS-CREDENTIALS
21+
22+
``KMS_CREDENTIALS``
23+
-------------------
24+
25+
Default: ``{}``

docs/source/topics/queryable-encryption.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _queryable-encryption:
2+
13
====================
24
Queryable Encryption
35
====================

0 commit comments

Comments
 (0)