ncarlier/webhookd

Can I validate authentication token?

L1so opened this issue · 2 comments

L1so commented

First of all, thanks for your great work, i really like it.

I'm using this script with hetrixtools to trigger on downtime, I'm planning to take some security measure to prevent anyone from sending unsolicited request. I found this on their wiki → https://docs.hetrixtools.com/webhook-authentication-token/. I wondering if there any shell variable for token in Authorization: Bearer <token>.

Thanks !

Hi, thank you for your interest.

Yes you can use authorization shell variable. The split the content to extract the token:

echo $authorization | cut -d " " -f 2

All headers are converted into shell variables according to this rule: https://github.com/ncarlier/webhookd#webhook-parameters

Regards

L1so commented

Thanks, it is working now.