|
| 1 | +{ |
| 2 | + "description": "QE-Text-cleanupStructuredEncryptionData", |
| 3 | + "schemaVersion": "1.23", |
| 4 | + "runOnRequirements": [ |
| 5 | + { |
| 6 | + "minServerVersion": "8.2.0", |
| 7 | + "topologies": [ |
| 8 | + "replicaset", |
| 9 | + "sharded", |
| 10 | + "load-balanced" |
| 11 | + ], |
| 12 | + "serverParameters": { |
| 13 | + "featureFlagQETextSearchPreview": { |
| 14 | + "$$matchAsRoot": { |
| 15 | + "currentlyEnabled": true |
| 16 | + } |
| 17 | + } |
| 18 | + } |
| 19 | + } |
| 20 | + ], |
| 21 | + "createEntities": [ |
| 22 | + { |
| 23 | + "client": { |
| 24 | + "id": "client", |
| 25 | + "autoEncryptOpts": { |
| 26 | + "keyVaultNamespace": "keyvault.datakeys", |
| 27 | + "kmsProviders": { |
| 28 | + "local": { |
| 29 | + "key": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk" |
| 30 | + } |
| 31 | + } |
| 32 | + }, |
| 33 | + "observeEvents": [ |
| 34 | + "commandStartedEvent" |
| 35 | + ] |
| 36 | + } |
| 37 | + }, |
| 38 | + { |
| 39 | + "database": { |
| 40 | + "id": "db", |
| 41 | + "client": "client", |
| 42 | + "databaseName": "db" |
| 43 | + } |
| 44 | + }, |
| 45 | + { |
| 46 | + "collection": { |
| 47 | + "id": "coll", |
| 48 | + "database": "db", |
| 49 | + "collectionName": "coll" |
| 50 | + } |
| 51 | + } |
| 52 | + ], |
| 53 | + "initialData": [ |
| 54 | + { |
| 55 | + "databaseName": "db", |
| 56 | + "collectionName": "coll", |
| 57 | + "documents": [], |
| 58 | + "createOptions": { |
| 59 | + "encryptedFields": { |
| 60 | + "fields": [ |
| 61 | + { |
| 62 | + "keyId": { |
| 63 | + "$binary": { |
| 64 | + "base64": "q83vqxI0mHYSNBI0VniQEg==", |
| 65 | + "subType": "04" |
| 66 | + } |
| 67 | + }, |
| 68 | + "path": "encryptedText", |
| 69 | + "bsonType": "string", |
| 70 | + "queries": [ |
| 71 | + { |
| 72 | + "queryType": "prefixPreview", |
| 73 | + "contention": { |
| 74 | + "$numberLong": "0" |
| 75 | + }, |
| 76 | + "strMinQueryLength": { |
| 77 | + "$numberLong": "3" |
| 78 | + }, |
| 79 | + "strMaxQueryLength": { |
| 80 | + "$numberLong": "30" |
| 81 | + }, |
| 82 | + "caseSensitive": true, |
| 83 | + "diacriticSensitive": true |
| 84 | + } |
| 85 | + ] |
| 86 | + } |
| 87 | + ] |
| 88 | + } |
| 89 | + } |
| 90 | + }, |
| 91 | + { |
| 92 | + "databaseName": "keyvault", |
| 93 | + "collectionName": "datakeys", |
| 94 | + "documents": [ |
| 95 | + { |
| 96 | + "_id": { |
| 97 | + "$binary": { |
| 98 | + "base64": "q83vqxI0mHYSNBI0VniQEg==", |
| 99 | + "subType": "04" |
| 100 | + } |
| 101 | + }, |
| 102 | + "keyMaterial": { |
| 103 | + "$binary": { |
| 104 | + "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", |
| 105 | + "subType": "00" |
| 106 | + } |
| 107 | + }, |
| 108 | + "creationDate": { |
| 109 | + "$date": { |
| 110 | + "$numberLong": "1648914851981" |
| 111 | + } |
| 112 | + }, |
| 113 | + "updateDate": { |
| 114 | + "$date": { |
| 115 | + "$numberLong": "1648914851981" |
| 116 | + } |
| 117 | + }, |
| 118 | + "status": { |
| 119 | + "$numberInt": "0" |
| 120 | + }, |
| 121 | + "masterKey": { |
| 122 | + "provider": "local" |
| 123 | + } |
| 124 | + } |
| 125 | + ] |
| 126 | + } |
| 127 | + ], |
| 128 | + "tests": [ |
| 129 | + { |
| 130 | + "description": "QE Text cleanupStructuredEncryptionData works", |
| 131 | + "operations": [ |
| 132 | + { |
| 133 | + "name": "runCommand", |
| 134 | + "object": "db", |
| 135 | + "arguments": { |
| 136 | + "command": { |
| 137 | + "cleanupStructuredEncryptionData": "coll" |
| 138 | + }, |
| 139 | + "commandName": "cleanupStructuredEncryptionData" |
| 140 | + }, |
| 141 | + "expectResult": { |
| 142 | + "ok": 1 |
| 143 | + } |
| 144 | + } |
| 145 | + ], |
| 146 | + "expectEvents": [ |
| 147 | + { |
| 148 | + "client": "client", |
| 149 | + "events": [ |
| 150 | + { |
| 151 | + "commandStartedEvent": { |
| 152 | + "command": { |
| 153 | + "listCollections": 1, |
| 154 | + "filter": { |
| 155 | + "name": "coll" |
| 156 | + } |
| 157 | + }, |
| 158 | + "commandName": "listCollections" |
| 159 | + } |
| 160 | + }, |
| 161 | + { |
| 162 | + "commandStartedEvent": { |
| 163 | + "command": { |
| 164 | + "find": "datakeys", |
| 165 | + "filter": { |
| 166 | + "$or": [ |
| 167 | + { |
| 168 | + "_id": { |
| 169 | + "$in": [ |
| 170 | + { |
| 171 | + "$binary": { |
| 172 | + "base64": "q83vqxI0mHYSNBI0VniQEg==", |
| 173 | + "subType": "04" |
| 174 | + } |
| 175 | + } |
| 176 | + ] |
| 177 | + } |
| 178 | + }, |
| 179 | + { |
| 180 | + "keyAltNames": { |
| 181 | + "$in": [] |
| 182 | + } |
| 183 | + } |
| 184 | + ] |
| 185 | + }, |
| 186 | + "$db": "keyvault", |
| 187 | + "readConcern": { |
| 188 | + "level": "majority" |
| 189 | + } |
| 190 | + }, |
| 191 | + "commandName": "find" |
| 192 | + } |
| 193 | + }, |
| 194 | + { |
| 195 | + "commandStartedEvent": { |
| 196 | + "command": { |
| 197 | + "cleanupStructuredEncryptionData": "coll", |
| 198 | + "cleanupTokens": { |
| 199 | + "encryptedText": { |
| 200 | + "ecoc": { |
| 201 | + "$binary": { |
| 202 | + "base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=", |
| 203 | + "subType": "00" |
| 204 | + } |
| 205 | + }, |
| 206 | + "anchorPaddingToken": { |
| 207 | + "$binary": { |
| 208 | + "base64": "YAiF7Iwhqq1UyfxPvm70xfQJtrIRPrjfD2yRLG1+saQ=", |
| 209 | + "subType": "00" |
| 210 | + } |
| 211 | + } |
| 212 | + } |
| 213 | + } |
| 214 | + }, |
| 215 | + "commandName": "cleanupStructuredEncryptionData" |
| 216 | + } |
| 217 | + } |
| 218 | + ] |
| 219 | + } |
| 220 | + ] |
| 221 | + } |
| 222 | + ] |
| 223 | +} |
0 commit comments