[GODRIVER-1577] Add tests for allowed cases when authSource is given but username is not Created: 14/Apr/20  Updated: 28/Oct/23  Resolved: 22/Jul/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Improvement Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-949 Add tests for allowed cases when auth... Implementing

 Description   

Description of Drivers Ticket:

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"

See DRIVERS-949 for updated details.



 Comments   
Comment by Githook User [ 22/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: Resync auth tests and error for empty authSource in a URI (#449)

This commit also syncs spec tests for a spec change that made empty usernames invalid.

GODRIVER-1479
GODRIVER-1577
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/bc196cf48bfd02f342a94fe1115f3d0657012eee

Comment by Divjot Arora (Inactive) [ 14/Jul/20 ]

https://github.com/mongodb/mongo-go-driver/pull/449

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