定制 lelectrolux/hmac-utils 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lelectrolux/hmac-utils

最新稳定版本:3.0.0

Composer 安装命令:

composer require lelectrolux/hmac-utils

包简介

Utilities for Hmac authorisation

README 文档

README

Validate server to server messaging through Hmac signatures in a laravel project

Installation

First install the package

composer require lelectrolux/hmac-utils

Then, publish the config file, and fill the necessary .env values

php artisan vendor:publish --provider=Lelectrolux\Hmac\Laravel\ServiceProvider

Use-cases

Most of the logic is abstracted for 2 use-cases

My server recieves a Hmac signed request

Use the Laravel middleware on your corresponding route

use Lelectrolux\Hmac\Laravel\Middleware;

// Any key => secret pair allowed
Route::get('/some/uri')->middleware(Middleware::class)

// Ony those keyed by foo or bar
Route::get('/some/uri')->middleware(Middleware::class.':foo,bar')

The hmac uuid will be made available in the laravel context at the key 'hmac_request_uuid' 🔗.

My server sends a Hmac signed through guzzle

Use the Guzzle middleware factory in your Http client call chain

use Illuminate\Support\Facades\Http;
use Lelectrolux\Hmac\Guzzle\MiddlewareFactory;

Http::createPendingRequest()->withMiddleware($middlewareFactory->make('foo'))->...

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-08-26