{"id":18098688,"url":"https://github.com/krzko/github-webhook-validator","last_synced_at":"2025-04-06T04:18:33.906Z","repository":{"id":198811062,"uuid":"701556014","full_name":"krzko/github-webhook-validator","owner":"krzko","description":"🪝 A simple Go utility to validate GitHub webhook deliveries against a provided secret.","archived":false,"fork":false,"pushed_at":"2024-01-16T03:07:01.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T17:57:42.814Z","etag":null,"topics":["github","hmac","hmac-sha256","validate","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krzko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-06T22:52:34.000Z","updated_at":"2023-10-07T02:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"a052bc3a-95ac-4f83-b663-b159ea87f333","html_url":"https://github.com/krzko/github-webhook-validator","commit_stats":null,"previous_names":["krzko/github-webhook-validator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzko%2Fgithub-webhook-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzko%2Fgithub-webhook-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzko%2Fgithub-webhook-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzko%2Fgithub-webhook-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krzko","download_url":"https://codeload.github.com/krzko/github-webhook-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247431082,"owners_count":20937890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","hmac","hmac-sha256","validate","webhook"],"created_at":"2024-10-31T20:12:23.700Z","updated_at":"2025-04-06T04:18:33.888Z","avatar_url":"https://github.com/krzko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Webhook Validator\n\nA simple Go utility to validate GitHub webhook deliveries against a provided secret.\n\n## Overview\n\nThis utility sets up a web server that listens for `POST` requests on the `/webhook` endpoint and validates the signature of the incoming GitHub webhook payload against a predefined secret.\n\n\n## Usage\n\nClone the repository:\n\n```sh\ngit clone https://github.com/your-username/github-webhook-validator.git\ncd github-webhook-validator\ngo build\n```\n\n### Service\n\nRun:\n\n```sh\n export WEBHOOK_SECRET=\"It's a Secret to Everybody\"\n\n ./github-webhook-validator\n```\n\n### Client\n\nTo test the GitHub webhook validator utility using `curl`, you'll need to mimic a webhook request from GitHub. This means you'll need to create a `POST` request with a `X-Hub-Signature-256 header and a request body. The `X-Hub-Signature-256 header value should be the HMAC hex digest of the request body using your webhook secret.\n\nHere's a simplified example of how you might construct such a curl command:\n\n1. First, you'll need to compute the `X-Hub-Signature-256` header value. You can use a command-line tool like `openssl` to do this:\n\n```sh\necho -n \"your-payload-here\" | openssl dgst -sha256 -hmac $WEBHOOK_SECRET\n```\n\nReplace `\"your-payload-here\"` with the content of your webhook payload, and `$WEBHOOK_SECRET` with your webhook secret. This will output a hash value.\n\n2. Now, you can use curl to send a POST request to your utility, including the `X-Hub-Signature-256` header value you computed in the previous step:\n\n```sh\ncurl -X POST \\\n     -H \"Content-Type: application/json\" \\\n     -H \"X-Hub-Signature-256: sha256=$WEBHOOK_SECRET \\\n     --data '{\"payload\": \"your-payload-here\"}' \\\n     http://localhost:8080/webhook\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzko%2Fgithub-webhook-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrzko%2Fgithub-webhook-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzko%2Fgithub-webhook-validator/lists"}