TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
983 stars 310 forks source link

Require successful webhook transmission before enabling the configuration #4527

Open htdvisser opened 3 years ago

htdvisser commented 3 years ago

Summary

When setting up a webhook configuration, we should verify that we can send webhooks to it before enabling the configuration.

What is already there? What do you see now?

Right now we have obviously incorrect webhook configurations.

What is missing? What do you want to see?

When creating a webhook, the AS should attempt to send a test payload, and only enable the webhook configuration if that succeeds.

How do you propose to implement this?

jpmeijers commented 3 years ago

This would be a useful feature, but remote servers might not like these test POSTs.

Another option to help users configure a webhook correctly is to show the last response from the remote server. The Sigfox backend does this, along with the full json body and headers. This allows one to replay the same post using a tool like Postman, at a user determined time, while running your server code in a debugger.

Example: Screenshot from 2021-09-20 15-19-38

dajtxx commented 2 years ago

This would be a useful feature, but remote servers might not like these test POSTs.

That was my immediate thought too. Messages sent from the end device messaging page have a simulated: true flag in them which end points should take notice of. So perhaps that can be used here too.