{"id":18821158,"url":"https://github.com/compwright/x-hub-signature-php","last_synced_at":"2025-09-21T00:16:55.707Z","repository":{"id":232455823,"uuid":"784391786","full_name":"compwright/x-hub-signature-php","owner":"compwright","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-10T01:11:49.000Z","size":26,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T13:07:55.435Z","etag":null,"topics":["webhook","x-hub-signature"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/compwright/x-hub-signature","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compwright.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"compwright"}},"created_at":"2024-04-09T18:56:05.000Z","updated_at":"2024-04-30T11:10:20.000Z","dependencies_parsed_at":"2024-04-09T23:51:17.920Z","dependency_job_id":"6a0e5c59-d995-43f4-b7a7-3aaf99dc7d0a","html_url":"https://github.com/compwright/x-hub-signature-php","commit_stats":null,"previous_names":["compwright/x-hub-signature-php"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/compwright/x-hub-signature-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fx-hub-signature-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fx-hub-signature-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fx-hub-signature-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fx-hub-signature-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compwright","download_url":"https://codeload.github.com/compwright/x-hub-signature-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fx-hub-signature-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266315763,"owners_count":23909802,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["webhook","x-hub-signature"],"created_at":"2024-11-08T00:34:53.150Z","updated_at":"2025-09-21T00:16:55.639Z","avatar_url":"https://github.com/compwright.png","language":"PHP","funding_links":["https://github.com/sponsors/compwright"],"categories":[],"sub_categories":[],"readme":"# X-Hub-Signature tools for PHP\n\n[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor\u0026message=❤\u0026logo=GitHub\u0026link=https://github.com/sponsors/compwright)](https://github.com/sponsors/compwright)\n\nX-Hub-Signature is a compact way to validate webhooks from [Facebook](https://developers.facebook.com/docs/graph-api/webhooks/), [GitHub](https://developer.github.com/webhooks/securing/), or any other source that uses this signature scheme.\n\nCare has been taken to avoid security issues, including timing attacks.\n\n## Getting Started\n\nTo install:\n\n```shell\ncomposer require compwright/x-hub-signature\n```\n\n## Usage\n\nSign a buffer containing a request body:\n\n```php\n\u003c?php\n\nuse Compwright\\XHubSignature;\nuse InvalidArgumentException;\n\n$signer = new XHubSignature\\Sha256();\n\n// Generate the signature header for an outbound webhook, i.e.\n//\n//   X-Hub-Signature-256: sha256=...\n//\n$headerName = $signer-\u003egetHeaderName();\n$headerValue = $signer-\u003esign($requestBody, $secret);\n$signatureHeader = $headerName . ': ' . $headerValue;\n\n// Verify an inbound webhook\n$isValid = $signer-\u003everify($signatureHeaderValue, $requestBody, $secret);\nif ($isValid === false) {\n    throw new InvalidArgumentException('Bad Request');\n}\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fx-hub-signature-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompwright%2Fx-hub-signature-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fx-hub-signature-php/lists"}