-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Detailed steps to reproduce the problem?
The current implementation of handshake in the Go driver is missing the following spec compliance:
All strings provided as part of the driver info MUST NOT contain the delimiter used for metadata concatenation. Drivers MUST throw an error if any of these strings contains that character.
The Go driver is not compliant. You can repro with the following:
func TestMGC_Client_SetDriverInfoWithDelimeter(t *testing.T) {
opts := options.Client().SetDriverInfo(&options.DriverInfo{
Name: "has|pipe",
Version: "1|2",
Platform: "p|q",
})
client, err := mongo.Connect(opts)
defer func() { _ = client.Disconnect(context.Background()) }()
require.Error(t, err)
}
Output on master:
❯ go test -run TestMGC_Client_SetDriverInfoWithDelimeter -v -failfast
=== RUN TestMGC_Client_SetDriverInfoWithDelimeter
mgd_client_drivers_3251_test.go:22:
Error Trace: /Users/preston.vasquez/Developer/go-playground/mgd_client_drivers_3251_test.go:22
Error: An error is expected but got nil.
Test: TestMGC_Client_SetDriverInfoWithDelimeter
--- FAIL: TestMGC_Client_SetDriverInfoWithDelimeter (0.00s)
FAIL
exit status 1
FAIL
Definition of done: what must be done to consider the task complete?
Determine if we can validate while construct client options. If not, document to the user not to do this and silently drop the pipes.
The exact Go version used, with patch level:
NA
The exact version of the Go driver used:
master
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
NA
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
NA
Security Vulnerabilities
NA
- tested by
-
DRIVERS-3616 Add spec tests for rejecting the metadata delimiter in DriverInfo strings
-
- Closed
-