Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qubyte/github_webhook_message_validator
A library to check that payloads from github webhooks are valid.
https://github.com/qubyte/github_webhook_message_validator
github-webhooks validate webhook
Last synced: 17 days ago
JSON representation
A library to check that payloads from github webhooks are valid.
- Host: GitHub
- URL: https://github.com/qubyte/github_webhook_message_validator
- Owner: qubyte
- License: mit
- Created: 2016-02-06T22:07:39.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2022-07-21T22:30:00.000Z (over 2 years ago)
- Last Synced: 2024-10-11T15:28:56.037Z (about 1 month ago)
- Topics: github-webhooks, validate, webhook
- Language: Rust
- Homepage: https://docs.rs/github_webhook_message_validator/
- Size: 20.5 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# GitHub webhook message validator
This package currently contains a single utility function, which may be used to validate the package
of a GitHub webhook request against a shared secret.Note that if you get the signature from the `X-Hub-Signature` header, you'll need to convert it to
bytes via hex. One way is to use the
[hex crate decode_to_slice function](https://docs.rs/hex/0.4.3/hex/fn.decode_to_slice.html).## Example
```rust
use github_webhook_message_validator::validate;let signature = &vec![
115, 109, 127, 147, 66, 242, 167, 210, 57, 175, 165, 81, 58, 75, 178, 40, 62, 14, 21, 136
];
let secret = b"some-secret";
let message = b"blah-blah-blah";assert_eq!(validate(secret, signature, message), true);