-
Notifications
You must be signed in to change notification settings - Fork 14
Aws Sdk V3 #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Aws Sdk V3 #206
Changes from 72 commits
fc2619e
4c5a2d2
129f9c4
c094f10
dadf9e7
181392d
71f7e7f
f1eae33
2f94cdc
13778bc
d20a5a4
54ea54f
fe3cd4d
ac12573
01237e2
cad6476
e42c814
141c0c1
1d2f3f0
4d20c2e
3e53aea
0799821
05e4b01
127e182
8408b30
18b3c74
b4da3b6
85df1ed
41cc606
bd0124e
fe38bde
6d0415c
d12a93e
3968848
293c2f7
d1d01ea
1f1dad3
335ba5b
8a1aba2
11b03f9
cc0a9eb
4a4b8b6
d2a4788
2f91304
7988756
1894318
7ff558a
f09592d
4ce6b0f
2b6a116
1fcbbda
00a111d
4272acf
3568f90
16a4f81
cd80f6d
87832c5
63e992f
d5d876c
5b0bce6
89c996f
9d91a5f
e72ca4a
973f4ff
31545df
02b8fa1
6039451
49fcc4a
57021a5
8d4b938
7d23302
e60af1b
10b4209
355760a
47bd6cc
378e169
88f7e83
b471834
7a28795
a09e672
f2be291
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| let leo = require("leo-sdk"); | ||
| const aws = require("aws-sdk"); | ||
| const { Lambda } = require("@aws-sdk/client-lambda"); | ||
| const checksum = require("./lib/checksumNibbler.js"); | ||
| const leoaws = require('leo-aws'); | ||
| let cron = leo.bot; | ||
|
|
@@ -271,17 +271,18 @@ module.exports = { | |
| lastUpdate: moment.now(), | ||
| status: status, | ||
| statusReason: err ? err.toString() : stopReason | ||
| })).then(result => { | ||
| async.parallel(tasks, (err, data) => { | ||
| if (err) { | ||
| reject(err); | ||
| } else { | ||
| resolve(session); | ||
| } | ||
| })) | ||
| .then(result => { | ||
| async.parallel(tasks, (err, data) => { | ||
| if (err) { | ||
| reject(err); | ||
| } else { | ||
| resolve(session); | ||
| } | ||
| }); | ||
| }, err => { | ||
| reject(err); | ||
| }); | ||
| }, err => { | ||
| reject(err); | ||
| }); | ||
| }); | ||
| }); | ||
| }, logError); | ||
|
|
@@ -290,7 +291,7 @@ module.exports = { | |
| }, | ||
| lambdaConnector: function(id, lambdaName, settings) { | ||
| let region = (lambdaName.match(/arn:aws:lambda:(.*?):/) || [])[1]; | ||
| const lambdaInvoker = new aws.Lambda({ | ||
| const lambdaInvoker = new Lambda({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lambda response Payload is Uint8Array in SDK v3High Severity In AWS SDK v3, the |
||
| region: region || this.configuration._meta.region, | ||
| credentials: this.configuration ? this.configuration.credentials : null | ||
| }); | ||
|
|
@@ -567,7 +568,7 @@ module.exports = { | |
| let session = null; | ||
|
|
||
| function invoke(method, func) { | ||
| func = func || ((d) => {}); | ||
| func = func || ((d) => { }); | ||
| return (data) => { | ||
| return new Promise((resolve, reject) => { | ||
| //logger.log(method, data) | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lambda invoke uses v2 callback pattern, never resolves
High Severity
The
lambdaInvoker.invoke()call passes a callback as the second argument, but AWS SDK v3'sLambdaclient does not support callbacks — it returns a Promise instead. The callback will be silently ignored, and since it's wrapped in anew Promise()that only resolves/rejects inside that callback, every Lambda connector operation (init,range,nibble,getChecksum, etc.) will hang forever without resolving or rejecting.