node-slack-interactive-messages icon indicating copy to clipboard operation
node-slack-interactive-messages copied to clipboard

Allow request verification using req.rawBody

Open aoberoi opened this issue 7 years ago • 3 comments

Description

Some hosting platforms (like Firebase Cloud) always parse the request body, and create the req.body property for convenience. Unfortunately, this prevents this library from being able to verify requests. However, there's a convention of placing the unparsed (but buffered) body on the req.rawBody property instead.

Using req.rawBody as a fallback for req.body during verification would allow users to deploy code using this package to more hosting platforms.

This issue is analogous to one from the @slack/events-api package. The work can likely be cribbed from this PR.

Requirements

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

aoberoi avatar Mar 07 '19 22:03 aoberoi

@ErwinLengkeek, beat you to making this issue 😄

aoberoi avatar Mar 07 '19 22:03 aoberoi

@aoberoi I forgot to create it :( Did make a PR for this issue. Cannot figure out how to get the coverage up though, tried numerous things but somehow it complains about the handleError function coverage. The tests do check the output of respond() on multiple occasions though.

ErwinAI avatar Mar 08 '19 08:03 ErwinAI

https://github.com/slackapi/node-slack-sdk/issues/758

shaydewael avatar Mar 28 '19 23:03 shaydewael