{ "info": { "author": "Mozilla Services", "author_email": "services-dev@mozilla.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Programming Language :: Python" ], "description": "===============================================================\nmacauthlib: library for implementing MAC Access Authentication\n===============================================================\n\nThis is a low-level library for implementing MAC Access Authentication, a\nsimple HTTP request-signing scheme described in:\n\n http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01\n\nTo access resources using MAC Access Authentication, the client must have\nobtained a set of MAC credentials including an id and a secret key. They use\nthese credentials to make signed requests to the server.\n\nWhen accessing a protected resource, the server will generate a 401 challenge\nresponse with the scheme \"MAC\" as follows::\n\n > GET /protected_resource HTTP/1.1\n > Host: example.com\n\n < HTTP/1.1 401 Unauthorized\n < WWW-Authenticate: MAC\n\nThe client will use their MAC credentials to build a request signature and\ninclude it in the Authorization header like so::\n\n > GET /protected_resource HTTP/1.1\n > Host: example.com\n > Authorization: MAC id=\"h480djs93hd8\",\n > ts=\"1336363200\",\n > nonce=\"dj83hs9s\",\n > mac=\"bhCQXTVyfj5cmA9uKkPFx1zeOXM=\"\n\n < HTTP/1.1 200 OK\n < Content-Type: text/plain\n <\n < For your eyes only: secret data!\n\n\nThis library provices the low-level functions necessary to implement such\nan authentication scheme. For MAC Auth clients, it provides the following\nfunction:\n\n * sign_request(req, id, key, hashmod=sha1): sign a request using\n MAC Access Auth.\n\nFor MAC Auth servers, it provides the following functions:\n\n * get_id(req): get the claimed MAC Auth id from the request.\n\n * check_signature(req, key, hashmod=sha1): check that the request was\n signed with the given key.\n\nThe request objects passed to these functions can be any of a variety of\ncommon object types:\n\n * a WSGI environment dict\n * a webob.Request object\n * a requests.Request object\n * a string or file-like object of request data\n\nA typical use for a client program might be to install the sign_request\nfunction as an authentication hook when using the requests library, like this::\n\n import requests\n import functools\n import macauthlib\n\n # Hook up sign_request() to be called on every request.\n def auth_hook(req):\n macauthlib.sign_request(req, id=\"\", key=\"\")\n return req\n session = requests.session(hooks={\"pre_request\": auth_hook})\n\n # Then use the session as normal, and the auth is applied transparently.\n session.get(\"http://www.secret-data.com/get-my-data\")\n\n\nA typical use for a server program might be to verify requests using a WSGI\nmiddleware component, like this::\n\n class MACAuthMiddleware(object):\n\n # ...setup code goes here...\n\n def __call__(self, environ, start_response):\n\n # Find the identity claimed by the request.\n id = macauthlib.get_id(environ)\n\n # Look up their secret key.\n key = self.SECRET_KEYS[id]\n\n # If the signature is invalid, error out.\n if not macauthlib.check_signature(environ, key):\n start_response(\"401 Unauthorized\",\n [(\"WWW-Authenticate\", \"MAC\")])\n return [\"\"]\n\n # Otherwise continue to the main application.\n return self.application(environ, start_response)\n\n\n0.6.0 - 2013-06-25\n==================\n\n * Support for requests version 1.0.0 and greater; thanks bobbyrward.\n Unfortunately this is not backwards-compatible with older versions\n of requests.\n\n\n0.5.0 - 2012-11-26\n==================\n\n * Support for Python 3, via source-level compatibility.\n\n\n0.4.0 - 2012-09-31\n==================\n\n * Allow the main API functions to accept a WebOb Request object, a\n requests Request object, or a WSGI environ dict as first argument.\n This should make it easier to implement client programs.\n * macauthlib.sign_request() now returns the Authorization header value, which\n is useful if you pass it something immutable as the request to be signed.\n * Hide functions from macauthlib.utils that were previously available\n directly from macauthlib. This will ensure users import them from the\n canonical location.\n\n\n0.3.0 - 2012-07-11\n==================\n\n * Simplify API of the NonceCache class; it now provides a single method\n check_nonce() rather than separate is_fresh() and add_nonce() methods.\n\n\n0.2.0 - 2012-06-01\n==================\n\n * Fix a race condition bug in NonceCache.\n\n\n0.1.0 - 2012-02-27\n==================\n\n * Initial release.", "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/mozilla-services/macauthlib", "keywords": "authentication MAC Access HTTP request signing", "license": "MPLv2.0", "maintainer": null, "maintainer_email": null, "name": "macauthlib", "package_url": "https://pypi.org/project/macauthlib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/macauthlib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mozilla-services/macauthlib" }, "release_url": "https://pypi.org/project/macauthlib/0.6.0/", "requires_dist": null, "requires_python": null, "summary": "macauth", "version": "0.6.0" }, "last_serial": 794439, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "006151234293ec2912aeb56e6804a5d9", "sha256": "8be7f5ed40ea0569d238614f38843d45f574a16ef0e2911ba76ac12bd8e87452" }, "downloads": -1, "filename": "macauthlib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "006151234293ec2912aeb56e6804a5d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10700, "upload_time": "2012-02-27T07:29:46", "url": "https://files.pythonhosted.org/packages/4e/2b/79636854a873b492642d7a391588fe5e77008897a95dd60780a0f07cc1b5/macauthlib-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e86e9eded018d7b6ef3f0c94db2b4302", "sha256": "15f0e15570cb7f6bdcabf347cbf991b8831d515a0411bd18c291abc3f2d07920" }, "downloads": -1, "filename": "macauthlib-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e86e9eded018d7b6ef3f0c94db2b4302", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11196, "upload_time": "2012-06-01T07:47:49", "url": "https://files.pythonhosted.org/packages/ef/13/e96c75972a6fb7488e14bddb604a50630a3e396f48ef448ee0d3ae270c71/macauthlib-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e883ad3c87e13ad1d8309698046fc8bc", "sha256": "69b80f4729edc0585995f11be2a02bbb026ceb6ac5c3ac0c56c2d595b2dad772" }, "downloads": -1, "filename": "macauthlib-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e883ad3c87e13ad1d8309698046fc8bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11649, "upload_time": "2012-07-11T03:56:48", "url": "https://files.pythonhosted.org/packages/2a/9b/aa74c9b762765954f39273858f1e2b5cde626ba2f576aaaed78ecbf1db5c/macauthlib-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "82ea63e7c013aa42a1926110cc9da8cd", "sha256": "35bca5594662660b7351af405ea77baea33001d3bc3c586740006441c7147537" }, "downloads": -1, "filename": "macauthlib-0.4.0.tar.gz", "has_sig": false, "md5_digest": "82ea63e7c013aa42a1926110cc9da8cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14461, "upload_time": "2012-09-30T23:50:04", "url": "https://files.pythonhosted.org/packages/96/4a/3762440d30ce24d022ec4535ad23e9c0d9a5767082ca7fd0d40ab5b775a5/macauthlib-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0a178151e2234af1eb2050fcb0baa262", "sha256": "a080e3f25b93d90fe7919e16ab28caae56cac41773a19e95b22c63a1f3732344" }, "downloads": -1, "filename": "macauthlib-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0a178151e2234af1eb2050fcb0baa262", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15300, "upload_time": "2012-11-26T02:03:50", "url": "https://files.pythonhosted.org/packages/1a/f3/46e8ec9fd8ad73e4ff9addb817d56a1005fe3bc57f984f2e3cb85bee355e/macauthlib-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "f40df69905af19db3897edd59c94902d", "sha256": "ca8d6da49bd5f50fc34707e58fe66347cb9a579931b19911f115e6895b8b838f" }, "downloads": -1, "filename": "macauthlib-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f40df69905af19db3897edd59c94902d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14138, "upload_time": "2013-06-25T05:36:06", "url": "https://files.pythonhosted.org/packages/01/57/bdcf3ca90da2a5aee52169cc31a085291da324650db5addc8cfa7abc5b66/macauthlib-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f40df69905af19db3897edd59c94902d", "sha256": "ca8d6da49bd5f50fc34707e58fe66347cb9a579931b19911f115e6895b8b838f" }, "downloads": -1, "filename": "macauthlib-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f40df69905af19db3897edd59c94902d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14138, "upload_time": "2013-06-25T05:36:06", "url": "https://files.pythonhosted.org/packages/01/57/bdcf3ca90da2a5aee52169cc31a085291da324650db5addc8cfa7abc5b66/macauthlib-0.6.0.tar.gz" } ] }