Skip to content

Commit

Permalink
fix(AWS DynamoDB Node): Fix issue pagination and simplify issue #4956 #…
Browse files Browse the repository at this point in the history
…4957 (#4959)

* Added 'M' type to decode attribute for dynamodb

* Fixed bug with return all. Headers from the previous iteration were being passed causing an invalid signature error
  • Loading branch information
napter authored Dec 22, 2022
1 parent 4da9c39 commit a43ea17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nodes-base/nodes/Aws/DynamoDB/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export async function awsApiRequestAllItems(
let responseData;

do {
responseData = await awsApiRequest.call(this, service, method, path, body, headers);
const originalHeaders = Object.assign({}, headers); //The awsapirequest function adds the hmac signature to the headers, if we pass the modified headers back in on the next call it will fail with invalid signature
responseData = await awsApiRequest.call(this, service, method, path, body, originalHeaders);
if (responseData.LastEvaluatedKey) {
body!.ExclusiveStartKey = responseData.LastEvaluatedKey;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/nodes-base/nodes/Aws/DynamoDB/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ function decodeAttribute(type: AttributeValueType, attribute: string) {
case 'SS':
case 'NS':
return attribute;
case 'M':
return simplify(attribute);
default:
return null;
}
Expand Down

0 comments on commit a43ea17

Please sign in to comment.