-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-2888 Support QE with Client.bulkWrite #1770
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
mdb-ad
wants to merge
18
commits into
mongodb:master
Choose a base branch
from
mdb-ad:bulkwrite-qe
base: master
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.
+457
−15
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c6f645d
add qe to unified tests
mdb-ad aa51fc3
move encryptedFields to initialData
mdb-ad fe8ed1c
Apply suggestions from code review
mdb-ad 44d883c
poc test feedback
mdb-ad ad2fd55
make keyVaultNamespace required
mdb-ad 573aac1
remaining auto encrypt options
mdb-ad 112d5bd
simple schema for schemaMap and encryptedFieldsMap
mdb-ad f910f65
convert localSchema.yml
mdb-ad 364eb4c
convert fle2v2-EncryptedFields-vs-EncryptedFieldsMap
mdb-ad 01505fc
document auto encrypt fields
mdb-ad 87d3c41
client bulkWrite test
mdb-ad 7f4021a
Merge branch 'master' into bulkwrite-qe
mdb-ad bd7a0fc
keyvault namespace
mdb-ad b2893e7
use unencrypted client to check collection contents
mdb-ad 28b2ced
remove bulkWrite QE error
mdb-ad 6415c1a
add csfle requirement to test
mdb-ad a388a7e
bulkWrite prose tests
mdb-ad 148ed07
errorContains in test
mdb-ad 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,128 @@ | ||
description: client bulkWrite with queryable encryption | ||
|
||
schemaVersion: "1.23" | ||
|
||
runOnRequirements: | ||
- minServerVersion: "8.0" | ||
serverless: forbid # Serverless does not support bulkWrite: CLOUDP-256344. | ||
mdb-ad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
csfle: true | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
observeEvents: | ||
- commandStartedEvent | ||
- commandSucceededEvent | ||
autoEncryptOpts: | ||
keyVaultNamespace: keyvault.datakeys | ||
kmsProviders: | ||
local: | ||
key: Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name crud-tests | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
- client: | ||
id: &client1 client1 | ||
observeEvents: | ||
- commandStartedEvent | ||
- database: | ||
id: &database1 database1 | ||
client: *client0 | ||
databaseName: &database1Name keyvault | ||
- collection: | ||
id: &collection1 collection1 | ||
database: *database0 | ||
collectionName: &collection1Name datakeys | ||
- database: | ||
id: &database2 database2 | ||
client: *client1 | ||
databaseName: &database0Name crud-tests | ||
- collection: | ||
id: &collection2 collection2 | ||
database: *database2 | ||
collectionName: &collection0Name coll0 | ||
|
||
|
||
initialData: | ||
- databaseName: *database1Name | ||
collectionName: *collection1Name | ||
documents: | ||
- _id: &local_key_id { $binary: { base64: EjRWeBI0mHYSNBI0VniQEg==, subType: "04" } } | ||
keyAltNames: ["local_key"] | ||
keyMaterial: { $binary: { base64: sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==, subType: "00" } } | ||
creationDate: { $date: { $numberLong: "1641024000000" } } | ||
updateDate: { $date: { $numberLong: "1641024000000" } } | ||
status: 1 | ||
masterKey: &local_masterkey | ||
provider: local | ||
- databaseName: *database0Name | ||
collectionName: *collection0Name | ||
documents: [] | ||
createOptions: | ||
encryptedFields: &encrypted_fields {'fields': [{'keyId': {'$binary': {'base64': 'EjRWeBI0mHYSNBI0VniQEg==', 'subType': '04'}}, 'path': 'encryptedInt', 'bsonType': 'int', 'queries': {'queryType': 'equality', 'contention': {'$numberLong': '0'}}}]} | ||
|
||
_yamlAnchors: | ||
namespace: &namespace "crud-tests.coll0" | ||
|
||
tests: | ||
- description: client bulkWrite QE replaceOne | ||
operations: | ||
- object: *collection0 | ||
name: insertMany | ||
arguments: | ||
documents: | ||
- { _id: 1, encryptedInt: 11 } | ||
- { _id: 2, encryptedInt: 22 } | ||
- { _id: 3, encryptedInt: 33 } | ||
- object: *client0 | ||
name: clientBulkWrite | ||
arguments: | ||
models: | ||
- replaceOne: | ||
namespace: *namespace | ||
filter: { encryptedInt: { $eq: 11 } } | ||
replacement: { encryptedInt: 44 } | ||
expectResult: | ||
insertedCount: 0 | ||
upsertedCount: 0 | ||
matchedCount: 1 | ||
modifiedCount: 1 | ||
deletedCount: 0 | ||
- object: *collection0 | ||
name: find | ||
arguments: | ||
filter: { encryptedInt: 44 } | ||
expectResult: | ||
- _id: 1 | ||
encryptedInt: 44 | ||
- object: *collection2 | ||
name: find | ||
arguments: | ||
filter: {} | ||
expectResult: | ||
- { _id: 1, encryptedInt: { $$type: binData }, __safeContent__: { $$type: array} } | ||
mdb-ad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- { _id: 2, encryptedInt: { $$type: binData }, __safeContent__: { $$type: array} } | ||
- { _id: 3, encryptedInt: { $$type: binData }, __safeContent__: { $$type: array} } | ||
- description: client bulkWrite QE with multiple replace fails | ||
operations: | ||
- object: *client0 | ||
name: clientBulkWrite | ||
arguments: | ||
models: | ||
- replaceOne: | ||
namespace: *namespace | ||
filter: { encryptedInt: { $eq: 11 } } | ||
replacement: { encryptedInt: 44 } | ||
- replaceOne: | ||
namespace: *namespace | ||
filter: { encryptedInt: { $eq: 22 } } | ||
replacement: { encryptedInt: 44 } | ||
expectError: | ||
# Expect error from mongocryptd or crypt_shared | ||
isError: true | ||
mdb-ad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
errorContains: "Only insert is supported in BulkWrite with multiple operations and Queryable Encryption" |
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.