Skip to content

Commit fdc2de4

Browse files
authored
CDRIVER-3502 Lift restriction on authSource without credentials (#841)
1 parent 230369c commit fdc2de4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/libmongoc/src/mongoc/mongoc-uri.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,6 @@ mongoc_uri_finalize_auth (mongoc_uri_t *uri,
13391339
if (bson_iter_init_find_case (
13401340
&iter, &uri->credentials, MONGOC_URI_AUTHSOURCE)) {
13411341
source = bson_iter_utf8 (&iter, NULL);
1342-
require_auth = true;
13431342
}
13441343

13451344
if (mongoc_uri_get_auth_mechanism (uri)) {

src/libmongoc/tests/json/auth/connection-string.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,10 @@
352352
"credential": null
353353
},
354354
{
355-
"description": "authSource without username is invalid (default mechanism)",
355+
"description": "authSource without username doesn't create credential (default mechanism)",
356356
"uri": "mongodb://localhost/?authSource=foo",
357-
"valid": false
357+
"valid": true,
358+
"credential": null
358359
},
359360
{
360361
"description": "should throw an exception if no username provided (userinfo implies default mechanism)",

src/libmongoc/tests/json/connection_uri/additional-nonspec-tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"description": "Repeated authSource key",
55
"uri": "mongodb://example.com/?authSource=bar&authSource=foo",
6-
"valid": false,
6+
"valid": true,
77
"comment": "invalid URI (see SPEC-1424)",
88
"warning": true,
99
"hosts": [

0 commit comments

Comments
 (0)