Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2138

Test that client side encryption errors are distinguishable

    XMLWordPrintableJSON

Details

    • Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Needed

    Description

      The spec says:

      All errors from the MongoClient to mongocryptd MUST be distinguished in some way (e.g. exception type) to make it easier for users to distinguish when a command fails due to auto encryption limitations.

      All errors from the MongoClient interacting with the key vault collection MUST be distinguished in some way (e.g. exception type) to make it easier for users to distinguish when a command fails due to behind-the-scenes operations required for encryption or decryption.

      I think we may be able to automate this check in the spec tests by introducing a new result.errorClass field. For example:

        - description: "$text unconditionally fails"
          clientOptions:
            autoEncryptOpts:
              kmsProviders:
                aws: {} # Credentials filled in from environment.
          operations:
            - name: find
              arguments:
                filter:
                  { $text: { $search: "search text" } }
              result:
                errorContains: "Unsupported match expression operator for encryption"
                errorClass: "MongocryptdError"
      

      Some valid error classes may be: MongocryptdError, KeyVaultError, LibmongocryptError.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: