Webhook plug-in structure

Configuring a Webhook event source
An event source that receives WebhookEevent type events can be configured in three different ways:
GenericHMAC
When configuring a Generic HMAC type event source, you need to specify the following parameters:
Secret
  • Type: string
  • Required
The secret is a cryptographic key shared between the sender and receiver. This key is used in the HMAC algorithm to generate a hash-based authentication code for each message.
Algorithm
  • Type: string
  • Required
You need to specify the generic cryptographic hash function you want to use. You can choose between two set values:
  • {"name": "SHA-256"}
  • {"name": "SHA-512"}
HeaderName
  • Type: string
  • Required
The header contains information derived from the calculation of the secret and the hashing algorithm, which are then matched with HCL Universal Orchestrator internal calculations. If the header and the internal calculations match, the event is authorized to be received and processed.
IPNetMask
  • Type: list
You can specify an IP net mask to filter one or more IPs you want to receive events from.
Generic
When configuring a Generic type event source you can specify:
IPNetMask
  • Type: list
You can specify an IP net mask to filter one or more IPs you want to receive events from.
Github
When configuring a Github type event source, you need to specify the following mandatory parameter:
Secret
  • Type: string
  • Required
You need to specify a secret cryptographic key.
IPNetMask
  • Type: list
You can specify an IP net mask to filter one or more IPs you want to receive events from.
The following is an example of a generic type event source configured to receive Webhook events:
$eventsource

EVENT_SOURCE /WEBHOOK1
DESCRIPTION "Webhook testing"
PLUGIN Webhook
TYPE GenericHMAC
CONFIGURATION {

      "secret": "secretvalue",
      "algorithm": "SHA-256",
      "headerName": "headerNamevalue",
      "ipNetMask": ["xxx.xxx.x.x/xx"]

         }
END
Webhook event condition
WebhookEvent type event conditions can be configured in job streams specifying the following required properties:
  • Name
  • Type
  • Event source
You can also specify any number of properties that filter the events received from the event source:
Method
  • Type: string
  • Operator: EQ("=") or NE("!=")
  • Multiple filters
  • Values: you can choose one or more:
    • POST
    • GET
    • DELETE
    • PUT
    • OPTIONS
    • HEAD
    • CONNECT
    • PATCH
    • TRACE
Specify the method of the Webhook callback to enable filtering of events that either match or do not match the specified input.
Headers
  • Type: map
  • Operator: KEY_VALUE("keyvalue")
  • Wildcard allowed
  • Values: {HeaderName[,Headervalue]}
Specify the key and or value of the Webhook header to enable filtering of events that either match or do not match the specified input.
Parameters
  • Type: map
  • Operator: KEY_VALUE("keyvalue")
  • Wildcard allowed
  • Values: {ParamName[,Paramvalue]}
Specify the key and or value of the Webhook parameter to enable filtering of events that either match or do not match the specified input.
ContentType
  • Type: string
  • Operator: EQ("=") or NE("!=")
  • Wildcard allowed
  • Values: application/json
Specify the content type of the Webhook event to enable filtering of events that either match or do not match the specified input.
Body
  • Type: json
  • Operator: JSONATA("jsonata")
  • Single predicate
  • Values: jsonataExpression
Specify the jsonata expression of the Webhook body to enable filtering of events that either match or do not match the specified input.
The following is an example of a job stream with three Webhook event conditions:
TRIGGER MY_TRIGGER DESCRIPTION "my event trigger" TIMEOUT 1000 TRIGGER_ON_TIMEOUT CORRELATIONS A, A1, A2
    CONDITIONS IN ORDER
    NAME EC TYPE plugin/WEBHOOKEVENT SOURCE MY_EVENT_SOURCE FILTERS METHOD = POST
    NAME CC TYPE plugin/WEBHOOKEVENT SOURCE MY_EVENT_SOURCE FILTERS HEADER keyvalue {HEADERNAME,HEADERVALUE}
    NAME CE TYPE plugin/WEBHOOKEVENT SOURCE MY_EVENT_SOURCE FILTERS BODY jsonata $.test.testing[0].tested