-
Type: Bug
-
Resolution: Works as Designed
-
Priority: 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
- duplicates
-
GODRIVER-920 Specifying a database name in URI other than admin triggers authentication
- Closed