Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
Description
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
Attachments
Issue Links
- duplicates
-
GODRIVER-920 Specifying a database name in URI other than admin triggers authentication
-
- Closed
-