Skip to content

Repo sync #27376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2023
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
17 changes: 17 additions & 0 deletions content/webhooks-and-events/webhooks/securing-your-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ Your language and server implementations may differ from the following examples.

- Using a plain `==` operator is **not advised**. A method like [`secure_compare`][secure_compare] performs a "constant time" string comparison, which helps mitigate certain timing attacks against regular equality operators.

### Test values

Regardless of the programming language that you use to implement HMAC verification in your code, you can use the following `secret` and `payload` values to verify that your implementation is correct.

- secret: "It's a Secret to Everybody"
- payload: "Hello, World!"

If your implementation is correct and uses the SHA-256 algorithm, the signatures that you generate should match the following signature values:

- signature: 757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17
- x-hub-signature: sha256=757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17

If your implementation is correct and uses the SHA-1 algorithm, the signatures that you generate should match the following signature values:

- signature: 01dc10d0c83e72ed246219cdd91669667fe2ca59
- x-hub-signature: sha1=01dc10d0c83e72ed246219cdd91669667fe2ca59

### Ruby example

For example, you can define the following `verify_signature` function:
Expand Down