@@ -86,8 +86,15 @@ pub enum AuthMechanism {
86
86
/// Assume Role request, or temporary AWS IAM credentials assigned to an EC2 instance or ECS
87
87
/// task.
88
88
///
89
- /// Note: Only server versions 4.4+ support AWS authentication. Additionally, the driver only
90
- /// supports AWS authentication with the tokio runtime.
89
+ /// The driver uses the [AWS SDK](https://github.com/awslabs/aws-sdk-rust) to retrieve AWS
90
+ /// credentials. If you have a shared AWS credentials or config file, then those credentials
91
+ /// will be used by default if AWS authentication environment variables are not set. To
92
+ /// override this behavior, set `AWS_SHARED_CREDENTIALS_FILE=""` in your shell or set the
93
+ /// equivalent environment variable value in your script or application. Alternatively, you
94
+ /// can create an AWS profile specifically for your MongoDB credentials and set the
95
+ /// `AWS_PROFILE` environment variable to that profile name.
96
+ ///
97
+ /// Note: Only server versions 4.4+ support AWS authentication.
91
98
#[ cfg( feature = "aws-auth" ) ]
92
99
MongoDbAws ,
93
100
@@ -320,7 +327,7 @@ impl AuthMechanism {
320
327
}
321
328
#[ cfg( feature = "aws-auth" ) ]
322
329
AuthMechanism :: MongoDbAws => {
323
- aws:: authenticate_stream ( stream, credential, server_api, & opts . http_client ) . await
330
+ aws:: authenticate_stream ( stream, credential, server_api) . await
324
331
}
325
332
AuthMechanism :: MongoDbCr => Err ( ErrorKind :: Authentication {
326
333
message : "MONGODB-CR is deprecated and not supported by this driver. Use SCRAM \
@@ -414,8 +421,6 @@ impl FromStr for AuthMechanism {
414
421
// Auxiliary information needed by authentication mechanisms.
415
422
pub ( crate ) struct AuthOptions {
416
423
server_api : Option < ServerApi > ,
417
- #[ cfg( feature = "aws-auth" ) ]
418
- http_client : crate :: runtime:: HttpClient ,
419
424
#[ cfg( feature = "gssapi-auth" ) ]
420
425
resolver_config : Option < ResolverConfig > ,
421
426
}
@@ -424,8 +429,6 @@ impl From<&ClientOptions> for AuthOptions {
424
429
fn from ( opts : & ClientOptions ) -> Self {
425
430
Self {
426
431
server_api : opts. server_api . clone ( ) ,
427
- #[ cfg( feature = "aws-auth" ) ]
428
- http_client : crate :: runtime:: HttpClient :: default ( ) ,
429
432
#[ cfg( feature = "gssapi-auth" ) ]
430
433
resolver_config : opts. resolver_config . clone ( ) ,
431
434
}
0 commit comments