...

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

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

     1# Requires libmongocrypt 1.8.0.
     2runOn:
     3  - minServerVersion: "7.0.0"
     4    # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
     5    # FLE 2 Encrypted collections are not supported on standalone.
     6    topology: [ "replicaset", "sharded", "load-balanced" ]
     7database_name: &database_name "default"
     8collection_name: &collection_name "default"
     9data: [
    10  &doc0 {
    11    "_id": 1,
    12    "encryptedUnindexed": {
    13      "$binary": {
    14          "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==",
    15          "subType": "06"
    16      }
    17    }
    18  }
    19]
    20key_vault_data: [ {'_id': {'$binary': {'base64': 'q83vqxI0mHYSNBI0VniQEg==', 'subType': '04'}}, 'keyMaterial': {'$binary': {'base64': 'HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==', 'subType': '00'}}, 'creationDate': {'$date': {'$numberLong': '1648914851981'}}, 'updateDate': {'$date': {'$numberLong': '1648914851981'}}, 'status': {'$numberInt': '0'}, 'masterKey': {'provider': 'local'}}]
    21tests:
    22  - description: "FLE2 decrypt of existing data succeeds"
    23    clientOptions:
    24      autoEncryptOpts:
    25        kmsProviders:
    26          local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}}
    27    operations:
    28      - name: find
    29        arguments:
    30          filter: { _id: 1 }
    31        result:
    32          [{ "_id": 1, "encryptedUnindexed": "value123" }]
    33    expectations:
    34      - command_started_event:
    35          command:
    36            listCollections: 1
    37            filter:
    38              name: *collection_name
    39          command_name: listCollections
    40      - command_started_event:
    41          command:
    42            find: *collection_name
    43            filter: { "_id": 1 }
    44          command_name: find
    45      - command_started_event:
    46          command:
    47            find: datakeys
    48            filter: {
    49                  "$or": [
    50                      {
    51                          "_id": {
    52                              "$in": [
    53                                  {'$binary': {'base64': 'q83vqxI0mHYSNBI0VniQEg==', 'subType': '04'}}
    54                              ]
    55                          }
    56                      },
    57                      {
    58                          "keyAltNames": {
    59                              "$in": []
    60                          }
    61                      }
    62                  ]
    63              }
    64            $db: keyvault
    65            readConcern: { level: "majority" }
    66          command_name: find

View as plain text