[DRIVERS-431] Test with authentication and mongodb+srv URI Created: 12/Dec/17  Updated: 28/Oct/23  Resolved: 07/Jun/18

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-2425 authSource option from TXT record ign... Closed
Related
is related to DRIVERS-382 Automate Atlas connectivity tests Closed
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-2425 Fixed 1.9.0

 Description   

Catch bugs like CDRIVER-2425, where I had successfully looked up the "authSource" option from a TXT record but hadn't actually used it for authentication.



 Comments   
Comment by A. Jesse Jiryu Davis [ 26/Feb/18 ]

rathi.gnanasekaran I can't figure out how to close this, could you please close it "won't fix"?

Comment by A. Jesse Jiryu Davis [ 16/Dec/17 ]

Alternatively, we can use a test similar to the Initial DNS Seedlist Discovery Spec tests we already have, and not involve Atlas. Create a 3-node replica set with SSL on ports 27017, 27018, and 27019, just like in the spec tests. But also configure auth: create username "bob" with password "pwd123" in database "thisDB", with role "readWriteAnyDatabase". Mongo Orchestration does this correctly if we add to the config JSON file:

  "login": "bob",
  "password": "pwd123",
  "authSource": "thisDB",

Here's a full config from the C Driver.

Add this JSON test:

{
  "uri": "mongodb+srv://bob:pwd123@test5.test.build.10gen.cc/",
  "seeds": [
    "localhost.test.build.10gen.cc:27017"
  ],
  "hosts": [
    "localhost:27017",
    "localhost:27018",
    "localhost:27019"
  ],
  "options": {
    "replicaSet": "repl0",
    "authSource": "thisDB",
    "ssl": true
  }
}

We can use the same test runner that we wrote for the spec tests, so long as the runner actually attempts a read or write operation that proves authentication succeeded.

Generated at Thu Feb 08 08:21:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.