mreinstein / alexa-verifier

✓ Verify HTTP requests sent to an Alexa skill are sent from Amazon
MIT License
76 stars 23 forks source link

v3 #65

Closed mreinstein closed 3 years ago

mreinstein commented 3 years ago

Here's what I'm thinking about for the next major release (3.0.0):

These are just my current musings. Open for thoughts/ideas/suggestions.

mreinstein commented 3 years ago

One wrinkle with ditching the callback style is alexa-verifier-middleware is a major consumer of this module, which is an express middleware, and express still doesn't support async middlewares. It might be better to hold off on this particular item until express supports that out of the box (v5 does I think, but it's perpetually marked as alpha)

tejashah88 commented 3 years ago

@mreinstein We could have it so v3 could expose a .callback() and a .promise() function, to allow flexibility. The nice thing is that Node has a native method to promisify callback-based functions, so that should be easy to add.

One thing to note is that it'll be a long while before express v4 and below are so rarely used that we can completely ditch the callback style.

mreinstein commented 3 years ago

I did all of this except for the async function, since express still lacks async/await middlewares. :(