Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3698

Add tests for allowed cases when authSource is given but username is not

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: Configuration
    • Labels:
      None

      Description

      Description of Drivers Ticket:

      https://jira.mongodb.org/browse/SPEC-1270 added an auth spec test which specified auth source and no username, requiring this to be an error:

          -
              description: "authSource without username is invalid (default mechanism)"
              uri: "mongodb://localhost/?authSource=foo"
              valid: false
      

      I think it will be helpful to also include tests that specify auth source and no username for other mechanisms, since the auth spec allows username to be omitted for some mechanisms:

      username (string)
       
              Applies to all mechanisms.
              Optional for MONGODB-X509 and MONGODB-IAM.
      
      

      For example, I propose adding the following test:

          -
              description: "authSource without username is valid for $external"
              uri: "mongodb://localhost/?authSource=$external"
              valid: true
              credential:
                  source: "$external"
      

      See DRIVERS-949 for updated details.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              john.stewart John Stewart (Inactive)
              Reporter:
              backlog-server-pm Backlog - DB Eng Program Management Team
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: