Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new GetObjectCommand({
Key: fileName,
Bucket: config.s3Bucket
})
);
const signer = new S3RequestPresigner({
...s3Client.config
});
const url = await signer.presignRequest(
request,
new Date(Date.now() + 60 * 60 * 1000)
);
// @ts-ignore
return formatUrl(url);
};
resolvedEndpoint,
new QueryBuilder(base64Encoder, utf8Decoder, "ec2")
);
let request = requestSerializer.serialize(model, input);
const presignedRequest = await presignRequestQuery(request, {
//FIXME: need an endpoint provider for given region
endpoint: {
...resolvedEndpoint,
hostname: `ec2.${input.SourceRegion}.amazonaws.com`
},
credentials: await credentialsProvider(),
sha256,
signingName: "ec2",
signingRegion: input.SourceRegion
});
input.PresignedUrl = formatUrl(presignedRequest);
}
const revisedArgs = { ...args, input: input as Input };
return next(revisedArgs);
};
}
let request = requestSerializer.serialize(model, input);
//DestinationRegion is not present in model
request.query = request.query || ({} as QueryParameterBag);
request.query["DestinationRegion"] = region;
const presignedRequest = await presignRequestQuery(request, {
//FIXME: need an endpoint provider for given region
endpoint: {
...resolvedEndpoint,
hostname: `rds.${sourceRegion}.amazonaws.com`
},
credentials: await credentialsProvider(),
sha256,
signingName: "rds",
signingRegion: sourceRegion
});
input.PreSignedUrl = formatUrl(presignedRequest);
}
return next({ ...args, input: input as Input });
};
}