{
  "name": "mountable.io file changes",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": {
        "hook": null,
        "maxResults": 1
      },
      "mapper": {},
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        }
      }
    },
    {
      "id": 2,
      "module": "util:SetVariable2",
      "version": 1,
      "parameters": {},
      "mapper": {
        "name": "signed_content",
        "scope": "roundtrip",
        "value": "{{get(map(1.__IMTHEADERS__; \"value\"; \"name\"; \"webhook-id,Webhook-Id\"); 1)}}.{{get(map(1.__IMTHEADERS__; \"value\"; \"name\"; \"webhook-timestamp,Webhook-Timestamp\"); 1)}}.{{1.value}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        }
      }
    },
    {
      "id": 3,
      "module": "json:ParseJSON",
      "version": 1,
      "parameters": {
        "type": ""
      },
      "mapper": {
        "json": "{{1.value}}"
      },
      "filter": {
        "name": "Signed by mountable.io",
        "conditions": [
          [
            {
              "a": "{{get(map(1.__IMTHEADERS__; \"value\"; \"name\"; \"webhook-signature,Webhook-Signature\"); 1)}}",
              "o": "text:contain",
              "b": "v1,{{sha256(2.signed_content; \"base64\"; replace(\"REPLACE_WITH_WEBHOOK_SECRET\"; \"whsec_\"; emptystring); \"base64\")}}"
            },
            {
              "a": "{{get(map(1.__IMTHEADERS__; \"value\"; \"name\"; \"webhook-timestamp,Webhook-Timestamp\"); 1)}}",
              "o": "number:greater",
              "b": "{{formatDate(addMinutes(now; -5); \"X\")}}"
            },
            {
              "a": "{{get(map(1.__IMTHEADERS__; \"value\"; \"name\"; \"webhook-timestamp,Webhook-Timestamp\"); 1)}}",
              "o": "number:less",
              "b": "{{formatDate(addMinutes(now; 5); \"X\")}}"
            }
          ]
        ]
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        }
      }
    },
    {
      "id": 4,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{3.data.events}}"
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0
        }
      }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false
    },
    "designer": {
      "orphans": []
    }
  }
}
