...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-jsonSchema.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  "json_schema": {
    16    "properties": {},
    17    "bsonType": "object"
    18  },
    19  "encrypted_fields": {
    20    "fields": [
    21      {
    22        "keyId": {
    23          "$binary": {
    24            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    25            "subType": "04"
    26          }
    27        },
    28        "path": "encryptedIndexed",
    29        "bsonType": "string",
    30        "queries": {
    31          "queryType": "equality",
    32          "contention": {
    33            "$numberLong": "0"
    34          }
    35        }
    36      },
    37      {
    38        "keyId": {
    39          "$binary": {
    40            "base64": "q83vqxI0mHYSNBI0VniQEg==",
    41            "subType": "04"
    42          }
    43        },
    44        "path": "encryptedUnindexed",
    45        "bsonType": "string"
    46      }
    47    ]
    48  },
    49  "key_vault_data": [
    50    {
    51      "_id": {
    52        "$binary": {
    53          "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    54          "subType": "04"
    55        }
    56      },
    57      "keyMaterial": {
    58        "$binary": {
    59          "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
    60          "subType": "00"
    61        }
    62      },
    63      "creationDate": {
    64        "$date": {
    65          "$numberLong": "1648914851981"
    66        }
    67      },
    68      "updateDate": {
    69        "$date": {
    70          "$numberLong": "1648914851981"
    71        }
    72      },
    73      "status": {
    74        "$numberInt": "0"
    75      },
    76      "masterKey": {
    77        "provider": "local"
    78      }
    79    }
    80  ],
    81  "tests": [
    82    {
    83      "description": "encryptedFields is preferred over jsonSchema",
    84      "clientOptions": {
    85        "autoEncryptOpts": {
    86          "kmsProviders": {
    87            "local": {
    88              "key": {
    89                "$binary": {
    90                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
    91                  "subType": "00"
    92                }
    93              }
    94            }
    95          }
    96        }
    97      },
    98      "operations": [
    99        {
   100          "name": "insertOne",
   101          "arguments": {
   102            "document": {
   103              "_id": 1,
   104              "encryptedIndexed": "123"
   105            }
   106          }
   107        },
   108        {
   109          "name": "find",
   110          "arguments": {
   111            "filter": {
   112              "encryptedIndexed": "123"
   113            }
   114          },
   115          "result": [
   116            {
   117              "_id": 1,
   118              "encryptedIndexed": "123"
   119            }
   120          ]
   121        }
   122      ],
   123      "expectations": [
   124        {
   125          "command_started_event": {
   126            "command": {
   127              "listCollections": 1,
   128              "filter": {
   129                "name": "default"
   130              }
   131            },
   132            "command_name": "listCollections"
   133          }
   134        },
   135        {
   136          "command_started_event": {
   137            "command": {
   138              "find": "datakeys",
   139              "filter": {
   140                "$or": [
   141                  {
   142                    "_id": {
   143                      "$in": [
   144                        {
   145                          "$binary": {
   146                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   147                            "subType": "04"
   148                          }
   149                        }
   150                      ]
   151                    }
   152                  },
   153                  {
   154                    "keyAltNames": {
   155                      "$in": []
   156                    }
   157                  }
   158                ]
   159              },
   160              "$db": "keyvault",
   161              "readConcern": {
   162                "level": "majority"
   163              }
   164            },
   165            "command_name": "find"
   166          }
   167        },
   168        {
   169          "command_started_event": {
   170            "command": {
   171              "insert": "default",
   172              "documents": [
   173                {
   174                  "_id": 1,
   175                  "encryptedIndexed": {
   176                    "$$type": "binData"
   177                  }
   178                }
   179              ],
   180              "ordered": true,
   181              "encryptionInformation": {
   182                "type": 1,
   183                "schema": {
   184                  "default.default": {
   185                    "escCollection": "enxcol_.default.esc",
   186                    "ecocCollection": "enxcol_.default.ecoc",
   187                    "fields": [
   188                      {
   189                        "keyId": {
   190                          "$binary": {
   191                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   192                            "subType": "04"
   193                          }
   194                        },
   195                        "path": "encryptedIndexed",
   196                        "bsonType": "string",
   197                        "queries": {
   198                          "queryType": "equality",
   199                          "contention": {
   200                            "$numberLong": "0"
   201                          }
   202                        }
   203                      },
   204                      {
   205                        "keyId": {
   206                          "$binary": {
   207                            "base64": "q83vqxI0mHYSNBI0VniQEg==",
   208                            "subType": "04"
   209                          }
   210                        },
   211                        "path": "encryptedUnindexed",
   212                        "bsonType": "string"
   213                      }
   214                    ]
   215                  }
   216                }
   217              }
   218            },
   219            "command_name": "insert"
   220          }
   221        },
   222        {
   223          "command_started_event": {
   224            "command": {
   225              "find": "default",
   226              "filter": {
   227                "encryptedIndexed": {
   228                  "$eq": {
   229                    "$binary": {
   230                      "base64": "DIkAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVsACAAAAAApJtKPW4+o9B7gAynNLL26jtlB4+hq5TXResijcYet8USY20AAAAAAAAAAAAA",
   231                      "subType": "06"
   232                    }
   233                  }
   234                }
   235              },
   236              "encryptionInformation": {
   237                "type": 1,
   238                "schema": {
   239                  "default.default": {
   240                    "escCollection": "enxcol_.default.esc",
   241                    "ecocCollection": "enxcol_.default.ecoc",
   242                    "fields": [
   243                      {
   244                        "keyId": {
   245                          "$binary": {
   246                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   247                            "subType": "04"
   248                          }
   249                        },
   250                        "path": "encryptedIndexed",
   251                        "bsonType": "string",
   252                        "queries": {
   253                          "queryType": "equality",
   254                          "contention": {
   255                            "$numberLong": "0"
   256                          }
   257                        }
   258                      },
   259                      {
   260                        "keyId": {
   261                          "$binary": {
   262                            "base64": "q83vqxI0mHYSNBI0VniQEg==",
   263                            "subType": "04"
   264                          }
   265                        },
   266                        "path": "encryptedUnindexed",
   267                        "bsonType": "string"
   268                      }
   269                    ]
   270                  }
   271                }
   272              }
   273            },
   274            "command_name": "find"
   275          }
   276        }
   277      ],
   278      "outcome": {
   279        "collection": {
   280          "data": [
   281            {
   282              "_id": 1,
   283              "encryptedIndexed": {
   284                "$$type": "binData"
   285              },
   286              "__safeContent__": [
   287                {
   288                  "$binary": {
   289                    "base64": "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=",
   290                    "subType": "00"
   291                  }
   292                }
   293              ]
   294            }
   295          ]
   296        }
   297      }
   298    }
   299  ]
   300}

View as plain text