-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(shell-api): adds createEncryptedCollection on Database and ClientEncryption #1416
Merged
himanshusinghs
merged 13 commits into
main
from
MONGOSH-1316-automatically-create-encryption-keys
Feb 27, 2023
Merged
feat(shell-api): adds createEncryptedCollection on Database and ClientEncryption #1416
himanshusinghs
merged 13 commits into
main
from
MONGOSH-1316-automatically-create-encryption-keys
Feb 27, 2023
Conversation
This file contains 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
himanshusinghs
commented
Feb 23, 2023
himanshusinghs
commented
Feb 23, 2023
himanshusinghs
commented
Feb 23, 2023
himanshusinghs
commented
Feb 23, 2023
- moved encryptedCollection to ServiceProvider - no additional assertions
addaleax
reviewed
Feb 23, 2023
packages/service-provider-server/src/cli-service-provider.spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
…ithub.com:mongodb-js/mongosh into MONGOSH-1316-automatically-create-encryption-keys
…ithub.com:mongodb-js/mongosh into MONGOSH-1316-automatically-create-encryption-keys
addaleax
reviewed
Feb 24, 2023
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
addaleax
approved these changes
Feb 27, 2023
himanshusinghs
deleted the
MONGOSH-1316-automatically-create-encryption-keys
branch
February 27, 2023 10:33
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes
MONGOSH-1316
Description:
This PR exposes a helper method called
createEncryptedCollection
provided bylibmongocrypt
to create an encrypted collection without explicitly specifying the data encryption keys for every encrypted fields.The heavy lifting is already done by
libmongocrypt
and here we only provide an interface for users to interact with this functionality.Usage:
With this change, users will be able to create an encrypted collection using any of the following forms:
db.createEncryptedCollection(collectionName, createCollectionOptions)
, ordb.getMongo().getClientEncryption().createEncryptedCollection(dbName, collectionName, createCollectionOptions)
Assuming that the underlying connection was initiated with relevant FLE options.
Returns:
Originally
libmongocrypt's createEncryptedCollection
returns the native Collection object alongside a list of encrypted fields but here we augment the return type and instead we return the mongosh Collection object alongside the provided list of encrypted fields. This was done to make sure that users will be able to tail expected mongosh collection methods on the returned collection.