...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy/fle2v2-Compact.json

Documentation: go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "7.0.0",
     5      "topology": [
     6        "replicaset",
     7        "sharded",
     8        "load-balanced"
     9      ]
    10    }
    11  ],
    12  "database_name": "default",
    13  "collection_name": "default",
    14  "data": [],
    15  "encrypted_fields": {
    16    "fields": [
    17      {
    18        "keyId": {
    19          "$binary": {
    20            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    21            "subType": "04"
    22          }
    23        },
    24        "path": "encryptedIndexed",
    25        "bsonType": "string",
    26        "queries": {
    27          "queryType": "equality",
    28          "contention": {
    29            "$numberLong": "0"
    30          }
    31        }
    32      },
    33      {
    34        "keyId": {
    35          "$binary": {
    36            "base64": "q83vqxI0mHYSNBI0VniQEg==",
    37            "subType": "04"
    38          }
    39        },
    40        "path": "encryptedUnindexed",
    41        "bsonType": "string"
    42      }
    43    ]
    44  },
    45  "key_vault_data": [
    46    {
    47      "_id": {
    48        "$binary": {
    49          "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    50          "subType": "04"
    51        }
    52      },
    53      "keyMaterial": {
    54        "$binary": {
    55          "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
    56          "subType": "00"
    57        }
    58      },
    59      "creationDate": {
    60        "$date": {
    61          "$numberLong": "1648914851981"
    62        }
    63      },
    64      "updateDate": {
    65        "$date": {
    66          "$numberLong": "1648914851981"
    67        }
    68      },
    69      "status": {
    70        "$numberInt": "0"
    71      },
    72      "masterKey": {
    73        "provider": "local"
    74      }
    75    },
    76    {
    77      "_id": {
    78        "$binary": {
    79          "base64": "q83vqxI0mHYSNBI0VniQEg==",
    80          "subType": "04"
    81        }
    82      },
    83      "keyMaterial": {
    84        "$binary": {
    85          "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==",
    86          "subType": "00"
    87        }
    88      },
    89      "creationDate": {
    90        "$date": {
    91          "$numberLong": "1648914851981"
    92        }
    93      },
    94      "updateDate": {
    95        "$date": {
    96          "$numberLong": "1648914851981"
    97        }
    98      },
    99      "status": {
   100        "$numberInt": "0"
   101      },
   102      "masterKey": {
   103        "provider": "local"
   104      }
   105    }
   106  ],
   107  "tests": [
   108    {
   109      "description": "Compact works",
   110      "clientOptions": {
   111        "autoEncryptOpts": {
   112          "kmsProviders": {
   113            "local": {
   114              "key": {
   115                "$binary": {
   116                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
   117                  "subType": "00"
   118                }
   119              }
   120            }
   121          }
   122        }
   123      },
   124      "operations": [
   125        {
   126          "name": "runCommand",
   127          "object": "database",
   128          "command_name": "compactStructuredEncryptionData",
   129          "arguments": {
   130            "command": {
   131              "compactStructuredEncryptionData": "default"
   132            }
   133          }
   134        }
   135      ],
   136      "expectations": [
   137        {
   138          "command_started_event": {
   139            "command": {
   140              "listCollections": 1,
   141              "filter": {
   142                "name": "default"
   143              }
   144            },
   145            "command_name": "listCollections"
   146          }
   147        },
   148        {
   149          "command_started_event": {
   150            "command": {
   151              "find": "datakeys",
   152              "filter": {
   153                "$or": [
   154                  {
   155                    "_id": {
   156                      "$in": [
   157                        {
   158                          "$binary": {
   159                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   160                            "subType": "04"
   161                          }
   162                        },
   163                        {
   164                          "$binary": {
   165                            "base64": "q83vqxI0mHYSNBI0VniQEg==",
   166                            "subType": "04"
   167                          }
   168                        }
   169                      ]
   170                    }
   171                  },
   172                  {
   173                    "keyAltNames": {
   174                      "$in": []
   175                    }
   176                  }
   177                ]
   178              },
   179              "$db": "keyvault",
   180              "readConcern": {
   181                "level": "majority"
   182              }
   183            },
   184            "command_name": "find"
   185          }
   186        },
   187        {
   188          "command_started_event": {
   189            "command": {
   190              "compactStructuredEncryptionData": "default",
   191              "compactionTokens": {
   192                "encryptedIndexed": {
   193                  "$binary": {
   194                    "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=",
   195                    "subType": "00"
   196                  }
   197                },
   198                "encryptedUnindexed": {
   199                  "$binary": {
   200                    "base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=",
   201                    "subType": "00"
   202                  }
   203                }
   204              }
   205            },
   206            "command_name": "compactStructuredEncryptionData"
   207          }
   208        }
   209      ]
   210    },
   211    {
   212      "description": "Compact errors on an unencrypted client",
   213      "operations": [
   214        {
   215          "name": "runCommand",
   216          "object": "database",
   217          "command_name": "compactStructuredEncryptionData",
   218          "arguments": {
   219            "command": {
   220              "compactStructuredEncryptionData": "default"
   221            }
   222          },
   223          "result": {
   224            "errorContains": "'compactStructuredEncryptionData.compactionTokens' is missing"
   225          }
   226        }
   227      ]
   228    }
   229  ]
   230}

View as plain text