@@ -816,7 +816,7 @@ func (a *AuthenticatorAWSSigV4) Authenticate(ctx context.Context, state *APIStat
816816 return g .Error (err , "could not make AWS config for authentication" )
817817 }
818818
819- ac .State .Auth .Sign = func (ctx context. Context , req * http.Request , bodyBytes []byte ) error {
819+ ac .State .Auth .Sign = func (iter * Iteration , req * http.Request , bodyBytes []byte ) error {
820820 // Calculate the SHA256 hash of the request body.
821821 hasher := sha256 .New ()
822822 hasher .Write (bodyBytes )
@@ -825,13 +825,13 @@ func (a *AuthenticatorAWSSigV4) Authenticate(ctx context.Context, state *APIStat
825825 // Create a new signer.
826826 signer := v4 .NewSigner ()
827827
828- creds , err := cfg .Credentials .Retrieve (ctx )
828+ creds , err := cfg .Credentials .Retrieve (iter . context . Ctx )
829829 if err != nil {
830830 return g .Error (err , "could not retrieve AWS creds signing request" )
831831 }
832832
833833 // Sign the request, which adds the 'Authorization' and other necessary headers.
834- return signer .SignHTTP (ctx , creds , req , payloadHash , awsService , awsRegion , time .Now ())
834+ return signer .SignHTTP (iter . context . Ctx , creds , req , payloadHash , awsService , awsRegion , time .Now ())
835835 }
836836
837837 return
@@ -853,7 +853,7 @@ func (a *AuthenticatorHMAC) Authenticate(ctx context.Context, state *APIStateAut
853853 a .Algorithm = "sha256"
854854 }
855855
856- state .Sign = func (ctx context. Context , req * http.Request , bodyBytes []byte ) error {
856+ state .Sign = func (iter * Iteration , req * http.Request , bodyBytes []byte ) error {
857857 var signature string
858858
859859 // Fixed timestamp for consistency
@@ -945,7 +945,7 @@ func (a *AuthenticatorHMAC) Authenticate(ctx context.Context, state *APIStateAut
945945 case "sha256" :
946946 stringToSign := g .Rm (a .SigningString , templateMap )
947947
948- stringToSign , err = a . conn .renderString (stringToSign )
948+ stringToSign , err = iter .renderString (stringToSign )
949949 if err != nil {
950950 return g .Error (err , "could not render string for HMAC signer" )
951951 }
@@ -957,7 +957,7 @@ func (a *AuthenticatorHMAC) Authenticate(ctx context.Context, state *APIStateAut
957957 case "sha512" :
958958 stringToSign := g .Rm (a .SigningString , templateMap )
959959
960- stringToSign , err = a . conn .renderString (stringToSign )
960+ stringToSign , err = iter .renderString (stringToSign )
961961 if err != nil {
962962 return g .Error (err , "could not render string for HMAC signer" )
963963 }
@@ -976,7 +976,7 @@ func (a *AuthenticatorHMAC) Authenticate(ctx context.Context, state *APIStateAut
976976 // Add headers
977977 for key , value := range a .ReqHeaders {
978978 value = g .Rm (value , templateMap )
979- value , err = a . conn .renderString (value )
979+ value , err = iter .renderString (value )
980980 if err != nil {
981981 return g .Error (err , "could not render string for HMAC header: %s" , key )
982982 }
0 commit comments