Skip to content

Unawaited promises when signature verification fails #1655

Closed Answered by kdeberk
kdeberk asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Twiss, thanks for your patience. I think I've figured it out.

My application uploads the stream that the decrypt call returns, to S3 using the AWS S3 SDK. All the following things seem to be necessary to get it to work:

  • pipe the decrypt stream to a new PassThrough and upload the PassThrough stream. If we instead upload the decrypt stream then the S3 upload will block under normal (= non-error) circumstances,
  • Add an on("error", () => {}) handler to the decrypt stream, otherwise any streaming decrypt errors will not be picked up correctly
  • Await all the signature promises (both signature & verified) + the S3 upload promise using Promise.all.

Basically, the code looks like this:

const {…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@kdeberk
Comment options

@kdeberk
Comment options

@twiss
Comment options

@twiss
Comment options

Comment options

You must be logged in to vote
4 replies
@twiss
Comment options

@kdeberk
Comment options

@larabr
Comment options

@kdeberk
Comment options

Answer selected by kdeberk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants