...

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

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

     1# Attempt to round trip some BSON types.
     2# Note: db pointer is excluded since it is deprecated and numberlong is excluded due to different driver interpretations of { $numberLong: '123' } in relaxed JSON parsing.
     3
     4runOn:
     5  - minServerVersion: "4.1.10"
     6database_name: &database_name "default"
     7collection_name: &collection_name "default"
     8
     9data: []
    10json_schema: {}
    11key_vault_data: [{'status': 1, '_id': {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}, 'masterKey': {'provider': 'aws', 'key': 'arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0', 'region': 'us-east-1'}, 'updateDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyMaterial': {'$binary': {'base64': 'AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO', 'subType': '00'}}, 'creationDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyAltNames': ['altname', 'another_altname']}]
    12
    13tests:
    14  - description: "type=objectId"
    15    clientOptions:
    16      autoEncryptOpts:
    17        schemaMap:
    18          "default.default": {'properties': {'encrypted_objectId': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'objectId', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
    19        kmsProviders:
    20          aws: {} # Credentials filled in from environment.
    21    operations:
    22      - name: insertOne
    23        arguments:
    24          document: &doc0 { _id: 1, encrypted_objectId: {"$oid": "AAAAAAAAAAAAAAAAAAAAAAAA"} }
    25      - name: findOne
    26        arguments:
    27          filter: { _id: 1 }
    28        result: *doc0
    29    expectations:
    30      # Then key is fetched from the key vault.
    31      - command_started_event:
    32          command:
    33            find: datakeys
    34            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
    35            $db: keyvault
    36            readConcern: { level: "majority" }
    37          command_name: find
    38      - command_started_event:
    39          command:
    40            insert: *collection_name
    41            documents:
    42              - &doc0_encrypted { _id: 1, encrypted_objectId: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAAHmkTPqvzfHMWpvS1mEsrjOxVQ2dyihEgIFWD5E0eNEsiMBQsC0GuvjdqYRL5DHLFI1vKuGek7EYYp0Qyii/tHqA==', 'subType': '06'}} }
    43            ordered: true
    44          command_name: insert
    45      - command_started_event:
    46          command:
    47            find: *collection_name
    48            filter: {_id: 1}
    49          command_name: find
    50    outcome:
    51      collection:
    52        # Outcome is checked using a separate MongoClient without auto encryption.
    53        data:
    54          - *doc0_encrypted
    55  - description: "type=symbol"
    56    clientOptions:
    57      autoEncryptOpts:
    58        schemaMap:
    59          "default.default": {'properties': {'encrypted_symbol': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'symbol', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
    60        kmsProviders:
    61          aws: {} # Credentials filled in from environment.
    62    operations:
    63      - name: insertOne
    64        arguments:
    65          document: &doc1 { _id: 1, encrypted_symbol: {"$symbol": "test"} }
    66      - name: findOne
    67        arguments:
    68          filter: { _id: 1 }
    69        result: *doc1
    70    expectations:
    71      # Then key is fetched from the key vault.
    72      - command_started_event:
    73          command:
    74            find: datakeys
    75            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
    76            $db: keyvault
    77            readConcern: { level: "majority" }
    78          command_name: find
    79      - command_started_event:
    80          command:
    81            insert: *collection_name
    82            documents:
    83              - &doc1_encrypted { _id: 1, encrypted_symbol: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAAOOmvDmWjcuKsSCO7U/7t9HJ8eI73B6wduyMbdkvn7n7V4uTJes/j+BTtneSdyG2JHKHGkevWAJSIU2XoO66BSXw==', 'subType': '06'}} }
    84            ordered: true
    85          command_name: insert
    86      - command_started_event:
    87          command:
    88            find: *collection_name
    89            filter: {_id: 1}
    90          command_name: find
    91    outcome:
    92      collection:
    93        # Outcome is checked using a separate MongoClient without auto encryption.
    94        data:
    95          - *doc1_encrypted
    96  - description: "type=int"
    97    clientOptions:
    98      autoEncryptOpts:
    99        schemaMap:
   100          "default.default": {'properties': {'encrypted_int': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'int', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   101        kmsProviders:
   102          aws: {} # Credentials filled in from environment.
   103    operations:
   104      - name: insertOne
   105        arguments:
   106          document: &doc2 { _id: 1, encrypted_int: {"$numberInt": "123"} }
   107      - name: findOne
   108        arguments:
   109          filter: { _id: 1 }
   110        result: *doc2
   111    expectations:
   112      # Then key is fetched from the key vault.
   113      - command_started_event:
   114          command:
   115            find: datakeys
   116            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   117            $db: keyvault
   118            readConcern: { level: "majority" }
   119          command_name: find
   120      - command_started_event:
   121          command:
   122            insert: *collection_name
   123            documents:
   124              - &doc2_encrypted { _id: 1, encrypted_int: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAAQPNXJVXMEjGZnftMuf2INKufXCtQIRHdw5wTgn6QYt3ejcoAXyiwI4XIUizkpsob494qpt2in4tWeiO7b9zkA8Q==', 'subType': '06'}} }
   125            ordered: true
   126          command_name: insert
   127      - command_started_event:
   128          command:
   129            find: *collection_name
   130            filter: {_id: 1}
   131          command_name: find
   132    outcome:
   133      collection:
   134        # Outcome is checked using a separate MongoClient without auto encryption.
   135        data:
   136          - *doc2_encrypted
   137  - description: "type=double"
   138    clientOptions:
   139      autoEncryptOpts:
   140        schemaMap:
   141          "default.default": {'properties': {'encrypted_double': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'double', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   142        kmsProviders:
   143          aws: {} # Credentials filled in from environment.
   144    operations:
   145      - name: insertOne
   146        arguments:
   147          document: &doc4 { _id: 1, encrypted_double: {"$numberDouble": "1.23"} }
   148        result:
   149            # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   150            # "Cannot use deterministic encryption for element of type: double"
   151            # After it is:
   152            # "Cannot encrypt element of type: double"
   153            # Only check for the common suffix.
   154            errorContains: "element of type: double"
   155  - description: "type=decimal"
   156    clientOptions:
   157      autoEncryptOpts:
   158        schemaMap:
   159          "default.default": {'properties': {'encrypted_decimal': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'decimal', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   160        kmsProviders:
   161          aws: {} # Credentials filled in from environment.
   162    operations:
   163      - name: insertOne
   164        arguments:
   165          document: &doc5 { _id: 1, encrypted_decimal: {"$numberDecimal": "1.23"} }
   166        result:
   167            # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   168            # "Cannot use deterministic encryption for element of type: decimal"
   169            # After it is:
   170            # "Cannot encrypt element of type: decimal"
   171            # Only check for the common suffix.
   172            errorContains: "element of type: decimal"
   173  - description: "type=binData"
   174    clientOptions:
   175      autoEncryptOpts:
   176        schemaMap:
   177          "default.default": {'properties': {'encrypted_binData': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'binData', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   178        kmsProviders:
   179          aws: {} # Credentials filled in from environment.
   180    operations:
   181      - name: insertOne
   182        arguments:
   183          document: &doc6 { _id: 1, encrypted_binData: {"$binary": { base64: "AAAA", subType: "00" } } }
   184      - name: findOne
   185        arguments:
   186          filter: { _id: 1 }
   187        result: *doc6
   188    expectations:
   189      # Then key is fetched from the key vault.
   190      - command_started_event:
   191          command:
   192            find: datakeys
   193            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   194            $db: keyvault
   195            readConcern: { level: "majority" }
   196          command_name: find
   197      - command_started_event:
   198          command:
   199            insert: *collection_name
   200            documents:
   201              - &doc6_encrypted { _id: 1, encrypted_binData: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAAFB/KHZQHaHHo8fctcl7v6kR+sLkJoTRx2cPSSck9ya+nbGROSeFhdhDRHaCzhV78fDEqnMDSVPNi+ZkbaIh46GQ==', 'subType': '06'}} }
   202            ordered: true
   203          command_name: insert
   204      - command_started_event:
   205          command:
   206            find: *collection_name
   207            filter: {_id: 1}
   208          command_name: find
   209    outcome:
   210      collection:
   211        # Outcome is checked using a separate MongoClient without auto encryption.
   212        data:
   213          - *doc6_encrypted
   214  - description: "type=javascript"
   215    clientOptions:
   216      autoEncryptOpts:
   217        schemaMap:
   218          "default.default": {'properties': {'encrypted_javascript': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'javascript', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   219        kmsProviders:
   220          aws: {} # Credentials filled in from environment.
   221    operations:
   222      - name: insertOne
   223        arguments:
   224          document: &doc7 { _id: 1, encrypted_javascript: {"$code": "var x = 1;" } }
   225      - name: findOne
   226        arguments:
   227          filter: { _id: 1 }
   228        result: *doc7
   229    expectations:
   230      # Then key is fetched from the key vault.
   231      - command_started_event:
   232          command:
   233            find: datakeys
   234            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   235            $db: keyvault
   236            readConcern: { level: "majority" }
   237          command_name: find
   238      - command_started_event:
   239          command:
   240            insert: *collection_name
   241            documents:
   242              - &doc7_encrypted { _id: 1, encrypted_javascript: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAANrvMgJkTKWGMc9wt3E2RBR2Hu5gL9p+vIIdHe9FcOm99t1W480/oX1Gnd87ON3B399DuFaxi/aaIiQSo7gTX6Lw==', 'subType': '06'}} }
   243            ordered: true
   244          command_name: insert
   245      - command_started_event:
   246          command:
   247            find: *collection_name
   248            filter: {_id: 1}
   249          command_name: find
   250    outcome:
   251      collection:
   252        # Outcome is checked using a separate MongoClient without auto encryption.
   253        data:
   254          - *doc7_encrypted
   255  - description: "type=javascriptWithScope"
   256    clientOptions:
   257      autoEncryptOpts:
   258        schemaMap:
   259          "default.default": {'properties': {'encrypted_javascriptWithScope': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'javascriptWithScope', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   260        kmsProviders:
   261          aws: {} # Credentials filled in from environment.
   262    operations:
   263      - name: insertOne
   264        arguments:
   265          document: &doc8 { _id: 1, encrypted_javascriptWithScope: {"$code": "var x = 1;", "$scope": {} } }
   266        result:
   267          # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   268          # "Cannot use deterministic encryption for element of type: javascriptWithScope"
   269          # After it is:
   270          # "Cannot encrypt element of type: javascriptWithScope"
   271          # Only check for the common suffix.
   272          errorContains: "element of type: javascriptWithScope"
   273  - description: "type=object"
   274    clientOptions:
   275      autoEncryptOpts:
   276        schemaMap:
   277          "default.default": {'properties': {'encrypted_object': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'object', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   278        kmsProviders:
   279          aws: {} # Credentials filled in from environment.
   280    operations:
   281      - name: insertOne
   282        arguments:
   283          document: &doc9 { _id: 1, encrypted_object: {} }
   284        result:
   285          # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   286          # "Cannot use deterministic encryption for element of type: object"
   287          # After it is:
   288          # "Cannot encrypt element of type: object"
   289          # Only check for the common suffix.
   290          errorContains: "element of type: object"
   291  - description: "type=timestamp"
   292    clientOptions:
   293      autoEncryptOpts:
   294        schemaMap:
   295          "default.default": {'properties': {'encrypted_timestamp': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'timestamp', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   296        kmsProviders:
   297          aws: {} # Credentials filled in from environment.
   298    operations:
   299      - name: insertOne
   300        arguments:
   301          document: &doc10 { _id: 1, encrypted_timestamp: {$timestamp: {t: 123, i: 456}} }
   302      - name: findOne
   303        arguments:
   304          filter: { _id: 1 }
   305        result: *doc10
   306    expectations:
   307      # Then key is fetched from the key vault.
   308      - command_started_event:
   309          command:
   310            find: datakeys
   311            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   312            $db: keyvault
   313            readConcern: { level: "majority" }
   314          command_name: find
   315      - command_started_event:
   316          command:
   317            insert: *collection_name
   318            documents:
   319              - &doc10_encrypted { _id: 1, encrypted_timestamp: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAARJHaM4Gq3MpDTdBasBsEolQaOmxJQU1wsZVaSFAOLpEh1QihDglXI95xemePFMKhg+KNpFg7lw1ChCs2Wn/c26Q==', 'subType': '06'}} }
   320            ordered: true
   321          command_name: insert
   322      - command_started_event:
   323          command:
   324            find: *collection_name
   325            filter: {_id: 1}
   326          command_name: find
   327    outcome:
   328      collection:
   329        # Outcome is checked using a separate MongoClient without auto encryption.
   330        data:
   331          - *doc10_encrypted
   332  - description: "type=regex"
   333    clientOptions:
   334      autoEncryptOpts:
   335        schemaMap:
   336          "default.default": {'properties': {'encrypted_regex': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'regex', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   337        kmsProviders:
   338          aws: {} # Credentials filled in from environment.
   339    operations:
   340      - name: insertOne
   341        arguments:
   342          document: &doc11 { _id: 1, encrypted_regex: {$regularExpression: { pattern: "test", options: ""}} }
   343      - name: findOne
   344        arguments:
   345          filter: { _id: 1 }
   346        result: *doc11
   347    expectations:
   348      # Then key is fetched from the key vault.
   349      - command_started_event:
   350          command:
   351            find: datakeys
   352            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   353            $db: keyvault
   354            readConcern: { level: "majority" }
   355          command_name: find
   356      - command_started_event:
   357          command:
   358            insert: *collection_name
   359            documents:
   360              - &doc11_encrypted { _id: 1, encrypted_regex: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAALVnxM4UqGhqf5eXw6nsS08am3YJrTf1EvjKitT8tyyMAbHsICIU3GUjuC7EBofCHbusvgo7pDyaClGostFz44nA==', 'subType': '06'}} }
   361            ordered: true
   362          command_name: insert
   363      - command_started_event:
   364          command:
   365            find: *collection_name
   366            filter: {_id: 1}
   367          command_name: find
   368    outcome:
   369      collection:
   370        # Outcome is checked using a separate MongoClient without auto encryption.
   371        data:
   372          - *doc11_encrypted
   373  - description: "type=date"
   374    clientOptions:
   375      autoEncryptOpts:
   376        schemaMap:
   377          "default.default": {'properties': {'encrypted_date': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'date', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   378        kmsProviders:
   379          aws: {} # Credentials filled in from environment.
   380    operations:
   381      - name: insertOne
   382        arguments:
   383          document: &doc13 { _id: 1, encrypted_date: {$date: { $numberLong: "123" }} }
   384      - name: findOne
   385        arguments:
   386          filter: { _id: 1 }
   387        result: *doc13
   388    expectations:
   389      # Then key is fetched from the key vault.
   390      - command_started_event:
   391          command:
   392            find: datakeys
   393            filter: {"$or": [{"_id": {"$in": [ {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}} ] }}, {"keyAltNames": {"$in": []}}]}
   394            $db: keyvault
   395            readConcern: { level: "majority" }
   396          command_name: find
   397      - command_started_event:
   398          command:
   399            insert: *collection_name
   400            documents:
   401              - &doc13_encrypted { _id: 1, encrypted_date: {'$binary': {'base64': 'AQAAAAAAAAAAAAAAAAAAAAAJ5sN7u6l97+DswfKTqZAijSTSOo5htinGKQKUD7pHNJYlLXGOkB4glrCu7ibu0g3344RHQ5yUp4YxMEa8GD+Snw==', 'subType': '06'}} }
   402            ordered: true
   403          command_name: insert
   404      - command_started_event:
   405          command:
   406            find: *collection_name
   407            filter: {_id: 1}
   408          command_name: find
   409    outcome:
   410      collection:
   411        # Outcome is checked using a separate MongoClient without auto encryption.
   412        data:
   413          - *doc13_encrypted
   414  - description: "type=minKey"
   415    clientOptions:
   416      autoEncryptOpts:
   417        schemaMap:
   418          "default.default": {'properties': {'encrypted_minKey': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'minKey', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   419        kmsProviders:
   420          aws: {} # Credentials filled in from environment.
   421    operations:
   422      - name: insertOne
   423        arguments:
   424          document: &doc14 { _id: 1, encrypted_minKey: {$minKey: 1} }
   425        result:
   426          errorContains: "Cannot encrypt element of type: minKey"
   427  - description: "type=maxKey"
   428    clientOptions:
   429      autoEncryptOpts:
   430        schemaMap:
   431          "default.default": {'properties': {'encrypted_maxKey': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'maxKey', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   432        kmsProviders:
   433          aws: {} # Credentials filled in from environment.
   434    operations:
   435      - name: insertOne
   436        arguments:
   437          document: &doc15 { _id: 1, encrypted_maxKey: {$maxKey: 1} }
   438        result:
   439          errorContains: "Cannot encrypt element of type: maxKey"
   440  - description: "type=undefined"
   441    clientOptions:
   442      autoEncryptOpts:
   443        schemaMap:
   444          "default.default": {'properties': {'encrypted_undefined': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'undefined', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   445        kmsProviders:
   446          aws: {} # Credentials filled in from environment.
   447    operations:
   448      - name: insertOne
   449        arguments:
   450          document: &doc16 { _id: 1, encrypted_undefined: {$undefined: true} }
   451        result:
   452          errorContains: "Cannot encrypt element of type: undefined"
   453  - description: "type=array"
   454    clientOptions:
   455      autoEncryptOpts:
   456        schemaMap:
   457          "default.default": {'properties': {'encrypted_array': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'array', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   458        kmsProviders:
   459          aws: {} # Credentials filled in from environment.
   460    operations:
   461      - name: insertOne
   462        arguments:
   463          document: &doc17 { _id: 1, encrypted_array: [] }
   464        result:
   465          # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   466          # "Cannot use deterministic encryption for element of type: array"
   467          # After it is:
   468          # "Cannot encrypt element of type: array"
   469          # Only check for the common suffix.
   470          errorContains: "element of type: array"
   471  - description: "type=bool"
   472    clientOptions:
   473      autoEncryptOpts:
   474        schemaMap:
   475          "default.default": {'properties': {'encrypted_bool': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'bool', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   476        kmsProviders:
   477          aws: {} # Credentials filled in from environment.
   478    operations:
   479      - name: insertOne
   480        arguments:
   481          document: &doc18 { _id: 1, encrypted_bool: true }
   482        result:
   483          # DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
   484          # "Cannot use deterministic encryption for element of type: bool"
   485          # After it is:
   486          # "Cannot encrypt element of type: bool"
   487          # Only check for the common suffix.
   488          errorContains: "element of type: bool"
   489  - description: "type=null"
   490    clientOptions:
   491      autoEncryptOpts:
   492        schemaMap:
   493          "default.default": {'properties': {'encrypted_null': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'null', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
   494        kmsProviders:
   495          aws: {} # Credentials filled in from environment.
   496    operations:
   497      - name: insertOne
   498        arguments:
   499          document: &doc19 { _id: 1, encrypted_null: true }
   500        result:
   501          errorContains: "Cannot encrypt element of type: null"

View as plain text