PHPackages                             ion-bazan/aliyun-http-signer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. ion-bazan/aliyun-http-signer

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ion-bazan/aliyun-http-signer
============================

PSR-7-compatible Alibaba Cloud API Gateway request signing implementation. Integrates with Guzzle ⛽️ and HttPlug 🐘.

v1.3.0(11mo ago)647.4k↓22.1%11MITPHPPHP ^8.1CI passing

Since Apr 28Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/IonBazan/aliyun-http-signer)[ Packagist](https://packagist.org/packages/ion-bazan/aliyun-http-signer)[ Docs](https://github.com/IonBazan/aliyun-http-signer)[ GitHub Sponsors](https://github.com/IonBazan)[ RSS](/packages/ion-bazan-aliyun-http-signer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (9)Versions (8)Used By (1)

Alibaba Cloud API Gateway HTTP Request Signer for PHP
=====================================================

[](#alibaba-cloud-api-gateway-http-request-signer-for-php)

[![Latest version](https://camo.githubusercontent.com/fd8a2ae91735d84993e4998cb334d31045ef95c15eea33634a90fbf6fc4e988d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696f6e2d62617a616e2f616c6979756e2d687474702d7369676e65722e737667)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)[![GitHub Workflow Status](https://camo.githubusercontent.com/93d1c449ca1e8c9e291ad1310eebcbab8e68d0ff4e84f044fa5e60d08b9929f9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f496f6e42617a616e2f616c6979756e2d687474702d7369676e65722f7068702e796d6c3f6272616e63683d6d61696e)](https://github.com/IonBazan/aliyun-http-signer/actions)[![PHP version](https://camo.githubusercontent.com/ec0ef8239ff6654d314584605bb0ee7ae7e5ba631448c149bf8ba0d3dcc38928/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696f6e2d62617a616e2f616c6979756e2d687474702d7369676e65722e737667)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)[![Codecov](https://camo.githubusercontent.com/a44c989f5175f29c342494efb802e2ef80db06bf1a051e67da0cb669077352df/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f496f6e42617a616e2f616c6979756e2d687474702d7369676e6572)](https://codecov.io/gh/IonBazan/aliyun-http-signer)[![Mutation testing badge](https://camo.githubusercontent.com/d73e90c605e518e506958456304b384b49f9ffa1d6dcd1820087b3f82470798b/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246496f6e42617a616e253246616c6979756e2d687474702d7369676e65722532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/IonBazan/aliyun-http-signer/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/91e7f613c0b99a8f3025d4f8dea533db011fe493134bf2ff10935d3de4de2c4e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496f6e42617a616e2f616c6979756e2d687474702d7369676e65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/IonBazan/aliyun-http-signer/?branch=master)[![Downloads](https://camo.githubusercontent.com/01317dfeab41c51eb16c19041f387488e5ba0c6201a81cc533b3d6db20ade0f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696f6e2d62617a616e2f616c6979756e2d687474702d7369676e65722e737667)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)[![License](https://camo.githubusercontent.com/324cbb7845a3bdb302c8ccce302004f2f4961c0c208e2c63fa05718816227f16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696f6e2d62617a616e2f616c6979756e2d687474702d7369676e65722e737667)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)

This library implements [Alibaba Cloud API Gateway request signature](https://www.alibabacloud.com/help/doc-detail/29475.htm) calculation for [PSR-7](https://www.php-fig.org/psr/psr-7/) compatible requests. It integrates with [Guzzle](https://github.com/guzzle/guzzle) and [HttPlug](https://github.com/php-http/httplug) but can be used with any PSR-7-compatible client.

Installation
============

[](#installation)

Use [Composer](https://getcomposer.org/) to install the package using:

```
composer require ion-bazan/aliyun-http-signer
```

Usage
=====

[](#usage)

Symfony integration
-------------------

[](#symfony-integration)

The easiest way to integrate the package with Symfony is using [GuzzleBundleAliyunSignerPlugin](https://github.com/IonBazan/GuzzleBundleAliyunSignerPlugin) with Guzzle Bundle.

To use it with HttplugBundle or any other Bundle, simply register `RequestSigner`, `Key` and `RequestSignerPlugin` as services and inject the credentials to the `Key` service.

Sign a PSR-7-compatible API request
-----------------------------------

[](#sign-a-psr-7-compatible-api-request)

```
