You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/getting-started-with-the-hpe-greenlake-cloud-eventing-framework.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,13 @@ From the picture above, you can see that the webhook handler is a piece of code
64
64
}
65
65
```
66
66
67
+
> > *Example of a challenge payload*
68
+
67
69
The mission of the challenge handler is to provide the correct answer to the challenge in a timely fashion and with an HTTP response in the following form:
Where **<CHALLENGE-RESPONSE>** is the computed [SHA-256](https://en.wikipedia.org/wiki/SHA-2)[HMAC](https://en.wikipedia.org/wiki/HMAC) (Hash-based Message Authentication Code) of the **challengeRequest** provided in the input payload.
74
76
@@ -113,6 +115,8 @@ If the challenge was successful, meaning that the webhook handler has been recog
113
115
}
114
116
```
115
117
118
+
> > *Example of an event payload*
119
+
116
120
Now that you have a clear understanding of what has to be done within a webhook handler, let me show you how to build one.
117
121
118
122
## Using Make.com to create a webhook handler
@@ -139,7 +143,7 @@ Give it a name and leave the rest of the settings as their defaults.
139
143
140
144
You can already **Copy address to clipboard** to get the URL of your webhook. Save it for later.
141
145
142
-
Select the **Add** button, then click on **Show Advanced Option** to add a data structure using the payload example from the Take the challenge section above. Click **generate,** paste the JSON and save it as **challenge**.
146
+
Select the **Add** button, then click on **Show Advanced Option** to add a data structure using the challenge payload example from the Take the challenge section above. Click **generate,** paste the JSON and save it as **challenge**.
143
147
144
148
Make sure the **challenge** data structure is selected in the advanced settings of the Webhooks module before continuing.
145
149
@@ -162,7 +166,7 @@ The final step is to prepare the response of the webhook. For this, you need to
Set the status to **200** and the body to **{"verification":""}**, then drag/drop the **hmac** property from the **Set variable** step in between the double quotes.
169
+
Set the status to **200** and the body to **{"verification":"hmac"}**. Feel free to drag/drop the **hmac** property from the **Set variable** step in between the double quotes.
@@ -180,7 +184,7 @@ In the parameter of the scenario (bottom of your editor), make sure the green ch
180
184
181
185
You can use Postman to test this workflow first before you declare it in HPE GreenLake cloud.
182
186
183
-
For this, create a **POST** request using the URL of the webhook (which you saved earlier) and the challenge body in JSON (we used it earlier). Make sure you add a **content-type:application/json** header before clicking **Send**. Check:
187
+
For this, create a **POST** request using the URL of the webhook (which you saved earlier) and the challenge example payload in JSON (we used it earlier). Make sure you add a **content-type:application/json** header before clicking **Send**. Check:
184
188
185
189
* That the status code is 200
186
190
* That the response body is the expected **hmac** value
@@ -201,7 +205,7 @@ To do this, click on the topmost link and set up a filter to verify that propert
201
205
202
206

203
207
204
-
Earlier, I showed an example of a payload received when an event is triggered. You can create another structure in the custom webhook (like what was done with the challenge JSON earlier). Call this structure event and make sure it’s selected before continuing.
208
+
Earlier, I showed an example of a payload received when an event is triggered. You can create another structure in the custom webhook (like what was done with the challenge JSON earlier). Call this structure **event** and make sure it’s selected before continuing.
0 commit comments