File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ dns-resolver = ["dep:hickory-resolver", "dep:hickory-proto"]
41
41
cert-key-password = [" dep:pem" , " dep:pkcs8" ]
42
42
43
43
# Enable support for MONGODB-AWS authentication.
44
- aws-auth = [" dep:reqwest" , " aws-config" , " aws-types" , " aws-credential-types" ]
44
+ aws-auth = [" dep:reqwest" , " dep: aws-config" , " dep: aws-types" , " dep: aws-credential-types" ]
45
45
46
46
# Enable support for on-demand Azure KMS credentials.
47
47
azure-kms = [" dep:reqwest" ]
Original file line number Diff line number Diff line change @@ -119,12 +119,7 @@ async fn authenticate_stream_inner(
119
119
let creds = get_aws_credentials ( credential) . await . map_err ( |e| {
120
120
Error :: authentication_error ( MECH_NAME , & format ! ( "failed to get creds: {e}" ) )
121
121
} ) ?;
122
- let aws_credential = AwsCredential :: from_sdk_creds (
123
- creds. access_key_id ( ) . to_string ( ) ,
124
- creds. secret_access_key ( ) . to_string ( ) ,
125
- creds. session_token ( ) . map ( |s| s. to_string ( ) ) ,
126
- None ,
127
- ) ;
122
+ let aws_credential = AwsCredential :: from_sdk_creds ( creds) ;
128
123
129
124
let date = Utc :: now ( ) ;
130
125
@@ -301,17 +296,12 @@ impl AwsCredential {
301
296
}
302
297
303
298
// Creates AwsCredential from keys.
304
- fn from_sdk_creds (
305
- access_key_id : String ,
306
- secret_access_key : String ,
307
- session_token : Option < String > ,
308
- expiration : Option < crate :: bson:: DateTime > ,
309
- ) -> Self {
299
+ fn from_sdk_creds ( creds : Credentials ) -> Self {
310
300
Self {
311
- access_key_id,
312
- secret_access_key,
313
- session_token,
314
- expiration,
301
+ access_key_id : creds . access_key_id ( ) . to_string ( ) ,
302
+ secret_access_key : creds . secret_access_key ( ) . to_string ( ) ,
303
+ session_token : creds . session_token ( ) . map ( |s| s . to_string ( ) ) ,
304
+ expiration : None ,
315
305
}
316
306
}
317
307
You can’t perform that action at this time.
0 commit comments