bson/testdata/connection-string/invalid-uris.json
2025-03-17 20:58:26 +01:00

275 lines
6.8 KiB
JSON

{
"tests": [
{
"description": "Empty string",
"uri": "",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid scheme",
"uri": "mongo://localhost:27017",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Missing host",
"uri": "mongodb://",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Double colon in host identifier",
"uri": "mongodb://localhost::27017",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Double colon in host identifier and trailing slash",
"uri": "mongodb://localhost::27017/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Double colon in host identifier with missing host and port",
"uri": "mongodb://::",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Double colon in host identifier with missing port",
"uri": "mongodb://localhost,localhost::",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Double colon in host identifier and second host",
"uri": "mongodb://localhost::27017,abc",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (negative number) with hostname",
"uri": "mongodb://localhost:-1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (zero) with hostname",
"uri": "mongodb://localhost:0/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (positive number) with hostname",
"uri": "mongodb://localhost:65536",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (positive number) with hostname and trailing slash",
"uri": "mongodb://localhost:65536/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (non-numeric string) with hostname",
"uri": "mongodb://localhost:foo",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (negative number) with IP literal",
"uri": "mongodb://[::1]:-1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (zero) with IP literal",
"uri": "mongodb://[::1]:0/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (positive number) with IP literal",
"uri": "mongodb://[::1]:65536",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (positive number) with IP literal and trailing slash",
"uri": "mongodb://[::1]:65536/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Invalid port (non-numeric string) with IP literal",
"uri": "mongodb://[::1]:foo",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Missing delimiting slash between hosts and options",
"uri": "mongodb://example.com?w=1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Incomplete key value pair for option",
"uri": "mongodb://example.com/?w",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username with password containing an unescaped colon",
"uri": "mongodb://alice:foo:bar@127.0.0.1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username containing an unescaped at-sign",
"uri": "mongodb://alice@@127.0.0.1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username with password containing an unescaped at-sign",
"uri": "mongodb://alice@foo:bar@127.0.0.1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username containing an unescaped slash",
"uri": "mongodb://alice/@localhost/db",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username containing unescaped slash with password",
"uri": "mongodb://alice/bob:foo@localhost/db",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username with password containing an unescaped slash",
"uri": "mongodb://alice:foo/bar@localhost/db",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Host with unescaped slash",
"uri": "mongodb:///tmp/mongodb-27017.sock/",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "mongodb+srv with multiple service names",
"uri": "mongodb+srv://test5.test.mongodb.com,test6.test.mongodb.com",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "mongodb+srv with port number",
"uri": "mongodb+srv://test7.test.mongodb.com:27018",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "Username with password containing an unescaped percent sign",
"uri": "mongodb://alice%foo:bar@127.0.0.1",
"valid": false,
"warning": null,
"hosts": null,
"auth": null,
"options": null
}
]
}