fix: include request body to AWS V4 signer in effective request functions (#5084)

This commit is contained in:
Anwarul Islam 2025-05-21 21:32:07 +06:00 committed by GitHub
parent d213bec3ef
commit 130facb440
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -202,8 +202,11 @@ export async function getEffectiveRESTRequest(
const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "");
const { method, endpoint } = request;
const body = getFinalBodyFromRequest(request, resolvedVariables);
const signer = new AwsV4Signer({
method,
body: E.isRight(body) ? body.right?.toString() : undefined,
datetime: amzDate,
signQuery: addTo === "QUERY_PARAMS",
accessKeyId: parseTemplateString(

View file

@ -222,8 +222,12 @@ export const getComputedAuthHeaders = async (
const currentDate = new Date()
const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
const { method, endpoint } = req as HoppRESTRequest
const body = getFinalBodyFromRequest(request, envVars)
const signer = new AwsV4Signer({
method: method,
body: body?.toString(),
datetime: amzDate,
accessKeyId: parseTemplateString(request.auth.accessKey, envVars),
secretAccessKey: parseTemplateString(request.auth.secretKey, envVars),