-
Notifications
You must be signed in to change notification settings - Fork 26
INTPYTHON-527 Add Queryable Encryption support #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aclark4life
wants to merge
17
commits into
mongodb:main
Choose a base branch
from
aclark4life:INTPYTHON-527
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,288
−152
Open
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b8b9b43
INTPYTHON-527 Add Queryable Encryption support
aclark4life 379537a
Code review fixes
aclark4life a21f86a
Update release notes & related docs
aclark4life 76a2b08
Code review fixes (1/x)
aclark4life 9a388bd
Code review fixes (2/x)
aclark4life b2a7f32
Code review fixes (3/x)
aclark4life e1c3e43
Code review fixes (4/x)
aclark4life 917e3a8
Code review fixes (5/x)
aclark4life 6afce5a
Code review fixes (6/x)
aclark4life a6aa8da
Code review fixes (7/7)
aclark4life 31b24f6
Fix encrypted tests crashing on non-encrypted builds
timgraham fcf8e5a
Update docs/source/howto/queryable-encryption.rst
aclark4life c74dc4f
Code review fixes (8/x)
aclark4life b1ca4c8
Update django_mongodb_backend/management/commands/showencryptedfields…
aclark4life cdc49c7
Update django_mongodb_backend/schema.py
aclark4life c1e2356
Update tests/encryption_/test_management.py
aclark4life 0997357
Update docs/source/howto/queryable-encryption.rst
aclark4life File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import os | ||
|
||
from mongodb_settings import * # noqa: F403 | ||
from pymongo.encryption import AutoEncryptionOpts | ||
|
||
DATABASES["encrypted"] = { # noqa: F405 | ||
"ENGINE": "django_mongodb_backend", | ||
"NAME": "djangotests-encrypted", | ||
"OPTIONS": { | ||
"auto_encryption_opts": AutoEncryptionOpts( | ||
key_vault_namespace="my_encrypted_database.keyvault", | ||
kms_providers={"local": {"key": os.urandom(96)}}, | ||
), | ||
"directConnection": True, | ||
}, | ||
"KMS_CREDENTIALS": {}, | ||
} | ||
|
||
|
||
class EncryptedRouter: | ||
def allow_migrate(self, db, app_label, model_name=None, **hints): | ||
# The encryption_ app's models are only created in the encrypted database. | ||
if app_label == "encryption_": | ||
return db == "encrypted" | ||
# Don't create other app's models in the encrypted database. | ||
if db == "encrypted": | ||
return False | ||
return None | ||
|
||
def kms_provider(self, model, **hints): | ||
return "local" | ||
|
||
|
||
DATABASE_ROUTERS = [EncryptedRouter()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.