-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Go Drivers
-
Not Needed
-
Detailed steps to reproduce the problem?
opts.ApplyURI(...).SetAuth(options.Credential{AuthMechanism: "MONGODB-AWS"})
When I try to connect with these client options, I get the following error:
MONGODB-AWS source must be empty or $external
However, AuthSource is empty here...I would expect it to be set to $external, which is what happens when the auth mechanism is specified in the URI instead of through the client options (source).
Definition of done: what must be done to consider the task complete?
Using SetAuth with an AuthMechanism of MONGODB-AWS should not result in an error if AuthSource is unspecified.
I'm no Go Driver expert, but I think this is happening because of this line: https://github.com/mongodb/mongo-go-driver/blob/1649d33597960a4863fc4e8009e146576edcc61d/x/mongo/driver/topology/topology_options.go#L178
Could this be an issue in other drivers?
The exact Go version used, with patch level:
$ go version
1.22.2
The exact version of the Go driver used:
$ go list -m go.mongodb.org/mongo-driver
1.12.0
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
Atlas clusters (both sharded and replica sets)
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
AL2
Security Vulnerabilities
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here
- is cloned by
-
GODRIVER-3333 [2.0] (options.ClientOptions).SetAuth with MONGODB-AWS does not set default $external AuthSource
- Closed
- is related to
-
GODRIVER-3316 Remove Authentication Registry
- Backlog