Skip to content

Commit e9a3021

Browse files
committed
INTPYTHON-451 Remove database caching support
This reverts commit 64b1c10.
1 parent b722252 commit e9a3021

File tree

15 files changed

+8
-1396
lines changed

15 files changed

+8
-1396
lines changed

django_mongodb_backend/cache.py

Lines changed: 0 additions & 216 deletions
This file was deleted.

django_mongodb_backend/creation.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
from django.conf import settings
22
from django.db.backends.base.creation import BaseDatabaseCreation
33

4-
from django_mongodb_backend.management.commands.createcachecollection import (
5-
Command as CreateCacheCollection,
6-
)
7-
84

95
class DatabaseCreation(BaseDatabaseCreation):
106
def _execute_create_test_db(self, cursor, parameters, keepdb=False):
@@ -20,12 +16,3 @@ def _destroy_test_db(self, test_database_name, verbosity):
2016
for collection in self.connection.introspection.table_names():
2117
if not collection.startswith("system."):
2218
self.connection.database.drop_collection(collection)
23-
24-
def create_test_db(self, *args, **kwargs):
25-
test_database_name = super().create_test_db(*args, **kwargs)
26-
# Not using call_command() avoids the requirement to put
27-
# "django_mongodb_backend" in INSTALLED_APPS.
28-
CreateCacheCollection().handle(
29-
database=self.connection.alias, verbosity=kwargs["verbosity"]
30-
)
31-
return test_database_name

django_mongodb_backend/management/__init__.py

Whitespace-only changes.

django_mongodb_backend/management/commands/__init__.py

Whitespace-only changes.

django_mongodb_backend/management/commands/createcachecollection.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

docs/source/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ Forms
4949

5050
- :doc:`ref/forms`
5151

52-
Core functionalities
53-
====================
54-
55-
- :doc:`topics/cache`
56-
5752
Miscellaneous
5853
=============
5954

docs/source/ref/django-admin.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/source/ref/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ API reference
77

88
models/index
99
forms
10-
django-admin
1110
utils

docs/source/releases/5.1.x.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Django MongoDB Backend 5.1.x
77

88
*Unreleased*
99

10+
- Backward-incompatible: Removed support for database caching as the MongoDB security
11+
team considers the cache backend's ``pickle`` encoding of cached values a
12+
vulnerability. If an attacker compromises the database, they could run arbitrary
13+
commands on the application server.
1014
- Fixed crash when loading models with a null value for ``ArrayField``\s where
1115
the ``base_field`` uses a database converter.
1216
- Fixed ``RecursionError`` when using ``Trunc`` database functions on non-MongoDB
@@ -39,7 +43,7 @@ Django MongoDB Backend 5.1.x
3943
:attr:`~.ArrayField.size` parameter is renamed to
4044
:attr:`~.ArrayField.max_size`. The :attr:`~.ArrayField.size` parameter is now
4145
used to enforce fixed-length arrays.
42-
- Added support for :doc:`database caching </topics/cache>`.
46+
- Added support for database caching (later removed in beta 4).
4347
- Fixed ``QuerySet.raw_aggregate()`` field initialization when the document key
4448
order doesn't match the order of the model's fields.
4549

0 commit comments

Comments
 (0)