{"id":33951903,"url":"https://github.com/mitoop/laravel-signature","last_synced_at":"2026-04-09T00:31:28.819Z","repository":{"id":273306138,"uuid":"918073015","full_name":"mitoop/laravel-signature","owner":"mitoop","description":"A modern API signature verification system inspired by WeChat Pay v3, featuring timestamp-based replay protection and asymmetric encryption.  SDK: https://github.com/mitoop/signature-sdk","archived":false,"fork":false,"pushed_at":"2025-11-08T13:19:32.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-14T07:53:41.392Z","etag":null,"topics":["payment","signature"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/mitoop.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-17T07:42:50.000Z","updated_at":"2025-11-20T11:03:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed421c3b-1fd5-4133-adcb-ba3cc4f64f48","html_url":"https://github.com/mitoop/laravel-signature","commit_stats":null,"previous_names":["mitoop/laravel-signature"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/mitoop/laravel-signature","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitoop%2Flaravel-signature","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitoop%2Flaravel-signature/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitoop%2Flaravel-signature/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitoop%2Flaravel-signature/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitoop","download_url":"https://codeload.github.com/mitoop/laravel-signature/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitoop%2Flaravel-signature/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["payment","signature"],"created_at":"2025-12-12T19:12:07.733Z","updated_at":"2026-04-09T00:31:28.797Z","avatar_url":"https://github.com/mitoop.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Signature\n\nLaravel Signature is a robust and flexible package for handling API signature validation and generation. It supports multiple signing methods and can be easily extended to fit your application's needs.\n\n## ✨ Features\n\n- Supports **SHA256-RSA2048**, **SHA256-HMAC**, and **ED25519** signature methods.\n- Customizable brand prefixes for signatures.\n- Provides a flexible resolver interface for fetching application-specific configurations.\n- Easily integrates with Laravel's service container.\n\n## 📦 Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require mitoop/laravel-signature\n```\n\n## ⚙️ Configuration\n\nPublish the configuration file:\n\n```bash\nphp artisan vendor:publish --tag=config --provider=\"Mitoop\\\\LaravelSignature\\\\ServiceProvider\"\n```\n\nThis will create a `config/signature.php` file. Customize it as needed:\n\n```php\nreturn [\n    'brand' =\u003e 'your_brand',\n    'max_clock_offset' =\u003e 300,\n    'http_timeout' =\u003e 60,\n];\n```\n\n## 🛡️Signature Validation Middleware\nLaravel Signature provides a built-in middleware called ValidateSignature \nthat verifies incoming API requests to ensure \nthey are properly signed and not tampered with or replayed.\n\nYou can also create a custom middleware if you need more control over how the signature is verified or logged.\n#### ✅ Registering the Middleware\n```php\nuse Mitoop\\LaravelSignature\\Middlewares\\ValidateSignature;\n\nRoute::middleware([ValidateSignature::class])-\u003egroup(function () {\n    Route::post('/api/data/cities', [CityController::class, 'index']);\n});\n```\n\n## 🔄 Making Callback Requests\nLaravel Signature also provides a Client class to help you send signed HTTP requests, which is useful for performing callback notifications.\n#### ✅ Example: Sending a Signed Callback\n```php\nuse Mitoop\\LaravelSignature\\Http\\Client;\n\n$response = app(Client::class)-\u003epost('https://outer-service.com/api/notify', [\n    'order_id' =\u003e '123456',\n    'status' =\u003e 'success',\n], 'platform-private-key');\n```\n\n## References\n- [WechatPay-API-v3](https://wechatpay-api.gitbook.io/wechatpay-api-v3)\n- [Alipay-open-v3](https://opendocs.alipay.com/open-v3/054kaq)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitoop%2Flaravel-signature","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitoop%2Flaravel-signature","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitoop%2Flaravel-signature/lists"}