Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
description: QE-Text-cleanupStructuredEncryptionData
schemaVersion: "1.23"
runOnRequirements:
# Requires libmongocrypt 1.15.0 for SPM-4158.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think about making libmongocrypt version a runOnRequirement? This would be useful in Node and maybe other drivers who have bindings separate from their driver code. We actually do run our latest driver test suite against an older version of our bindings, so this would be necessary in Node (if it isn't codified into the UTR, we'll just have to skip it manually).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. Added a minLibmongocryptVersion constraint. I expect this can also benefit backporting tests to release branches using an older libmongocrypt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to adopt these changes in #1784. I added a comment to that PR about these UTR changes.

- minServerVersion: "8.2.0" # Server 8.2.0 adds preview support for QE text queries.
topologies: ["replicaset", "sharded", "load-balanced"] # QE does not support standalone.
csfle: true
createEntities:
- client:
id: &client "client"
autoEncryptOpts:
keyVaultNamespace: keyvault.datakeys
kmsProviders:
local:
key: Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk
observeEvents:
- commandStartedEvent
- database:
id: &db "db"
client: *client
databaseName: *db
- collection:
id: &coll "coll"
database: *db
collectionName: *coll
initialData:
# Insert data encryption key:
- databaseName: keyvault
collectionName: datakeys
documents:
[
{
"_id": &keyid { "$binary": { "base64": "q83vqxI0mHYSNBI0VniQEg==", "subType": "04" } },
"keyMaterial":
{
"$binary":
{
"base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==",
"subType": "00",
},
},
"creationDate": { "$date": { "$numberLong": "1648914851981" } },
"updateDate": { "$date": { "$numberLong": "1648914851981" } },
"status": { "$numberInt": "0" },
"masterKey": { "provider": "local" },
},
]
# Create encrypted collection:
- databaseName: *db
collectionName: *coll
documents: []
createOptions:
encryptedFields:
{
"fields":
[
{
"keyId": *keyid,
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "suffixPreview",
"contention": { "$numberLong": "0" },
"strMinQueryLength": { "$numberLong": "3" },
"strMaxQueryLength": { "$numberLong": "30" },
"caseSensitive": true,
"diacriticSensitive": true,
},
],
},
],
}
tests:
- description: "QE Text cleanupStructuredEncryptionData works"
operations:
- name: runCommand
object: *db
arguments:
command:
cleanupStructuredEncryptionData: *coll
commandName: cleanupStructuredEncryptionData
expectResult: { ok: 1 }
expectEvents:
- client: *client
events:
- commandStartedEvent:
command:
listCollections: 1
filter:
name: *coll
commandName: listCollections
- commandStartedEvent:
command:
find: datakeys
filter:
{
"$or":
[
"_id": { "$in": [ *keyid ] },
"keyAltNames": { "$in": [] },
],
}
$db: keyvault
readConcern: { level: "majority" }
commandName: find
- commandStartedEvent:
command:
{
"cleanupStructuredEncryptionData": *coll,
"cleanupTokens": {
"encryptedText": {
"ecoc": {
"$binary": {
"base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=",
"subType": "00"
}
},
"anchorPaddingToken": {
"$binary": {
"base64": "YAiF7Iwhqq1UyfxPvm70xfQJtrIRPrjfD2yRLG1+saQ=",
"subType": "00"
}
}
}
}
}
commandName: cleanupStructuredEncryptionData
Loading
Loading