{ "info": { "author": "Jamon Camisso", "author_email": "jamonation+flask@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Security :: Cryptography", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "flask-HMAC\n----------\n\nThis module provides three functions to authenticate calls to a Flask route. The\nintended use case is for use with REST APIs. This module is not intended to do\nany kind of login or session management, it is simply designed to check that a\nclient is entitled to access a particular route in a Flask application, based on\nthe fact that it must possess a copy of the shared/secret key.\n\nUsage\n#####\n\nUsage consists of a server decorator or calling the render_hmac function, and a\nclient (or function in the server application) passing a base64 encoded HMAC.\n\nServer/Application Usage\n========================\n\nTo use this module in your application, add an 'HMAC_KEY' to your application's\nconfig object. For example:\n\n``HMAC_KEY = 2a21c5b3bff0299c0161470468f355e5b4afcf17a5f593ab68394e``\n\nThe three provided methods are:\n\n1. ``check_wrapper()`` decorator function, which wraps a route with a call to:\n\n2. ``compare_hmacs()`` function, which compares a client supplied token with a\nserver generated token. If the two match, return the decorated function. If not,\nreturn a 403 response.\n\n3. ``render_hmac()`` function, which, you guessed it, generates an hmac.\n\nTo use this module, instantiate it like this:\n\n.. code:: python\n\n from flask_hmac import Hmac\n app = Flask(__name__)\n hm = Hmac(app)\n\nNow you can decorate a route with the @hm.check_hmac decorator like so:\n\n.. code:: python\n\n @app.route('/path/to/api/endpoint', METHODS = ['PUT', 'POST'])\n @hm.check_hmac\n\nLastly, you can temporarily disable the check_hmac validation with a config\nvalue. Make a variable ``HMAC_DISARM = True`` in your app.config object. This\nsetting is useful for testing as it allows you to leave all decorator calls in\nplace for routes/blueprints.\n\nClient usage\n============\n\nTo pass an HMAC from your client, send a base64 url safe encoded header of the\nHMAC like this:\n\n``\"HMAC: UKW-EaC9diBPuRTgwaUprw4pf4h1nTJyClCT48dbhQo\"``\n\nEnsure that any trailing = characters are stripped and you should be all set.\n\nTODO\n####\n1. Allow using any kind of rendered HMAC like hexdigest instead of only base64\nurl safe.\n\n2. Create self.status_code and self.message variables for use on __init__ to\nallow custom responses on HMAC comparison failure.", "description_content_type": null, "docs_url": "https://pythonhosted.org/Flask-HMAC/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jamonation/flask-hmac", "keywords": null, "license": "WTFPL", "maintainer": null, "maintainer_email": null, "name": "Flask-HMAC", "package_url": "https://pypi.org/project/Flask-HMAC/", "platform": "any", "project_url": "https://pypi.org/project/Flask-HMAC/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jamonation/flask-hmac" }, "release_url": "https://pypi.org/project/Flask-HMAC/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Flask HMAC generator, checker, and route decorator", "version": "0.1.3" }, "last_serial": 1129953, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "ef23254c9a0e05aac40daf7ddf87e2de", "sha256": "576f9736a083b96d65135fa5097aec017a22e1806912a6d88bb99385e0b6cc54" }, "downloads": -1, "filename": "Flask-HMAC-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ef23254c9a0e05aac40daf7ddf87e2de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3848, "upload_time": "2014-05-29T01:19:55", "url": "https://files.pythonhosted.org/packages/59/b2/2d1080e0b78e44b55324347a5329d6017fda01f51259b5eebddf93151137/Flask-HMAC-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2452cf426244f6b184e7f0d3c035c9d4", "sha256": "48448592d065ccf2ba9f243e8d88d0b790196ccecba15a2de713d75f736504bc" }, "downloads": -1, "filename": "Flask-HMAC-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2452cf426244f6b184e7f0d3c035c9d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2014-06-19T01:21:41", "url": "https://files.pythonhosted.org/packages/75/e5/8084cac88a92a52c1b58c55578e1e7302d77f808523878bc8e5700cd6c1d/Flask-HMAC-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6b7dbb77859b3dbd09d616c1b9cdf905", "sha256": "c71cdd6c56d4a2b4de8de164ad3f1f2e2e5182498674b38acaf69367c70a5c90" }, "downloads": -1, "filename": "Flask-HMAC-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6b7dbb77859b3dbd09d616c1b9cdf905", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3945, "upload_time": "2014-06-19T02:19:41", "url": "https://files.pythonhosted.org/packages/5a/d7/cc208f3484fe250cb926381487f72dc344685c35a1aa92bf34ffea83c9e4/Flask-HMAC-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b7dbb77859b3dbd09d616c1b9cdf905", "sha256": "c71cdd6c56d4a2b4de8de164ad3f1f2e2e5182498674b38acaf69367c70a5c90" }, "downloads": -1, "filename": "Flask-HMAC-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6b7dbb77859b3dbd09d616c1b9cdf905", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3945, "upload_time": "2014-06-19T02:19:41", "url": "https://files.pythonhosted.org/packages/5a/d7/cc208f3484fe250cb926381487f72dc344685c35a1aa92bf34ffea83c9e4/Flask-HMAC-0.1.3.tar.gz" } ] }