HMAC Auth plugin for HTTPie.
Project description
HTTP requests will be signed with a shared secret key using HMAC. The string to sign format is:
<Method>\n
<Content-MD5>\n
<Content-Type>\n
<Date>\n
<URL>
Example String-to-sign
POST
vVqHE1k/uBRCoWe0FAh95g==
application/json
Tue, 12 Jan 2016 14:57:28 GMT
/api/v1/avatars
Example Authorization Header with HMAC signature
Authorization: HMAC XH+v0qhV4i/89y/DT2OOJx9Kjf3f/0j+w2aGZk625nU=
Installation
$ pip install httpie-hmac-auth
You should now see hmac under --auth-type in $ http --help output.
Usage
$ http --auth-type=hmac --auth='client:secret' example.org
Examples
To authenticate a client request when an access key is required by the server to lookup the shared secret:
$ http --auth-type=hmac --auth="client:secret" example.org
To authenticate a client request when there is no requirement for a client to supply an access key:
$ http --auth-type=hmac --auth=":secret" example.org
License
Copyright (c) 2016 The Guardian. Available under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file httpie-hmac-auth-0.2.0.tar.gz
.
File metadata
- Download URL: httpie-hmac-auth-0.2.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 739cdb63de83f521e31933dc669738dd85cb978655341f332015fccb23c3fa81 |
|
MD5 | 09c8ce377db0025be3065eba74f6d3ec |
|
BLAKE2b-256 | 2e3ef4b531c7e25dd609260bfd509f0aa4492aa6fde14fab88dc4de4a432fe31 |