Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install http-signature

How to install http_signature

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install http-signature
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.2
0.1.4Never BuiltWhy not?
0.1.2 Available View build log
Windows (64-bit)
0.1.2
0.1.4Never BuiltWhy not?
0.1.2 Available View build log
Mac OS X (10.5+)
0.1.2
0.1.4Never BuiltWhy not?
0.1.2 Available View build log
Linux (32-bit)
0.1.4 Available View build log
0.1.2 Available View build log
Linux (64-bit)
0.1.4 Available View build log
0.1.2 Available View build log
 
License
MIT
Imports
Lastest release
version 0.1.4 on Nov 26th, 2012

Sign http requests with secure signatures.

Requirements

  • PyCrypto

Optional:

  • ssh or paramiko >= 1.8.0 (for ssh-agent integration)
  • requests

Usage

for simple raw signing:

import http_signature

sig_maker = http_signature.Signer(secret='test.pem', algorithm='rsa-sha256')
sig_maker.sign('hello world!')

for use with requests:

import json
import requests
from http_signature.requests_auth import HTTPSignatureAuth

auth = HTTPSignatureAuth(key_id='Test', secret='test.pem')
z = requests.get('https://api.joyentcloud.com/my/packages/Small+1GB',
                         auth=auth, headers={'X-Api-Version': '~6.5'})
Class initialization parameters
http_signature.Signer(secret='', algorithm='rsa-sha256', allow_agent=False)

secret, in the case of an rsa signature, is a path to a private RSA pem file. In the case of an hmac, it is a secret password. algorithm is one of the six allowed signatures: rsa-sha1, rsa-sha256, rsa-sha512, hmac-sha1, hmac-sha256, hmac-sha512. allow_agent uses the ssh package to find an ssh-agent instance running, and uses that to sign all requests. Note that if so, this overrides manual selection of the signing algorithm to rsa-sha1.

http_signature.requests_auth.HTTPSignatureAuth(key_id='', secret='', algorithm='rsa-sha256', headers=None, allow_agent=False)

key_id is the label by which the server system knows your RSA signature or password. headers is the list of HTTP headers that are concatenated and used as signing objects. By default it is the specification's minimum, the Date HTTP header. secret, algorithm, and allow_agent are as above.

License

MIT

Changes

0.1.4 (2012-10-03)
  • Account for ssh now being re-merged into paramiko: either package is acceptable (but paramiko should ideally be >= 1.8.0)
0.1.3 (2012-10-02)
  • Stop enabling allow_agent by default
  • Stop requiring ssh package by default -- it is imported only when allow_agent=True
  • Changed logic around ssh-agent: if one key is available, don't bother with any other authentication method
  • Changed logic around key file usage: if decryption fails, prompt for password
  • Bug fix: ssh-agent resulted in a nonsensical error if it found no correct keys (thanks, petervolpe)
  • Introduce versioneer.py

Subscribe to package updates

Last updated Nov 26th, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.