Skip to content

Commit d291e09

Browse files
committed
Update Blog “getting-started-with-the-hpe-greenlake-cloud-eventing-framework”
1 parent 8c9e0e5 commit d291e09

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

content/blog/getting-started-with-the-hpe-greenlake-cloud-eventing-framework.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ From the picture above, you can see that the webhook handler is a piece of code
6464
}
6565
```
6666

67+
> > *Example of a challenge payload*
68+
6769
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:
6870

69-
* Status code: 200
70-
* JSON body: { “verification : <CHALLENGE-RESPONSE>”}
71-
* Header: content-type: application/json
71+
* Status code: **200**
72+
* JSON body: **{ "verification" : "<CHALLENGE-RESPONSE>" }**
73+
* Header: **content-type: application/json**
7274

7375
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.
7476

@@ -113,6 +115,8 @@ If the challenge was successful, meaning that the webhook handler has been recog
113115
}
114116
```
115117

118+
> > *Example of an event payload*
119+
116120
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.
117121

118122
## 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.
139143

140144
You can already **Copy address to clipboard** to get the URL of your webhook. Save it for later.
141145

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**.
143147

144148
Make sure the **challenge** data structure is selected in the advanced settings of the Webhooks module before continuing.
145149

@@ -162,7 +166,7 @@ The final step is to prepare the response of the webhook. For this, you need to
162166

163167
![Add webhook response](/img/add-webhook-response.jpg "Add webhook response")
164168

165-
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.
166170

167171
![Set webhook response](/img/setwebhook-response.jpg "Set webhook response")
168172

@@ -180,7 +184,7 @@ In the parameter of the scenario (bottom of your editor), make sure the green ch
180184

181185
You can use Postman to test this workflow first before you declare it in HPE GreenLake cloud.
182186

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:
184188

185189
* That the status code is 200
186190
* 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
201205

202206
![Setup a filter on top most branch](/img/setup-filter.jpg "Setup a filter on top most branch")
203207

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.
205209

206210
![Select event structure](/img/select-event-struture.jpg "Select event structure")
207211

0 commit comments

Comments
 (0)