|
| 1 | +# Requires libmongocrypt 1.10.1. |
| 2 | +runOn: |
| 3 | + - minServerVersion: "8.0.0" # Require range v2 support on server. |
| 4 | + # FLE 2 Encrypted collections are not supported on standalone. |
| 5 | + topology: [ "replicaset", "sharded", "load-balanced" ] |
| 6 | +database_name: "default" |
| 7 | +collection_name: &collection_name "default" |
| 8 | +data: [] |
| 9 | +encrypted_fields: &encrypted_fields {{ yamlfile("range-encryptedFields-Int.json") }} |
| 10 | +key_vault_data: [ {{ yamlfile("keys/key1-document.json") }} ] |
| 11 | +tests: |
| 12 | + - description: "Compact works with 'range' fields" |
| 13 | + clientOptions: |
| 14 | + autoEncryptOpts: |
| 15 | + kmsProviders: |
| 16 | + local: {{ local_provider() }} |
| 17 | + operations: |
| 18 | + # Insert before running compact to ensure the server errors if `encryptionInformation` is incorrectly omitted. |
| 19 | + - name: insertOne |
| 20 | + arguments: |
| 21 | + document: { _id: 0, encryptedInt: { $numberInt: "0" } } |
| 22 | + - name: runCommand |
| 23 | + object: database |
| 24 | + command_name: compactStructuredEncryptionData |
| 25 | + arguments: |
| 26 | + command: |
| 27 | + compactStructuredEncryptionData: *collection_name |
| 28 | + result: |
| 29 | + ok: 1 |
| 30 | + expectations: |
| 31 | + - command_started_event: |
| 32 | + command: |
| 33 | + listCollections: 1 |
| 34 | + filter: |
| 35 | + name: *collection_name |
| 36 | + command_name: listCollections |
| 37 | + - command_started_event: |
| 38 | + command: |
| 39 | + find: datakeys |
| 40 | + filter: { |
| 41 | + "$or": [ |
| 42 | + { |
| 43 | + "_id": { |
| 44 | + "$in": [ |
| 45 | + {{ yamlfile("keys/key1-id.json") }} |
| 46 | + ] |
| 47 | + } |
| 48 | + }, |
| 49 | + { |
| 50 | + "keyAltNames": { |
| 51 | + "$in": [] |
| 52 | + } |
| 53 | + } |
| 54 | + ] |
| 55 | + } |
| 56 | + $db: keyvault |
| 57 | + readConcern: { level: "majority" } |
| 58 | + command_name: find |
| 59 | + - command_started_event: |
| 60 | + command: |
| 61 | + insert: *collection_name |
| 62 | + documents: |
| 63 | + - { "_id": 0, "encryptedInt": { $$type: "binData" } } |
| 64 | + ordered: true |
| 65 | + encryptionInformation: &encryptionInformation |
| 66 | + type: 1 |
| 67 | + schema: |
| 68 | + default.default: |
| 69 | + # libmongocrypt applies escCollection and ecocCollection to outgoing command. |
| 70 | + escCollection: "enxcol_.default.esc" |
| 71 | + ecocCollection: "enxcol_.default.ecoc" |
| 72 | + <<: *encrypted_fields |
| 73 | + command_name: insert |
| 74 | + - command_started_event: |
| 75 | + command: |
| 76 | + compactStructuredEncryptionData: *collection_name |
| 77 | + compactionTokens: |
| 78 | + "encryptedInt": { |
| 79 | + "ecoc": { |
| 80 | + "$binary": { |
| 81 | + "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=", |
| 82 | + "subType": "00" |
| 83 | + } |
| 84 | + }, |
| 85 | + "anchorPaddingToken": { |
| 86 | + "$binary": { |
| 87 | + "base64": "QxKJD2If48p0l8NAXf2Kr0aleMd/dATSjBK6hTpNMyc=", |
| 88 | + "subType": "00" |
| 89 | + } |
| 90 | + } |
| 91 | + } |
| 92 | + encryptionInformation: *encryptionInformation |
| 93 | + command_name: compactStructuredEncryptionData |
0 commit comments