{ "info": { "author": "HawkOwl", "author_email": "hawkowl@atleastfornow.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "httpsig_cffi\n============\n\n.. image:: https://travis-ci.org/hawkowl/httpsig_cffi.svg?branch=master\n :target: https://travis-ci.org/hawkowl/httpsig_cffi\n\nSign HTTP requests with secure signatures according to the IETF HTTP Signatures specification (`Draft 3`_).\nThis is `a fork`_ of the fork_ of the original module_ that was made to fully support both RSA and HMAC schemes as well as unit test both schemes to prove they work.\nThis particular fork moves from PyCrypto to Cryptography, which provides PyPy support.\n\nSee the original project_, original Python module_, original spec_, and `current IETF draft`_ for more details on the signing scheme.\n\n.. _project: https://github.com/joyent/node-http-signature\n.. _module: https://github.com/zzsnzmn/py-http-signature\n.. _fork: https://github.com/ahknight/httpsig\n.. _spec: https://github.com/joyent/node-http-signature/blob/master/http_signing.md\n.. _`current IETF draft`: https://datatracker.ietf.org/doc/draft-cavage-http-signatures/\n.. _`Draft 3`: http://tools.ietf.org/html/draft-cavage-http-signatures-03\n.. _`a fork`: https://github.com/hawkowl/httpsig_cffi\n\n\nRequirements\n------------\n\n* Python 2.7, 3.2, 3.3, 3.4, PyPy, PyPy3\n* Cryptography_\n\nOptional:\n\n* requests_\n\n.. _Cryptography: https://pypi.python.org/pypi/cryptography\n.. _requests: https://pypi.python.org/pypi/requests\n\n\nUsage\n-----\n\nReal documentation is forthcoming, but for now this should get you started.\n\nFor simple raw signing:\n\n.. code:: python\n\n import httpsig_cffi as httpsig\n\n secret = open('rsa_private.pem', 'rb').read()\n\n sig_maker = httpsig.Signer(secret=secret, algorithm='rsa-sha256')\n sig_maker.sign('hello world!')\n\nFor general use with web frameworks:\n\n.. code:: python\n\n import httpsig_cffi as httpsig\n\n key_id = \"Some Key ID\"\n secret = b'some big secret'\n\n hs = httpsig.HeaderSigner(key_id, secret, algorithm=\"hmac-sha256\", headers=['(request-target)', 'host', 'date'])\n signed_headers_dict = hs.sign({\"Date\": \"Tue, 01 Jan 2014 01:01:01 GMT\", \"Host\": \"example.com\"}, method=\"GET\", path=\"/api/1/object/1\")\n\nFor use with requests:\n\n.. code:: python\n\n import json\n import requests\n from httpsig_cffi.requests_auth import HTTPSignatureAuth\n\n secret = open('rsa_private.pem', 'rb').read()\n\n auth = HTTPSignatureAuth(key_id='Test', secret=secret)\n z = requests.get('https://api.example.com/path/to/endpoint',\n auth=auth, headers={'X-Api-Version': '~6.5'})\n\nClass initialization parameters\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nNote that keys and secrets should be bytes objects. At attempt will be made to convert them, but if that fails then exceptions will be thrown.\n\n.. code:: python\n\n httpsig_cffi.Signer(secret, algorithm='rsa-sha256')\n\n``secret``, in the case of an RSA signature, is a string containing private RSA pem. In the case of HMAC, it is a secret password.\n``algorithm`` is one of the six allowed signatures: ``rsa-sha1``, ``rsa-sha256``, ``rsa-sha512``, ``hmac-sha1``, ``hmac-sha256``,\n``hmac-sha512``.\n\n\n.. code:: python\n\n httpsig_cffi.requests_auth.HTTPSignatureAuth(key_id, secret, algorithm='rsa-sha256', headers=None)\n\n``key_id`` is the label by which the server system knows your RSA signature or password.\n``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.\n``secret`` and ``algorithm`` are as above.\n\n\nTests\n-----\n\nTo run tests::\n\n tox\n\n\nLicense\n-------\n\nBoth this module and the original module_ are licensed under the MIT license.\n\n\nhttpsig_cffi\n============\n\n15.0.0 (2015-Jan-16)\n--------------------\n\n* Move from PyCrypto to Cryptography.\n* Move to py.test.\n\n\nhttpsig (previous)\n==================\n\n1.1.0 (2014-Jul-24)\n-------------------\n\n* Changed \"(request-line)\" to \"(request-target)\" to comply with Draft 3.\n\n1.0.3 (2014-Jul-09)\n-------------------\n\n* Unified the default signing algo under one setting. Setting httpsig.sign.DEFAULT_SIGN_ALGORITHM changes it for all future instances.\n* Handle invalid params a little better.\n\n1.0.2 (2014-Jul-02)\n-------------------\n\n* Ensure we treat headers as ASCII strings.\n* Handle a case in the authorization header where there's garbage (non-keypairs) after the method name.\n\n1.0.1 (2014-Jul-02)\n-------------------\n\n* Python 3 support (2.7 + 3.2-3.4)\n* Updated tox and Travis CI configs to test the supported Python versions.\n* Updated README.\n\n1.0.0 (2014-Jul-01)\n-------------------\n* Written against http://tools.ietf.org/html/draft-cavage-http-signatures-02\n* Added \"setup.py test\" and tox support.\n* Added sign/verify unit tests for all currently-supported algorithms.\n* HeaderSigner and HeaderVerifier now share the same message-building logic.\n* The HTTP method in the message is now properly lower-case.\n* Resolved unit test failures.\n* Updated Verifier and HeaderVerifier to handle verifying both RSA and HMAC sigs.\n* Updated versioneer.\n* Updated contact/author info.\n* Removed stray keypair in test dir.\n* Removed SSH agent support.\n* Removed suport for reading keyfiles from disk as this is a huge security hole if this is used in a server framework like drf-httpsig.\n\n1.0b1 (2014-Jun-23)\n-------------------\n* Removed HTTP version from request-line, per spec (breaks backwards compatability).\n* Removed auto-generation of missing Date header (ensures client compatability).\n\n\nhttp-signature (previous)\n=========================\n\n0.2.0 (unreleased)\n~~~~~~~~~~~~~~~~~~\n\n* Update to newer spec (incompatible with prior version).\n* Handle `request-line` meta-header.\n* Allow secret to be a PEM encoded string.\n* Add test cases from spec.\n\n0.1.4 (2012-10-03)\n~~~~~~~~~~~~~~~~~~\n\n* Account for ssh now being re-merged into paramiko: either package is acceptable (but paramiko should ideally be >= 1.8.0)\n\n0.1.3 (2012-10-02)\n~~~~~~~~~~~~~~~~~~\n\n* Stop enabling `allow_agent` by default\n* Stop requiring `ssh` package by default -- it is imported only when `allow_agent=True`\n* Changed logic around ssh-agent: if one key is available, don't bother with any other authentication method\n* Changed logic around key file usage: if decryption fails, prompt for password\n* Bug fix: ssh-agent resulted in a nonsensical error if it found no correct keys (thanks, petervolpe)\n* Introduce versioneer.py", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hawkowl/httpsig_cffi", "keywords": "http,authorization,api,web", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "httpsig_cffi", "package_url": "https://pypi.org/project/httpsig_cffi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/httpsig_cffi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hawkowl/httpsig_cffi" }, "release_url": "https://pypi.org/project/httpsig_cffi/15.0.0/", "requires_dist": null, "requires_python": null, "summary": "Secure HTTP request signing using the HTTP Signature draft specification", "version": "15.0.0" }, "last_serial": 1385091, "releases": { "15.0.0": [ { "comment_text": "", "digests": { "md5": "1ce5e6906e3340a71f52484dd5d09278", "sha256": "62cfee03b8a43aaefb2b5b4da72514d581f3b527a24a1316152c08052eec9795" }, "downloads": -1, "filename": "httpsig_cffi-15.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1ce5e6906e3340a71f52484dd5d09278", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19296, "upload_time": "2015-01-16T15:30:51", "url": "https://files.pythonhosted.org/packages/93/f5/c9a213c0f906654c933f1192148d8aded2022678ad6bce8803d3300501c6/httpsig_cffi-15.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1558db5224cc2622986f0f611fdecadc", "sha256": "12b61008cd21cb18986de743959d63caaf8ac5b3cf3ee1d49fd1c53fe4f5d47a" }, "downloads": -1, "filename": "httpsig_cffi-15.0.0.tar.gz", "has_sig": false, "md5_digest": "1558db5224cc2622986f0f611fdecadc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22307, "upload_time": "2015-01-16T15:30:17", "url": "https://files.pythonhosted.org/packages/2b/26/09b2f9b962e821abb41a7b5d15b60aedeccfe68f7fafd2040617f0b27c29/httpsig_cffi-15.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ce5e6906e3340a71f52484dd5d09278", "sha256": "62cfee03b8a43aaefb2b5b4da72514d581f3b527a24a1316152c08052eec9795" }, "downloads": -1, "filename": "httpsig_cffi-15.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1ce5e6906e3340a71f52484dd5d09278", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19296, "upload_time": "2015-01-16T15:30:51", "url": "https://files.pythonhosted.org/packages/93/f5/c9a213c0f906654c933f1192148d8aded2022678ad6bce8803d3300501c6/httpsig_cffi-15.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1558db5224cc2622986f0f611fdecadc", "sha256": "12b61008cd21cb18986de743959d63caaf8ac5b3cf3ee1d49fd1c53fe4f5d47a" }, "downloads": -1, "filename": "httpsig_cffi-15.0.0.tar.gz", "has_sig": false, "md5_digest": "1558db5224cc2622986f0f611fdecadc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22307, "upload_time": "2015-01-16T15:30:17", "url": "https://files.pythonhosted.org/packages/2b/26/09b2f9b962e821abb41a7b5d15b60aedeccfe68f7fafd2040617f0b27c29/httpsig_cffi-15.0.0.tar.gz" } ] }