Skip to main content

HMAC Auth plugin for HTTPie.

Project description

HMAC auth plugin for HTTPie.

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

httpie-hmac-auth-0.2.2.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file httpie-hmac-auth-0.2.2.tar.gz.

File metadata

File hashes

Hashes for httpie-hmac-auth-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f124d872b29df0b4608ff4fd48b348283a0c9f2dc1edb0aaf2469e715b99b231
MD5 7cea86861431a7ea8c71baaa381737a5
BLAKE2b-256 61be996fc9f5e531df6d1c8cb90ed129c10d94acd10ed3aa0cbc2b39a0b329a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page