File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ impl AuthMechanism {
205
205
uri_db. unwrap_or ( "admin" )
206
206
}
207
207
AuthMechanism :: MongoDbX509 => "$external" ,
208
- AuthMechanism :: Plain => "$external" ,
208
+ AuthMechanism :: Plain => uri_db . unwrap_or ( "$external" ) ,
209
209
#[ cfg( feature = "aws-auth" ) ]
210
210
AuthMechanism :: MongoDbAws => "$external" ,
211
211
_ => "" ,
@@ -336,7 +336,8 @@ pub struct Credential {
336
336
pub username : Option < String > ,
337
337
338
338
/// The database used to authenticate. This applies to all mechanisms and defaults to "admin"
339
- /// in SCRAM authentication mechanisms and "$external" for GSSAPI, MONGODB-X509 and PLAIN.
339
+ /// in SCRAM authentication mechanisms, "$external" for GSSAPI and MONGODB-X509, and the
340
+ /// database name or "$external" for PLAIN.
340
341
pub source : Option < String > ,
341
342
342
343
/// The password to authenticate with. This does not apply to all mechanisms.
Original file line number Diff line number Diff line change @@ -52,14 +52,12 @@ async fn run_auth_test(test_file: TestFile) {
52
52
53
53
let skipped_mechanisms = [
54
54
"GSSAPI" ,
55
- "PLAIN" ,
56
55
"MONGODB-CR" ,
57
56
#[ cfg( not( feature = "aws-auth" ) ) ]
58
57
"MONGODB-AWS" ,
59
58
] ;
60
59
61
60
// TODO: GSSAPI (RUST-196)
62
- // TODO: PLAIN (RUST-992)
63
61
if skipped_mechanisms
64
62
. iter ( )
65
63
. any ( |mech| test_case. description . contains ( mech) )
You can’t perform that action at this time.
0 commit comments