-
Notifications
You must be signed in to change notification settings - Fork 22
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
[REC-359] provide webhook verification nodejs example #65
Conversation
Thanks! We should add a link to this example in the main nodejs readme too, like truelayer-signing/csharp/README.md Line 41 in 166944d
|
First, build the signing lib | ||
```sh | ||
# in the `truelayer-signing/nodejs` dir | ||
yarn build |
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.
Isn't it just yarn
?
yarn build | |
yarn |
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.
Maybe that works, but build
is the specific script that does actually builds the lib.js file:
https://github.com/TrueLayer/truelayer-signing/blob/main/nodejs/package.json#L9
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.
Ah I see the directory, wouldn't just running yarn
in the examples/webhook-server dir work fine in any case?
yarn is playing up for me at the moment because of jfrog, but npm i
in the webhook-server does the right thing so I assume running yarn
would too.
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.
Judging by @jdon's comment in the slack thread, it doesn't seem to work properly (it will pull the path dependency, but doesn't run the build script to build)
method: req.method, | ||
path: req.path, | ||
headers: req.headers, | ||
body: JSON.stringify(req.body), |
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.
hmm we shouldn't really be manipulating the body in any way before verifying
Example of #47 for NodeJS