Skip to content

Commit 518a1bc

Browse files
committed
Code review fixes (1/x)
QE Doc flow - Three top level (or close to it) docs - How to guide on QE configuration - QE field guide (moved out of model field ref to its own section) - Topic guide on QE usage
1 parent 160f7a9 commit 518a1bc

File tree

6 files changed

+98
-91
lines changed

6 files changed

+98
-91
lines changed

docs/source/howto/queryable-encryption.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _configuring-queryable-encryption:
2-
31
================================
42
Configuring Queryable Encryption
53
================================

docs/source/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Having trouble? We’d like to help!
2323

2424
- Try the :doc:`faq` – it’s got answers to many common questions.
2525

26+
- The :doc:`howto/index` section has step-by-step guides for common tasks.
27+
2628
- Looking for specific information? Try the :ref:`genindex`, :ref:`modindex`,
2729
or the detailed :doc:`table of contents <contents>`.
2830

@@ -42,6 +44,7 @@ Models
4244
- :doc:`ref/models/indexes`
4345
- :doc:`ref/database`
4446
- :doc:`ref/contrib/gis`
47+
- :doc:`ref/queryable-encryption`
4548

4649
**Topic guides:**
4750

docs/source/ref/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ API reference
99
forms
1010
contrib/index
1111
database
12+
queryable-encryption
1213
django-admin
1314
utils
1415
settings

docs/source/ref/models/fields.rst

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -420,90 +420,3 @@ These indexes use 0-based indexing.
420420
.. admonition:: Forms are not supported
421421

