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

Require Drivers to raise errors for invalid URI Option Keys and Values

    • To Do
    • Require Drivers to raise errors for invalid URI Option Keys and Values
    • 0
    • 0
    • 0
    • 100
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4558 Won't Fix
      CXX-2639 Won't Fix
      CSHARP-4484 Won't Fix
      GODRIVER-2738 Won't Fix 2.0.0
      JAVA-4847 Won't Fix
      NODE-4972 Won't Fix
      MOTOR-1085 Won't Fix
      PYTHON-3572 Won't Fix
      PHPLIB-1067 Won't Fix
      RUBY-3207 Won't Fix
      RUST-1572 Won't Fix
      SWIFT-1693 Won't Do
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4558 Won't Fix CXX-2639 Won't Fix CSHARP-4484 Won't Fix GODRIVER-2738 Won't Fix 2.0.0 JAVA-4847 Won't Fix NODE-4972 Won't Fix MOTOR-1085 Won't Fix PYTHON-3572 Won't Fix PHPLIB-1067 Won't Fix RUBY-3207 Won't Fix RUST-1572 Won't Fix SWIFT-1693 Won't Do

      While sara.golemon was implementing CDRIVER-2869. she noticed that the "Valid required tls options are parsed correctly" test in tls-options.json failed because the spec expects a valid URI string and a logged warning. That agrees with the last paragraph in Connection String Spec: Values:

      Any invalid Values for a given key MUST be ignored and MUST log a WARN level message)

      That said, I'm curious why we don't allow hard errors on such cases. The current spec behavior of logging a warning and ignoring the value could make it quite easy for users to miss the problem.

      Elsewhere in the connection string spec, warnings are suggested for using deprecated options (e.g. "yes" string for a boolean), which makes more sense as we're still applying the value and not ignoring it. In that case, there's no harm if the user misses a warning (hopefully they see the warning and fix the URI); however, if support for a deprecated option/value was ultimately dropped the driver would still only log a warning despite a likely behavioral change for the user's application.

      I'd propose that we at least allow drivers to raise an error for invalid (not merely deprecated) values. This would require some care when updating the tests, since we wouldn't want to simply remove existing test cases with invalid values.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Daria Pardue Daria Pardue
            Jessica Sigafoos Jessica Sigafoos
            Alex Bevilacqua Alex Bevilacqua
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: