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 {
205205 uri_db. unwrap_or ( "admin" )
206206 }
207207 AuthMechanism :: MongoDbX509 => "$external" ,
208- AuthMechanism :: Plain => "$external" ,
208+ AuthMechanism :: Plain => uri_db . unwrap_or ( "$external" ) ,
209209 #[ cfg( feature = "aws-auth" ) ]
210210 AuthMechanism :: MongoDbAws => "$external" ,
211211 _ => "" ,
@@ -336,7 +336,8 @@ pub struct Credential {
336336 pub username : Option < String > ,
337337
338338 /// 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.
340341 pub source : Option < String > ,
341342
342343 /// 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) {
5252
5353 let skipped_mechanisms = [
5454 "GSSAPI" ,
55- "PLAIN" ,
5655 "MONGODB-CR" ,
5756 #[ cfg( not( feature = "aws-auth" ) ) ]
5857 "MONGODB-AWS" ,
5958 ] ;
6059
6160 // TODO: GSSAPI (RUST-196)
62- // TODO: PLAIN (RUST-992)
6361 if skipped_mechanisms
6462 . iter ( )
6563 . any ( |mech| test_case. description . contains ( mech) )
You can’t perform that action at this time.
0 commit comments