422422
``PolymorphicEmbeddedModelArrayField``\s don't appear in model forms.
423-
424-
.. _encrypted-fields:
425-
426-
Encrypted fields
427-
================
428-
429-
.. versionadded:: 5.2.0b2
430-
431-
Encrypted fields are subclasses of Django's built-in fields and can be used to
432-
store sensitive data with MongoDB's :ref:`Queryable Encryption
433-
<queryable-encryption>` feature. They are subclasses of Django's
434-
built-in fields before storing it in the database.
435-
436-
+----------------------------------------+------------------------------------------------------+
437-
| Encrypted Field | Django Field |
438-
+========================================+======================================================+
439-
| ``EncryptedBigIntegerField`` | :class:`~django.db.models.BigIntegerField` |
440-
+----------------------------------------+------------------------------------------------------+
441-
| ``EncryptedBooleanField`` | :class:`~django.db.models.BooleanField` |
442-
+----------------------------------------+------------------------------------------------------+
443-
| ``EncryptedCharField`` | :class:`~django.db.models.CharField` |
444-
+----------------------------------------+------------------------------------------------------+
445-
| ``EncryptedDateField`` | :class:`~django.db.models.DateField` |
446-
+----------------------------------------+------------------------------------------------------+
447-
| ``EncryptedDateTimeField`` | :class:`~django.db.models.DateTimeField` |
448-
+----------------------------------------+------------------------------------------------------+
449-
| ``EncryptedDecimalField`` | :class:`~django.db.models.DecimalField` |
450-
+----------------------------------------+------------------------------------------------------+
451-
| ``EncryptedFloatField`` | :class:`~django.db.models.FloatField` |
452-
+----------------------------------------+------------------------------------------------------+
453-
| ``EncryptedGenericIPAddressField`` | :class:`~django.db.models.GenericIPAddressField` |
454-
+----------------------------------------+------------------------------------------------------+
455-
| ``EncryptedIntegerField`` | :class:`~django.db.models.IntegerField` |
456-
+----------------------------------------+------------------------------------------------------+
457-
| ``EncryptedPositiveBigIntegerField`` | :class:`~django.db.models.PositiveBigIntegerField` |
458-
+----------------------------------------+------------------------------------------------------+
459-
| ``EncryptedPositiveIntegerField`` | :class:`~django.db.models.PositiveIntegerField` |
460-
+----------------------------------------+------------------------------------------------------+
461-
| ``EncryptedPositiveSmallIntegerField`` | :class:`~django.db.models.PositiveSmallIntegerField` |
462-
+----------------------------------------+------------------------------------------------------+
463-
| ``EncryptedSmallIntegerField`` | :class:`~django.db.models.SmallIntegerField` |
464-
+----------------------------------------+------------------------------------------------------+
465-
| ``EncryptedTextField`` | :class:`~django.db.models.TextField` |
466-
+----------------------------------------+------------------------------------------------------+
467-
| ``EncryptedTimeField`` | :class:`~django.db.models.TimeField` |
468-
+----------------------------------------+------------------------------------------------------+
469-
| ``EncryptedURLField`` | :class:`~django.db.models.URLField` |
470-
+----------------------------------------+------------------------------------------------------+
471-
472-
``EncryptedFieldMixin``
473-
-----------------------
474-
475-
.. class:: EncryptedFieldMixin
476-
477-
A mixin that can be used to create custom encrypted fields
478-
that support MongoDB's Queryable Encryption.
479-
480-
You can use the ``EncryptedFieldMixin`` to create your own encrypted fields. This mixin
481-
supports the use of a ``queries`` argument in the field definition to specify query type
482-
for the field::
483-
484-
from django.db import models
485-
from django_mongodb_backend.fields import EncryptedFieldMixin
486-
from .models import MyField
487-
488-
489-
class MyEncryptedField(EncryptedFieldMixin, MyField):
490-
pass
491-
492-
493-
class MyModel(models.Model):
494-
my_encrypted_field = MyEncryptedField(
495-
queries={"queryType": "equality"},
496-
# Other field options...
497-
)
498-
499-
Unsupported fields
500-
------------------
501-
502-
The following fields are supported by Django MongoDB Backend but are not
503-
supported by Queryable Encryption.
504-
505-
+--------------------------------------+------------------------------------------------------------+
506-
| :class:`~django.db.models.SlugField` | Queryable Encryption does not :doc:`support unique indexes |
507-
| | on encrypted fields |
508-
| | <manual:core/queryable-encryption/reference/limitations>`. |
509-
+--------------------------------------+------------------------------------------------------------+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
====================
2+
Queryable Encryption
3+
====================
4+
5+
.. versionadded:: 5.2.0b2
6+
7+
Django MongoDB Backend supports Queryable Encryption for MongoDB.
8+
9+
Each model field stores encrypted data in the database.
10+
11+
.. _encrypted-fields:
12+
13+
Encrypted fields
14+
================
15+
16+
Encrypted fields are subclasses of Django's built-in fields and can be used to
17+
store sensitive data with MongoDB's :doc:`Queryable Encryption
18+
<queryable-encryption>` feature. They are subclasses of Django's built-in fields
19+
before storing it in the database.
20+
21+
+----------------------------------------+------------------------------------------------------+
22+
| Encrypted Field | Django Field |
23+
+========================================+======================================================+
24+
| ``EncryptedBigIntegerField`` | :class:`~django.db.models.BigIntegerField` |
25+
+----------------------------------------+------------------------------------------------------+
26+
| ``EncryptedBooleanField`` | :class:`~django.db.models.BooleanField` |
27+
+----------------------------------------+------------------------------------------------------+
28+
| ``EncryptedCharField`` | :class:`~django.db.models.CharField` |
29+
+----------------------------------------+------------------------------------------------------+
30+
| ``EncryptedDateField`` | :class:`~django.db.models.DateField` |
31+
+----------------------------------------+------------------------------------------------------+
32+
| ``EncryptedDateTimeField`` | :class:`~django.db.models.DateTimeField` |
33+
+----------------------------------------+------------------------------------------------------+
34+
| ``EncryptedDecimalField`` | :class:`~django.db.models.DecimalField` |
35+
+----------------------------------------+------------------------------------------------------+
36+
| ``EncryptedFloatField`` | :class:`~django.db.models.FloatField` |
37+
+----------------------------------------+------------------------------------------------------+
38+
| ``EncryptedGenericIPAddressField`` | :class:`~django.db.models.GenericIPAddressField` |
39+
+----------------------------------------+------------------------------------------------------+
40+
| ``EncryptedIntegerField`` | :class:`~django.db.models.IntegerField` |
41+
+----------------------------------------+------------------------------------------------------+
42+
| ``EncryptedPositiveBigIntegerField`` | :class:`~django.db.models.PositiveBigIntegerField` |
43+
+----------------------------------------+------------------------------------------------------+
44+
| ``EncryptedPositiveIntegerField`` | :class:`~django.db.models.PositiveIntegerField` |
45+
+----------------------------------------+------------------------------------------------------+
46+
| ``EncryptedPositiveSmallIntegerField`` | :class:`~django.db.models.PositiveSmallIntegerField` |
47+
+----------------------------------------+------------------------------------------------------+
48+
| ``EncryptedSmallIntegerField`` | :class:`~django.db.models.SmallIntegerField` |
49+
+----------------------------------------+------------------------------------------------------+
50+
| ``EncryptedTextField`` | :class:`~django.db.models.TextField` |
51+
+----------------------------------------+------------------------------------------------------+
52+
| ``EncryptedTimeField`` | :class:`~django.db.models.TimeField` |
53+
+----------------------------------------+------------------------------------------------------+
54+
| ``EncryptedURLField`` | :class:`~django.db.models.URLField` |
55+
+----------------------------------------+------------------------------------------------------+
56+
57+
``EncryptedFieldMixin``
58+
=======================
59+
60+
.. class:: EncryptedFieldMixin
61+
62+
A mixin that can be used to create custom encrypted fields
63+
that support MongoDB's Queryable Encryption.
64+
65+
You can use the ``EncryptedFieldMixin`` to create your own encrypted fields. This mixin
66+
supports the use of a ``queries`` argument in the field definition to specify query type
67+
for the field::
68+
69+
from django.db import models
70+
from django_mongodb_backend.fields import EncryptedFieldMixin
71+
from .models import MyField
72+
73+
74+
class MyEncryptedField(EncryptedFieldMixin, MyField):
75+
pass
76+
77+
78+
class MyModel(models.Model):
79+
my_encrypted_field = MyEncryptedField(
80+
queries={"queryType": "equality"},
81+
# Other field options...
82+
)
83+
84+
Unsupported fields
85+
==================
86+
87+
The following fields are supported by Django MongoDB Backend but are not
88+
supported by Queryable Encryption.
89+
90+
+--------------------------------------+------------------------------------------------------------+
91+
| :class:`~django.db.models.SlugField` | Queryable Encryption does not :doc:`support unique indexes |
92+
| | on encrypted fields |
93+
| | <manual:core/queryable-encryption/reference/limitations>`. |
94+
+--------------------------------------+------------------------------------------------------------+

docs/source/topics/queryable-encryption.rst

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

0 commit comments

Comments
 (0)