Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ionbazan/aliyun-http-signer
PSR-7-compatible Alibaba Cloud API Gateway request signing implementation. Integrates with Guzzle ⛽️ and HttPlug 🐘.
https://github.com/ionbazan/aliyun-http-signer
alibaba-cloud alibabacloud aliyun api-gateway guzzle hmac httplug php psr-7 sign signature
Last synced: 4 months ago
JSON representation
PSR-7-compatible Alibaba Cloud API Gateway request signing implementation. Integrates with Guzzle ⛽️ and HttPlug 🐘.
- Host: GitHub
- URL: https://github.com/ionbazan/aliyun-http-signer
- Owner: IonBazan
- License: mit
- Created: 2020-04-28T08:55:05.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T15:44:52.000Z (over 1 year ago)
- Last Synced: 2024-10-06T20:46:02.235Z (4 months ago)
- Topics: alibaba-cloud, alibabacloud, aliyun, api-gateway, guzzle, hmac, httplug, php, psr-7, sign, signature
- Language: PHP
- Homepage: https://packagist.org/packages/ion-bazan/aliyun-http-signer
- Size: 25.4 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Alibaba Cloud API Gateway HTTP Request Signer for PHP
[![Latest version](https://img.shields.io/packagist/v/ion-bazan/aliyun-http-signer.svg)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/IonBazan/aliyun-http-signer/php.yml?branch=main)](https://github.com/IonBazan/aliyun-http-signer/actions)
[![PHP version](https://img.shields.io/packagist/php-v/ion-bazan/aliyun-http-signer.svg)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)
[![Codecov](https://img.shields.io/codecov/c/gh/IonBazan/aliyun-http-signer)](https://codecov.io/gh/IonBazan/aliyun-http-signer)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FIonBazan%2Faliyun-http-signer%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/IonBazan/aliyun-http-signer/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/IonBazan/aliyun-http-signer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/IonBazan/aliyun-http-signer/?branch=master)
[![Downloads](https://img.shields.io/packagist/dt/ion-bazan/aliyun-http-signer.svg)](https://packagist.org/packages/ion-bazan/aliyun-http-signer)
[![License](https://img.shields.io/packagist/l/ion-bazan/aliyun-http-signer.svg)](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
Use [Composer](https://getcomposer.org/) to install the package using:```bash
composer require ion-bazan/aliyun-http-signer
```# Usage
## 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
```php
signRequest($request);
}
```## Sign an API request using Guzzle middleware
```php
push($middleware);$client = new Client(['handler' => $stack]);
$response = $client->get('https://example.com/api/v1/test');
```## Sign an API request using HttPlug plugin
```php
sendRequest($request);
```# Bugs & issues
If you found a bug or security vulnerability, please [open an issue](https://github.com/IonBazan/aliyun-http-signer/issues/new)
# Contributing
Please feel free to submit Pull Requests adding new features or fixing bugs.
Please note that code must follow PSR-1, PSR-2, PSR-4 and PSR-7.