Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/testing-webhooks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using The Power to test webhooks
# Using The Power to test Webhooks

## Requirements

Expand Down Expand Up @@ -73,3 +73,12 @@ Create an event that triggers the webhook such as creating an issue or commentin
./create-issue-comment.sh

```

## Notes on GitHub Documentation
The document [Validating webhook deliveries](https://docs.github.com/en/enterprise-cloud@latest/webhooks/using-webhooks/validating-webhook-deliveries) contains a section titled [Testing the webhook payload validation](https://docs.github.com/en/enterprise-cloud@latest/webhooks/using-webhooks/validating-webhook-deliveries#testing-the-webhook-payload-validation) which explains in prose about the SECRET, PLAIN_PAYLOAD and EXPECTED_SIGNATURE, the [verify_signature.sh](https://github.com/gm3dmo/the-power/blob/main/hookreceiver/verify_signature.sh) script is a demonstration of this using bash/openssl to derive `CALCULATED_SIGNATURE`:

```
CALCULATED_SIGNATURE=$(echo -n "$PLAIN_PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')
```

There are suggestions by AI tools that do this incorrectly.