...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy/fle2v2-MissingKey.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    {
    16      "encryptedUnindexed": {
    17        "$binary": {
    18          "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==",
    19          "subType": "06"
    20        }
    21      }
    22    }
    23  ],
    24  "encrypted_fields": {
    25    "fields": [
    26      {
    27        "keyId": {
    28          "$binary": {
    29            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    30            "subType": "04"
    31          }
    32        },
    33        "path": "encryptedIndexed",
    34        "bsonType": "string",
    35        "queries": {
    36          "queryType": "equality",
    37          "contention": {
    38            "$numberLong": "0"
    39          }
    40        }
    41      },
    42      {
    43        "keyId": {
    44          "$binary": {
    45            "base64": "q83vqxI0mHYSNBI0VniQEg==",
    46            "subType": "04"
    47          }
    48        },
    49        "path": "encryptedUnindexed",
    50        "bsonType": "string"
    51      }
    52    ]
    53  },
    54  "key_vault_data": [],
    55  "tests": [
    56    {
    57      "description": "FLE2 encrypt fails with mising key",
    58      "clientOptions": {
    59        "autoEncryptOpts": {
    60          "kmsProviders": {
    61            "local": {
    62              "key": {
    63                "$binary": {
    64                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
    65                  "subType": "00"
    66                }
    67              }
    68            }
    69          }
    70        }
    71      },
    72      "operations": [
    73        {
    74          "name": "insertOne",
    75          "arguments": {
    76            "document": {
    77              "_id": 1,
    78              "encryptedIndexed": "123"
    79            }
    80          },
    81          "result": {
    82            "errorContains": "not all keys requested were satisfied"
    83          }
    84        }
    85      ]
    86    },
    87    {
    88      "description": "FLE2 decrypt fails with mising key",
    89      "clientOptions": {
    90        "autoEncryptOpts": {
    91          "kmsProviders": {
    92            "local": {
    93              "key": {
    94                "$binary": {
    95                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
    96                  "subType": "00"
    97                }
    98              }
    99            }
   100          }
   101        }
   102      },
   103      "operations": [
   104        {
   105          "name": "find",
   106          "arguments": {
   107            "filter": {}
   108          },
   109          "result": {
   110            "errorContains": "not all keys requested were satisfied"
   111          }
   112        }
   113      ]
   114    }
   115  ]
   116}

View as plain text