@@ -97,16 +97,6 @@ async fn authenticate_stream_inner(
97
97
let server_first = ServerFirst :: parse ( server_first_response. auth_response_body ( MECH_NAME ) ?) ?;
98
98
server_first. validate ( & nonce) ?;
99
99
100
- let creds = get_aws_credentials ( credential) . await . map_err ( |e| {
101
- Error :: authentication_error ( MECH_NAME , & format ! ( "failed to get creds: {e}" ) )
102
- } ) ?;
103
- let aws_credential = AwsCredential :: from_sdk_creds (
104
- creds. access_key_id ( ) . to_string ( ) ,
105
- creds. secret_access_key ( ) . to_string ( ) ,
106
- creds. session_token ( ) . map ( |s| s. to_string ( ) ) ,
107
- None ,
108
- ) ;
109
-
110
100
// Find credentials using original implementation without AWS SDK
111
101
// let aws_credential = {
112
102
// // Limit scope of this variable to avoid holding onto the lock for the duration of
@@ -126,6 +116,16 @@ async fn authenticate_stream_inner(
126
116
// }
127
117
// };
128
118
119
+ let creds = get_aws_credentials ( credential) . await . map_err ( |e| {
120
+ Error :: authentication_error ( MECH_NAME , & format ! ( "failed to get creds: {e}" ) )
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
+ ) ;
128
+
129
129
let date = Utc :: now ( ) ;
130
130
131
131
let authorization_header = aws_credential. compute_authorization_header (
0 commit comments