HMAC Request Signer

HMAC Request Signer is a PHP library that implements the HTTP HMAC Spec
to sign and verify RESTful Web API requests. It integrates with popular libraries such as
Symfony and Guzzle and can be used on both the server and client.
Installation
HMAC Request Signer can be installed with Composer
by adding it as a dependency to your project's composer.json file.
{
"require": {
"acquia/hmac-request": "*"
}
}
Please refer to Composer's documentation
for more detailed installation and usage instructions.
Usage
Sign an API request sent via Guzzle.
use Acquia\Hmac\Guzzle3\HmacAuthPlugin;
use Acquia\Hmac\RequestSigner;
use Guzzle\Http\Client;
$requestSigner = new RequestSigner();
$plugin = new HmacAuthPlugin($requestSigner, 'apiKeyId', 'secretKey');
$client = new Client('http://example.com');
$client->addSubscriber($plugin);
$client->get('/resource')->send();
Authenticate the request in a Symfony-powered app e.g. Silex.
use Acquia\Hmac\RequestAuthenticator;
use Acquia\Hmac\RequestSigner;
use Acquia\Hmac\Request\Symfony as RequestWrapper;
$requestWrapper = new RequestWrapper($request);
$authenticator = new RequestAuthenticator(new RequestSigner(), '+15 minutes');
$key = $authenticator->authenticate($requestWrapper, $keyLoader);
Contributing and Development
Submit changes using GitHub's standard pull request workflow.
All code should adhere to the following standards:
It is recommend to use the PHP Coding Standards Fixer
tool to ensure that code adheres to the coding standards mentioned above.
Refer to PHP Project Starter's documentation
for the Apache Ant targets supported by this project.