Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-921

with database specified in URI, driver should not neccessarily attempt to authenticate

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      package mongo
      
      import (
      	"testing"
      
      	"github.com/stretchr/testify/require"
      	"go.mongodb.org/mongo-driver/mongo/options"
      )
      
      func TestURIParsingAuth(t *testing.T) {
      	opts := options.Client().ApplyURI("mongodb://localhost:27017")
      	require.Nil(t, opts.Auth)
      
      	opts = options.Client().ApplyURI("mongodb://localhost:27017/test")
      	require.Nil(t, opts.Auth)
      }
      

      the second assertion fails.

      I believe the bug is fixed by removing the final conditional (cs.AuthSource != "admin") from line 126 of go.mongodb.org/mongo-driver/mongo/options/clientoptions.go

            Assignee:
            Unassigned Unassigned
            Reporter:
            sam.kleinman Sam Kleinman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: