@ironfang/n8n-nodes-ironfang 0.4.2 → 0.4.3

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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Use Ironfang Render, Finance, Audit and Rig, and Ironfang's public developer
6
6
  tools, in n8n. The Ironfang action node has **162 operations**, grouped by
7
7
  product. Ironfang Trigger receives signed Audit, Finance and Render events.
8
8
 
9
- **Release: 0.4.2.** The API is now at `api.ironfang.com`; credentials saved with the old `api.ironfang.uk` address keep working unchanged. 0.4.1 made the package installable on n8n releases
9
+ **Release: 0.4.3.** Credits, cache status and webhook signatures are read from the `X-Ironfang-*` and `Ironfang-*` headers; update before the API stops sending the launch-era ones. 0.4.2 moved the API to `api.ironfang.com` (credentials saved with the old `api.ironfang.uk` address keep working unchanged), and 0.4.1 made the package installable on n8n releases
10
10
  before 2.33 that use PostgreSQL; see [Installation](#installation-and-credentials).
11
11
  It includes 0.4.0, in which the products are named Ironfang Render, Finance and Audit
12
12
  (formerly Renderwolf, Financewolf and Auditwolf), and the node follows: requests
@@ -164,8 +164,9 @@ The trigger verifies HMAC-SHA256 over the timestamp and exact body bytes using
164
164
  constant-time comparison, accepts timestamps within five minutes, and rejects
165
165
  invalid signatures before starting a workflow. Render and Finance secrets are
166
166
  decoded from hex; Audit secrets are used as returned. Deliveries are signed in
167
- the `Renderwolf-`, `Financewolf-` and `Auditwolf-` headers the products launched
168
- with; the trigger reads the ones for the credential's product. The signed event ID, rather
167
+ the `Ironfang-Signature` and `Ironfang-Timestamp` headers; the trigger still
168
+ reads the `Renderwolf-`, `Financewolf-` or `Auditwolf-` headers the products
169
+ launched with when those are all a delivery carries. The signed event ID, rather
169
170
  than the unsigned header ID, is used for duplicate detection.
170
171
 
171
172
  Duplicate state covers seven days/up to 10,000 IDs in n8n workflow static data.
@@ -36,9 +36,9 @@ function responseMetadata(headers, statusCode) {
36
36
  const result = { statusCode };
37
37
  if (headers['x-ironfang-request-id'])
38
38
  result.requestId = headers['x-ironfang-request-id'];
39
- if (headers['x-renderwolf-cache'])
40
- result.cacheStatus = headers['x-renderwolf-cache'];
41
- const credits = headers['x-renderwolf-credits'];
39
+ if (headers['x-ironfang-cache'])
40
+ result.cacheStatus = headers['x-ironfang-cache'];
41
+ const credits = headers['x-ironfang-credits'];
42
42
  if (credits !== undefined && credits !== '' && Number.isFinite(Number(credits)))
43
43
  result.creditsCharged = Number(credits);
44
44
  return result;
@@ -4,8 +4,10 @@ exports.signingKey = signingKey;
4
4
  exports.verifyEvent = verifyEvent;
5
5
  exports.webhookCredentialTest = webhookCredentialTest;
6
6
  const crypto_1 = require("crypto");
7
- // Signature headers keep the launch names (Renderwolf-Signature and so on), which
8
- // are also the saved product values. Render and Finance issue hex secrets.
7
+ // Every product signs with Ironfang-Signature and Ironfang-Timestamp. The saved
8
+ // product values keep the launch names (renderwolf and so on), and deliveries
9
+ // from before the Ironfang-* headers carried only <Launch name>-Signature, which
10
+ // is still read when the new header is absent. Render and Finance issue hex secrets.
9
11
  function signingKey(product, secret) {
10
12
  if (['renderwolf', 'financewolf'].includes(product) && /^[a-f0-9]{64}$/i.test(secret))
11
13
  return Buffer.from(secret, 'hex');
@@ -16,8 +18,8 @@ function signingKey(product, secret) {
16
18
  function verifyEvent(raw, headers, product, secret, now) {
17
19
  if (!raw.length || raw.length > 65_536)
18
20
  throw new Error('Webhook payload size is invalid');
19
- const timestamp = headers[`${product}-timestamp`];
20
- const signature = headers[`${product}-signature`];
21
+ const timestamp = headers['ironfang-timestamp'] ?? headers[`${product}-timestamp`];
22
+ const signature = headers['ironfang-signature'] ?? headers[`${product}-signature`];
21
23
  if (typeof timestamp !== 'string' || !/^\d{10,11}$/.test(timestamp) || Math.abs(now / 1000 - Number(timestamp)) > 300)
22
24
  throw new Error('Webhook timestamp is invalid or expired');
23
25
  if (typeof signature !== 'string' || !/^v1=[a-f0-9]{64}$/.test(signature))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironfang/n8n-nodes-ironfang",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "n8n nodes for Ironfang: Render, Finance, Audit, Rig, public tools and signed events",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",