...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-encryption/unified/createDataKey-kms_providers-invalid.yml

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

     1description: createDataKey-kms_providers-invalid
     2
     3schemaVersion: "1.8"
     4
     5runOnRequirements:
     6  - csfle: true
     7
     8createEntities:
     9  - client:
    10      id: &client0 client0
    11      observeEvents:
    12        - commandStartedEvent
    13        - commandSucceededEvent
    14        - commandFailedEvent
    15  - clientEncryption:
    16      id: &clientEncryption0 clientEncryption0
    17      clientEncryptionOpts:
    18        keyVaultClient: *client0
    19        keyVaultNamespace: keyvault.datakeys
    20        kmsProviders:
    21          aws: { accessKeyId: { $$placeholder: 1 }, secretAccessKey: { $$placeholder: 1 } }
    22
    23tests:
    24  - description: create data key without required master key fields
    25    operations:
    26      - name: createDataKey
    27        object: *clientEncryption0
    28        arguments:
    29          kmsProvider: aws
    30          opts:
    31            masterKey: {}
    32        expectError:
    33          isClientError: true
    34    expectEvents:
    35      - client: *client0
    36        events: []
    37
    38  - description: create data key with invalid master key field
    39    operations:
    40      - name: createDataKey
    41        object: *clientEncryption0
    42        arguments:
    43          kmsProvider: local
    44          opts:
    45            masterKey:
    46              invalid: 1
    47        expectError:
    48          isClientError: true
    49    expectEvents:
    50      - client: *client0
    51        events: []
    52
    53  - description: create data key with invalid master key
    54    operations:
    55      - name: createDataKey
    56        object: *clientEncryption0
    57        arguments:
    58          kmsProvider: aws
    59          opts:
    60            masterKey:
    61              key: arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0
    62              region: invalid
    63        expectError:
    64          isClientError: true
    65    expectEvents:
    66      - client: *client0
    67        events: []

View as plain text