Skip to content

Commit 07508d9

Browse files
committed
[wip] updates to field docs
1 parent bd8605e commit 07508d9

File tree

1 file changed

+45
-70
lines changed

1 file changed

+45
-70
lines changed

docs/ref/models/encrypted-fields.rst

Lines changed: 45 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -12,80 +12,55 @@ Queryable Encryption with Django MongoDB Backend.
1212
See the :doc:`/topics/queryable-encryption` topic guide for
1313
more information on developing applications with Queryable Encryption.
1414

15-
The following Django fields are supported by Django MongoDB Backend for use with
16-
Queryable Encryption.
17-
18-
+----------------------------------------+------------------------------------------------------+
19-
| Encrypted Field | Django Field |
20-
+========================================+======================================================+
21-
| ``EncryptedBigIntegerField`` | :class:`~django.db.models.BigIntegerField` |
22-
+----------------------------------------+------------------------------------------------------+
23-
| ``EncryptedBinaryField`` | :class:`~django.db.models.BinaryField` |
24-
+----------------------------------------+------------------------------------------------------+
25-
| ``EncryptedBooleanField`` | :class:`~django.db.models.BooleanField` |
26-
+----------------------------------------+------------------------------------------------------+
27-
| ``EncryptedCharField`` | :class:`~django.db.models.CharField` |
28-
+----------------------------------------+------------------------------------------------------+
29-
| ``EncryptedDateField`` | :class:`~django.db.models.DateField` |
30-
+----------------------------------------+------------------------------------------------------+
31-
| ``EncryptedDateTimeField`` | :class:`~django.db.models.DateTimeField` |
32-
+----------------------------------------+------------------------------------------------------+
33-
| ``EncryptedDecimalField`` | :class:`~django.db.models.DecimalField` |
34-
+----------------------------------------+------------------------------------------------------+
35-
| ``EncryptedDurationField`` | :class:`~django.db.models.DurationField` |
36-
+----------------------------------------+------------------------------------------------------+
37-
| ``EncryptedFloatField`` | :class:`~django.db.models.FloatField` |
38-
+----------------------------------------+------------------------------------------------------+
39-
| ``EncryptedGenericIPAddressField`` | :class:`~django.db.models.GenericIPAddressField` |
40-
+----------------------------------------+------------------------------------------------------+
41-
| ``EncryptedIntegerField`` | :class:`~django.db.models.IntegerField` |
42-
+----------------------------------------+------------------------------------------------------+
43-
| ``EncryptedPositiveIntegerField`` | :class:`~django.db.models.PositiveIntegerField` |
44-
+----------------------------------------+------------------------------------------------------+
45-
| ``EncryptedPositiveBigIntegerField`` | :class:`~django.db.models.PositiveBigIntegerField` |
46-
+----------------------------------------+------------------------------------------------------+
47-
| ``EncryptedPositiveSmallIntegerField`` | :class:`~django.db.models.PositiveSmallIntegerField` |
48-
+----------------------------------------+------------------------------------------------------+
49-
| ``EncryptedSmallIntegerField`` | :class:`~django.db.models.SmallIntegerField` |
50-
+----------------------------------------+------------------------------------------------------+
51-
| ``EncryptedTextField`` | :class:`~django.db.models.TextField` |
52-
+----------------------------------------+------------------------------------------------------+
53-
| ``EncryptedTimeField`` | :class:`~django.db.models.TimeField` |
54-
+----------------------------------------+------------------------------------------------------+
55-
| ``EncryptedURLField`` | :class:`~django.db.models.URLField` |
56-
+----------------------------------------+------------------------------------------------------+
57-
| ``EncryptedUUIDField`` | :class:`~django.db.models.UUIDField` |
58-
+----------------------------------------+------------------------------------------------------+
59-
60-
The following MongoDB-specific fields are supported by Django MongoDB Backend
61-
for use with Queryable Encryption.
62-
63-
+----------------------------------------+------------------------------------------------------+
64-
| Encrypted Field | MongoDB Field |
65-
+----------------------------------------+------------------------------------------------------+
66-
| ``EncryptedArrayField`` | :class:`~.fields.ArrayField` |
67-
+----------------------------------------+------------------------------------------------------+
68-
| ``EncryptedEmbeddedModelArrayField`` | :class:`~.fields.EmbeddedModelArrayField` |
69-
+----------------------------------------+------------------------------------------------------+
70-
| ``EncryptedEmbeddedModelField`` | :class:`~.fields.EmbeddedModelField` |
71-
+----------------------------------------+------------------------------------------------------+
72-
| ``EncryptedObjectIdField`` | :class:`~.fields.ObjectIdField` |
73-
+----------------------------------------+------------------------------------------------------+
74-
75-
These fields don't support the ``queries`` argument::
15+
The following tables detailed which fields have encrypted counterparts. In all
16+
cases, the encrypted field names are simply prefixed with ``Encrypted``, e.g.
17+
``EncryptedCharField``. They are importable from
18+
``django_mongodb_backend.fields``.
19+
20+
.. csv-table:: ``django.db.models``
21+
:header: "Model Field", "Encrypted version available?"
22+
23+
:class:`~django.db.models.BigIntegerField`, Yes
24+
:class:`~django.db.models.BinaryField`, Yes
25+
:class:`~django.db.models.BooleanField`, Yes
26+
:class:`~django.db.models.CharField`, Yes
27+
:class:`~django.db.models.DateField`, Yes
28+
:class:`~django.db.models.DateTimeField`, Yes
29+
:class:`~django.db.models.DecimalField`, Yes
30+
:class:`~django.db.models.DurationField`, Yes
31+
:class:`~django.db.models.EmailField`, Yes
32+
:class:`~django.db.models.FileField`, No: the use case for encrypting this field is unclear.
33+
:class:`~django.db.models.FilePathField`, No: the use case for encrypting this field is unclear.
34+
:class:`~django.db.models.GenericIPAddressField`, Yes
35+
:class:`~django.db.models.ImageField`, No: the use case for encrypting this field is unclear.
36+
:class:`~django.db.models.IntegerField`, Yes
37+
:class:`~django.db.models.JSONField`, No: ``JSONField`` isn't recommended.
38+
:class:`~django.db.models.PositiveIntegerField`, Yes
39+
:class:`~django.db.models.PositiveBigIntegerField`, Yes
40+
:class:`~django.db.models.PositiveSmallIntegerField`, Yes
41+
:class:`~django.db.models.SlugField`, No: it requires a unique index which Queryable Encryption doesn't support.
42+
:class:`~django.db.models.SmallIntegerField`, Yes
43+
:class:`~django.db.models.TimeField`, Yes
44+
:class:`~django.db.models.TextField`, Yes
45+
:class:`~django.db.models.URLField`, Yes
46+
:class:`~django.db.models.UUIDField`, Yes
47+
48+
.. csv-table:: ``django_mongodb_backend.fields``
49+
:header: "Model Field", "Encrypted version available?"
50+
51+
:class:`~.fields.ArrayField`, Yes
52+
:class:`~.fields.EmbeddedModelArrayField`, Yes
53+
:class:`~.fields.EmbeddedModelField`, Yes
54+
:class:`~.fields.ObjectIdField`, Yes
55+
:class:`~.fields.PolymorphicEmbeddedModelField`, No: may be implemented in the future.
56+
:class:`~.fields.PolymorphicEmbeddedModelArrayField`, No: may be implemented in the future.
57+
58+
These fields don't support the ``queries`` argument:
59+
7660
- ``EncryptedArrayField``
7761
- ``EncryptedEmbeddedModelArrayField``
7862
- ``EncryptedEmbeddedModelField``
7963

80-
The following fields are supported by Django MongoDB Backend but not supported
81-
by Queryable Encryption.
82-
83-
+--------------------------------------+--------------------------------------------------------------------------------------------------------------------+
84-
| Field | Limitation |
85-
+--------------------------------------+--------------------------------------------------------------------------------------------------------------------+
86-
| :class:`~django.db.models.SlugField` | :ref:`Queryable Encryption does not support TTL Indexes or Unique Indexes <manual:qe-reference-encryption-limits>` |
87-
+--------------------------------------+--------------------------------------------------------------------------------------------------------------------+
88-
8964
Limitations
9065
===========
9166

0 commit comments

Comments
 (0)