{ "info": { "author": "Elvio Toccalino", "author_email": "me@etoccalino.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Security" ], "description": "===================================\ndjango-rest-framework-httpsignature\n===================================\n\n.. image:: https://travis-ci.org/etoccalino/django-rest-framework-httpsignature.png?branch=master\n :target: https://travis-ci.org/etoccalino/django-rest-framework-httpsignature\n\n\nOverview\n========\n\nProvides `HTTP Signature`_ support for `Django REST framework`_. The HTTP Signature package provides a way to achieve origin authentication and message integrity for HTTP messages. Similar to Amazon's `HTTP Signature scheme`_, used by many of its services. The `HTTP Signature`_ specification is currently an IETF draft.\n\n.. contents::\n\nInstallation\n============\n\nInstalling the package via the repository::\n\n pip install djangorestframework-httpsignature\n\nOlder version of ``pip`` don't support the Wheel format (which is how ``httpsig`` is distributed). The problem manifests when installing the requirements, ``pip`` will complain that it cannot find a ``httpsig``. In such cases, ``pip`` needs to be upgraded::\n\n pip install --upgrade pip\n\nAnother possible problem: while installing via ``python setup.py install`` you may encounter::\n\n No local packages or download links found for httpsig\n error: Could not find suitable distribution for Requirement.parse('httpsig')\n\nIf that is the case, use ``pip install httpsig`` to install the ``httpsig`` package and retry ``python setup.py install``.\n\nRunning the tests\n=================\n\nTo run the tests for the packages, use the following command on the repository root directory::\n\n python manage.py test\n\nUsage\n=====\n\nTo authenticate HTTP requests via HTTP signature, you need to:\n\n1. Install this package in your Django project, as instructed in `Installation`_.\n2. Add ``rest_framework_httpsignature`` to your ``settings.py`` INSTALLED_APPS.\n3. In your app code, extend the ``SignatureAuthentication`` class, as follows::\n\n # my_api/auth.py\n\n from rest_framework_httpsignature.authentication import SignatureAuthentication\n\n class MyAPISignatureAuthentication(SignatureAuthentication):\n # The HTTP header used to pass the consumer key ID.\n # Defaults to 'X-Api-Key'.\n API_KEY_HEADER = 'X-Api-Key'\n\n # A method to fetch (User instance, user_secret_string) from the\n # consumer key ID, or None in case it is not found.\n def fetch_user_data(self, api_key):\n # ...\n # example implementation:\n try:\n user = User.objects.get(api_key=api_key)\n return (user, user.secret)\n except User.DoesNotExist:\n return None\n\n\n4. Configure Django REST framework to use you authentication class; e.g.::\n\n # my_project/settings.py\n\n # ...\n REST_FRAMEWORK = {\n 'DEFAULT_AUTHENTICATION_CLASSES': (\n 'my_api.auth.MyAPISignatureAuthentication',\n ),\n 'DEFAULT_PERMISSION_CLASSES': (\n 'rest_framework.permissions.IsAuthenticated',\n )\n }\n # The above will force HTTP signature for all requests.\n # ...\n\n\nRoadmap\n=======\n\n- Currently, the library only support HMAC SHA256 for signing.\n- The ``REQUIREMENTS.txt`` file is fairly strict. It is very possible that previous versions of Django and Django REST framework are supported.\n- Since HTTP Signature uses a HTTP header for the request date and time, the authentication class could deal with request expiry.\n\n\nExample usage & session w/cURL\n==============================\n\nAssuming the setup detailed in `Usage`_, a project running on ``localhost:8000`` could be probed with cURL as follows::\n\n ~$ SSS=Base64(Hmac(SECRET, \"Date: Mon, 17 Feb 2014 06:11:05 GMT\", SHA256))\n ~$ curl -v -H 'Date: \"Mon, 17 Feb 2014 06:11:05 GMT\"' -H 'Authorization: Signature keyId=\"my-key\",algorithm=\"hmac-sha256\",headers=\"date\",signature=\"SSS\"'\n\nAnd for a much less painful example, check out the `httpsig package`_ documentation to use ``requests`` and ``httpsig``.\n\n\n.. References:\n.. _`HTTP Signature`: https://datatracker.ietf.org/doc/draft-cavage-http-signatures/\n.. _`Django REST framework`: http://django-rest-framework.org/\n.. _`HTTP Signature scheme`: http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n.. _`httpsig package`: https://pypi.python.org/pypi/httpsig", "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/etoccalino/django-rest-framework-httpsignature", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "djangorestframework-httpsignature", "package_url": "https://pypi.org/project/djangorestframework-httpsignature/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djangorestframework-httpsignature/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/etoccalino/django-rest-framework-httpsignature" }, "release_url": "https://pypi.org/project/djangorestframework-httpsignature/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "HTTP Signature support for Django REST framework", "version": "1.0.0" }, "last_serial": 1530040, "releases": { "0.1.2": [], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6ddaa2ab64965a7132a1d4c6b3cdbf60", "sha256": "a25e9313ac7fdbb532e4e1caa99c363c8b19dc1481499473837685f2b3aa6a73" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.3.tar.gz", "has_sig": true, "md5_digest": "6ddaa2ab64965a7132a1d4c6b3cdbf60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7177, "upload_time": "2014-02-20T03:15:18", "url": "https://files.pythonhosted.org/packages/bf/74/06dd061390640be50ad054f714fd3fdaa006452db9dc05fc59596d0b83aa/djangorestframework-httpsignature-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a9aa8f50cdcea3681896e2ad125d5cd6", "sha256": "550a44ca8ae9cecc6515ac26fc55b4896dcb7b5be785f17d03e67b00558b34ad" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a9aa8f50cdcea3681896e2ad125d5cd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7278, "upload_time": "2014-06-13T14:58:04", "url": "https://files.pythonhosted.org/packages/77/74/e2b22d4e04c40c9d8dc1e1e415c17c3c1853dc59a75b5ba2638aff3409b0/djangorestframework-httpsignature-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "24d71da2342eabb653070bad8e39e47a", "sha256": "a9422ea5833d5ce5c0fdaeaf5d5f73c29d5845c1d3fa9a97c212a4805233548d" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.5.tar.gz", "has_sig": false, "md5_digest": "24d71da2342eabb653070bad8e39e47a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8288, "upload_time": "2014-06-13T15:59:26", "url": "https://files.pythonhosted.org/packages/b4/34/9944df21a97f5ce350c17ccc0fe4d43157c7665124241c6edb1d42c8de8e/djangorestframework-httpsignature-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "082f5b9f912511579f5e324b5956affb", "sha256": "366e86b55a5d109eb397623c92eca0c9f52f23e5e6cd236a94a040ebc6a0f0d3" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.6.tar.gz", "has_sig": false, "md5_digest": "082f5b9f912511579f5e324b5956affb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8339, "upload_time": "2014-07-06T13:50:30", "url": "https://files.pythonhosted.org/packages/d8/84/d39a49fba00d0027ad6f6bf478f7975ec2ab39b3fd52230d664e38284d06/djangorestframework-httpsignature-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "ddc68bdf0b40cb4eff5a97e5780cc3a7", "sha256": "e0de1e7cd1462e310640fc4900d1699ac53ec44a228c015b629aff48cf5a6247" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.7.tar.gz", "has_sig": false, "md5_digest": "ddc68bdf0b40cb4eff5a97e5780cc3a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8405, "upload_time": "2014-08-02T13:58:38", "url": "https://files.pythonhosted.org/packages/ff/a9/fa311962aa240614f135c9f808f346de34afeae51cb2b0b02f4b46f9b5fa/djangorestframework-httpsignature-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "0b5d6f4832efbb4d303ea066caef7da8", "sha256": "55776871c24872fce3c50bc8ea01196e8a3232a255f1d96f30ed35af386ad6cb" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.1.8.tar.gz", "has_sig": false, "md5_digest": "0b5d6f4832efbb4d303ea066caef7da8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8536, "upload_time": "2014-08-18T16:48:46", "url": "https://files.pythonhosted.org/packages/9b/92/9dc31337b6a74260c9ed0e1bafccb594928e2b470a6c63b823814cd8987f/djangorestframework-httpsignature-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4b84220d29ca00bc285782a9966707f4", "sha256": "0a027dd87c9513916b9138802786d6c939572ce5bc111c71d50f5c3e17fa5dba" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4b84220d29ca00bc285782a9966707f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7303, "upload_time": "2014-08-03T20:14:38", "url": "https://files.pythonhosted.org/packages/58/32/f4a9a7966b22bf37600721b349535684ed9a74b80adb028661bc37e46a3b/djangorestframework-httpsignature-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "d33af9061953603901c072078c83f902", "sha256": "963d4fb6ae93e5b0df73d549fd543bf95fa78215d9f67f9f142583b14cd6bd6d" }, "downloads": -1, "filename": "djangorestframework-httpsignature-0.2.1.tar.gz", "has_sig": false, "md5_digest": "d33af9061953603901c072078c83f902", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7697, "upload_time": "2014-08-18T20:28:54", "url": "https://files.pythonhosted.org/packages/0e/cb/fe9554e8f4832cd17af5cdefba82e964b22b1f11a1adf678e8223fb595ad/djangorestframework-httpsignature-0.2.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "8a3844c735c8f69d8785dde485c17c39", "sha256": "5006ab9cda6891cf030b27c92badf22c460a3eb1a8d11b13eac8f95da9c26b06" }, "downloads": -1, "filename": "djangorestframework-httpsignature-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8a3844c735c8f69d8785dde485c17c39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7990, "upload_time": "2015-05-02T01:20:16", "url": "https://files.pythonhosted.org/packages/3d/99/965607b9309ee15225dd6d4635efc3ff80bf5269853a1f90d4fdbce4f8bb/djangorestframework-httpsignature-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a3844c735c8f69d8785dde485c17c39", "sha256": "5006ab9cda6891cf030b27c92badf22c460a3eb1a8d11b13eac8f95da9c26b06" }, "downloads": -1, "filename": "djangorestframework-httpsignature-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8a3844c735c8f69d8785dde485c17c39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7990, "upload_time": "2015-05-02T01:20:16", "url": "https://files.pythonhosted.org/packages/3d/99/965607b9309ee15225dd6d4635efc3ff80bf5269853a1f90d4fdbce4f8bb/djangorestframework-httpsignature-1.0.0.tar.gz" } ] }