@riocrypto/common-server 1.0.2740 → 1.0.2741

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,12 +20,14 @@ IMPBpnPrH/0O97uMPuED+nI6ISGOTMLZo35xJ96gPBwyG5s2QxIkKPXIrhgcgUnk
20
20
  tSM7QYNhlftT4/yVvYnk0YcCAwEAAQ==
21
21
  -----END PUBLIC KEY-----`.replace(/\\n/g, "\n");
22
22
  const getIsFireblocksWebhookValid = (req) => {
23
+ const signature = req.headers["fireblocks-webhook-signature"];
24
+ if (!signature) {
25
+ return false;
26
+ }
23
27
  const message = JSON.stringify(req.body);
24
- const signature = req.headers["fireblocks-signature"];
25
28
  const verifier = crypto_1.default.createVerify("RSA-SHA512");
26
29
  verifier.write(message);
27
30
  verifier.end();
28
- const isVerified = verifier.verify(publicKey, signature, "base64");
29
- return isVerified;
31
+ return verifier.verify(publicKey, signature, "base64");
30
32
  };
31
33
  exports.getIsFireblocksWebhookValid = getIsFireblocksWebhookValid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2740",
3
+ "version": "1.0.2741",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/secret-manager": "^5.3.0",
29
29
  "@google-cloud/storage": "^6.9.5",
30
30
  "@hyperdx/node-opentelemetry": "^0.7.0",
31
- "@riocrypto/common": "^1.0.2532",
31
+ "@riocrypto/common": "^1.0.2534",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",