Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2863

cs.AuthMechanismProperties is not initialized when mechanism set by --authenticationMechanism

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 100.5.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Inside this block in setOptionsFromURI():

      if opts.Kerberos.Service != "" && !cs.AuthMechanismPropertiesSet {
          cs.AuthMechanismProperties["SERVICE_NAME"] = opts.Kerberos.Service
          cs.AuthMechanismPropertiesSet = true        
      }

      cs.AuthMechanismProperties is not initialized if the auth mechanism was not specified in the URI (i.e. it didn't get initialized during connstring.Parse()).

      We need to do the same thing that we do for the mongodb-aws mechanism and add this to the start of the block:

      if cs.AuthMechanismProperties == nil {
          cs.AuthMechanismProperties = make(map[string]string)
      } 

       

            Assignee:
            huan.li@mongodb.com Huan Li
            Reporter:
            tim.fogarty@mongodb.com Tim Fogarty
            Tim Fogarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: