🤖 Merge PR #46389 [coinbase-commerce-node] - verifyEventBody function by @Johann-S

This commit is contained in:
Johann-S 2020-07-28 10:53:02 +02:00 committed by GitHub
parent 0cfd1d7b7d
commit 3acf01d3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -338,3 +338,10 @@ const paginationExample: Pagination = {
*/
// tslint:disable-next-line:void-return no-void-expression
const shouldBeVoid: void = Webhook.verifySigHeader(JSON.stringify(eventResponseExample), 'some-signature', 'my-secret');
/**
* Verify event body.
*
* @link https://github.com/coinbase/coinbase-commerce-node/blob/v1.0.4/lib/Webhook.js#L10
*/
Webhook.verifyEventBody(JSON.stringify(eventResponseExample), 'some-signature', 'my-secret');

View File

@ -594,6 +594,13 @@ declare namespace Webhook {
* @link https://github.com/coinbase/coinbase-commerce-node#verify-signature-header
*/
function verifySigHeader(rawBody: string, signature: string, sharedSecret: string): void;
/**
* Verify event body.
*
* @link https://github.com/coinbase/coinbase-commerce-node/blob/v1.0.4/lib/Webhook.js#L10
*/
function verifyEventBody(rawBody: string, signature: string, sharedSecret: string): resources.Event;
}
export {