99designs / http-signatures-guzzle
Sign and verify HTTP messages with Guzzle
Installs: 32 245
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 70
Forks: 3
Open Issues: 0
Requires
- php: >=5.5
- 99designs/http-signatures: ^3.1
- guzzle/guzzle: ~3.9
Requires (Dev)
- phpunit/phpunit: ~4.1
This package is not auto-updated.
Last update: 2024-10-26 16:31:09 UTC
README
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.