Skip to content
Guzzle 3 support for 99designs http-signatures library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/HttpSignatures/Guzzle
tests
.gitignore
.travis.yml
LICENSE.txt
README.md
composer.json
phpunit.xml.dist

README.md

HTTP Signatures Guzzle 3

Build Status

Adds 99designs/http-signatures support to Guzzle 3.
For Guzzle 4 see the 99designs/http-signatures-guzzlehttp repo.

Signing with Guzzle 3

This library includes support for automatically signing Guzzle requests using an event subscriber.

use HttpSignatures\Context;
use HttpSignatures\Guzzle\RequestSubscriber;

$context = new Context(array(
  'keys' => array('examplekey' => 'secret-key-here'),
  'algorithm' => 'hmac-sha256',
  'headers' => array('(request-target)', 'Date', 'Accept'),
));

$client = new \Guzzle\Http\Client('http://example.org');
$client->addSubscriber(new RequestSubscriber($context));

// The below will now send a signed request to: http://example.org/path?query=123
$client->get('/path?query=123', array(
  'Date' => 'Wed, 30 Jul 2014 16:40:19 -0700',
  'Accept' => 'llamas',
))->send();

Contributing

Pull Requests are welcome.

You can’t perform that action at this time.