...

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

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

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.1.10"
     5    }
     6  ],
     7  "database_name": "default",
     8  "collection_name": "default",
     9  "data": [],
    10  "json_schema": {
    11    "properties": {
    12      "encrypted_w_altname": {
    13        "encrypt": {
    14          "keyId": "/altname",
    15          "bsonType": "string",
    16          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
    17        }
    18      },
    19      "encrypted_string": {
    20        "encrypt": {
    21          "keyId": [
    22            {
    23              "$binary": {
    24                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    25                "subType": "04"
    26              }
    27            }
    28          ],
    29          "bsonType": "string",
    30          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
    31        }
    32      },
    33      "random": {
    34        "encrypt": {
    35          "keyId": [
    36            {
    37              "$binary": {
    38                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    39                "subType": "04"
    40              }
    41            }
    42          ],
    43          "bsonType": "string",
    44          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
    45        }
    46      },
    47      "encrypted_string_equivalent": {
    48        "encrypt": {
    49          "keyId": [
    50            {
    51              "$binary": {
    52                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    53                "subType": "04"
    54              }
    55            }
    56          ],
    57          "bsonType": "string",
    58          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
    59        }
    60      }
    61    },
    62    "bsonType": "object"
    63  },
    64  "key_vault_data": [
    65    {
    66      "status": 1,
    67      "_id": {
    68        "$binary": {
    69          "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    70          "subType": "04"
    71        }
    72      },
    73      "masterKey": {
    74        "provider": "aws",
    75        "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
    76        "region": "us-east-1"
    77      },
    78      "updateDate": {
    79        "$date": {
    80          "$numberLong": "1552949630483"
    81        }
    82      },
    83      "keyMaterial": {
    84        "$binary": {
    85          "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO",
    86          "subType": "00"
    87        }
    88      },
    89      "creationDate": {
    90        "$date": {
    91          "$numberLong": "1552949630483"
    92        }
    93      },
    94      "keyAltNames": [
    95        "altname",
    96        "another_altname"
    97      ]
    98    }
    99  ],
   100  "tests": [
   101    {
   102      "description": "Bulk write with encryption",
   103      "clientOptions": {
   104        "autoEncryptOpts": {
   105          "kmsProviders": {
   106            "aws": {}
   107          }
   108        }
   109      },
   110      "operations": [
   111        {
   112          "name": "bulkWrite",
   113          "arguments": {
   114            "requests": [
   115              {
   116                "name": "insertOne",
   117                "arguments": {
   118                  "document": {
   119                    "_id": 1,
   120                    "encrypted_string": "string0",
   121                    "random": "abc"
   122                  }
   123                }
   124              },
   125              {
   126                "name": "insertOne",
   127                "arguments": {
   128                  "document": {
   129                    "_id": 2,
   130                    "encrypted_string": "string1"
   131                  }
   132                }
   133              },
   134              {
   135                "name": "updateOne",
   136                "arguments": {
   137                  "filter": {
   138                    "encrypted_string": "string0"
   139                  },
   140                  "update": {
   141                    "$set": {
   142                      "encrypted_string": "string1"
   143                    }
   144                  }
   145                }
   146              },
   147              {
   148                "name": "deleteOne",
   149                "arguments": {
   150                  "filter": {
   151                    "$and": [
   152                      {
   153                        "encrypted_string": "string1"
   154                      },
   155                      {
   156                        "_id": 2
   157                      }
   158                    ]
   159                  }
   160                }
   161              }
   162            ],
   163            "options": {
   164              "ordered": true
   165            }
   166          }
   167        }
   168      ],
   169      "expectations": [
   170        {
   171          "command_started_event": {
   172            "command": {
   173              "listCollections": 1,
   174              "filter": {
   175                "name": "default"
   176              }
   177            },
   178            "command_name": "listCollections"
   179          }
   180        },
   181        {
   182          "command_started_event": {
   183            "command": {
   184              "find": "datakeys",
   185              "filter": {
   186                "$or": [
   187                  {
   188                    "_id": {
   189                      "$in": [
   190                        {
   191                          "$binary": {
   192                            "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
   193                            "subType": "04"
   194                          }
   195                        }
   196                      ]
   197                    }
   198                  },
   199                  {
   200                    "keyAltNames": {
   201                      "$in": []
   202                    }
   203                  }
   204                ]
   205              },
   206              "$db": "keyvault",
   207              "readConcern": {
   208                "level": "majority"
   209              }
   210            },
   211            "command_name": "find"
   212          }
   213        },
   214        {
   215          "command_started_event": {
   216            "command": {
   217              "insert": "default",
   218              "documents": [
   219                {
   220                  "_id": 1,
   221                  "encrypted_string": {
   222                    "$binary": {
   223                      "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
   224                      "subType": "06"
   225                    }
   226                  },
   227                  "random": {
   228                    "$$type": "binData"
   229                  }
   230                },
   231                {
   232                  "_id": 2,
   233                  "encrypted_string": {
   234                    "$binary": {
   235                      "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   236                      "subType": "06"
   237                    }
   238                  }
   239                }
   240              ],
   241              "ordered": true
   242            },
   243            "command_name": "insert"
   244          }
   245        },
   246        {
   247          "command_started_event": {
   248            "command": {
   249              "update": "default",
   250              "updates": [
   251                {
   252                  "q": {
   253                    "encrypted_string": {
   254                      "$eq": {
   255                        "$binary": {
   256                          "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
   257                          "subType": "06"
   258                        }
   259                      }
   260                    }
   261                  },
   262                  "u": {
   263                    "$set": {
   264                      "encrypted_string": {
   265                        "$binary": {
   266                          "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   267                          "subType": "06"
   268                        }
   269                      }
   270                    }
   271                  }
   272                }
   273              ],
   274              "ordered": true
   275            },
   276            "command_name": "update"
   277          }
   278        },
   279        {
   280          "command_started_event": {
   281            "command": {
   282              "delete": "default",
   283              "deletes": [
   284                {
   285                  "q": {
   286                    "$and": [
   287                      {
   288                        "encrypted_string": {
   289                          "$eq": {
   290                            "$binary": {
   291                              "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   292                              "subType": "06"
   293                            }
   294                          }
   295                        }
   296                      },
   297                      {
   298                        "_id": {
   299                          "$eq": 2
   300                        }
   301                      }
   302                    ]
   303                  },
   304                  "limit": 1
   305                }
   306              ],
   307              "ordered": true
   308            },
   309            "command_name": "delete"
   310          }
   311        }
   312      ],
   313      "outcome": {
   314        "collection": {
   315          "data": [
   316            {
   317              "_id": 1,
   318              "encrypted_string": {
   319                "$binary": {
   320                  "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   321                  "subType": "06"
   322                }
   323              },
   324              "random": {
   325                "$$type": "binData"
   326              }
   327            }
   328          ]
   329        }
   330      }
   331    }
   332  ]
   333}

View as plain text