File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,5 +27,4 @@ def register_routers():
27
27
Patch the ConnectionRouter with methods to get KMS credentials and provider
28
28
from the SchemaEditor.
29
29
"""
30
- ConnectionRouter .kms_credentials = ConnectionRouter ._router_func ("kms_credentials" )
31
30
ConnectionRouter .kms_provider = ConnectionRouter ._router_func ("kms_provider" )
Original file line number Diff line number Diff line change
1
+ from django .conf import settings
1
2
from django .db import router
2
3
from django .db .backends .base .schema import BaseDatabaseSchemaEditor
3
4
from django .db .models import Index , UniqueConstraint
@@ -447,7 +448,7 @@ def _create_collection(self, model):
447
448
# option is not inadvertently set to "default" somewhere
448
449
# which then causes the `master_key.copy` in libmongocrypt
449
450
# to fail.
450
- credentials = router . kms_credentials ( model ) if provider != "local" else None
451
+ credentials = settings . DATABASES [ db ]. KMS_CREDENTIALS if provider != "local" else None
451
452
ce .create_encrypted_collection (
452
453
db ,
453
454
table ,
Original file line number Diff line number Diff line change @@ -33,3 +33,6 @@ Django settings
33
33
34
34
``KMS_PROVIDER ``
35
35
----------------
36
+
37
+ DATABASES["encrypted"]["KMS_CREDENTIALS"]
38
+ -----------------------------------------
You can’t perform that action at this time.
0 commit comments