[DRIVERS-949] Add tests for allowed cases when authSource is given but username is not Created: 17/Jan/20  Updated: 02/Mar/21

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

Type: Improvement Priority: Minor - P4
Reporter: Oleg Pudeyev (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3618 Add tests for allowed cases when auth... Backlog
depends on CXX-1992 Add tests for allowed cases when auth... Backlog
depends on CSHARP-3060 Add tests for allowed cases when auth... Closed
depends on GODRIVER-1577 Add tests for allowed cases when auth... Closed
depends on JAVA-3698 Add tests for allowed cases when auth... Closed
depends on MOTOR-534 Add tests for allowed cases when auth... Closed
depends on NODE-2563 Add tests for allowed cases when auth... Closed
depends on PHPC-1591 Add tests for allowed cases when auth... Closed
depends on PYTHON-2203 Add tests for allowed cases when auth... Closed
depends on RUST-357 Add tests for allowed cases when auth... Closed
depends on RUBY-2217 Add tests for allowed cases when auth... Closed
Related
related to DRIVERS-796 Lift restriction on authSource withou... Implementing
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-3618 Backlog
CXX-1992 Backlog
CSHARP-3060 Done
GODRIVER-1577 Fixed 1.5.0
JAVA-3698 Fixed 4.1.0
NODE-2563 Done 4.4.0
MOTOR-534 Duplicate
PYTHON-2203 Fixed 4.1
PHPC-1591 Fixed 1.8.0-beta2, 1.8.0
RUBY-2217 Fixed 2.13.0.beta1
RUST-357 Fixed 1.1.0
SWIFT-781 Won't Do

 Description   

https://jira.mongodb.org/browse/SPEC-1270 added an auth spec test which specified auth source and no username, requiring this to be an error:

    -
        description: "authSource without username is invalid (default mechanism)"
        uri: "mongodb://localhost/?authSource=foo"
        valid: false

I think it will be helpful to also include tests that specify auth source and no username for other mechanisms, since the auth spec allows username to be omitted for some mechanisms:

username (string)
 
        Applies to all mechanisms.
        Optional for MONGODB-X509 and MONGODB-IAM.

For example, I propose adding the following test:

    -
        description: "authSource without username is valid for $external"
        uri: "mongodb://localhost/?authSource=$external"
        valid: true
        credential:
            source: "$external"



 Comments   
Comment by Esha Bhargava [ 31/Mar/20 ]

oleg.pudeyev can you open a PR for this?

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