{ "info": { "author": "Oleh Kuchuk", "author_email": "kuchuklehjs@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "## aiohttp-jwt \n[![stability-unstable](https://img.shields.io/badge/stability-unstable-yellow.svg)](https://img.shields.io/badge/stability-unstable-yellow.svg)\n[![Updates](https://pyup.io/repos/github/hzlmn/aiohttp-jwt/shield.svg)](https://pyup.io/repos/github/hzlmn/aiohttp-jwt/)\n[![Python 3](https://pyup.io/repos/github/hzlmn/aiohttp-jwt/python-3-shield.svg)](https://pyup.io/repos/github/hzlmn/aiohttp-jwt/)\n[![Build Status](https://travis-ci.org/hzlmn/aiohttp-jwt.svg?branch=master)](https://travis-ci.org/hzlmn/aiohttp-jwt)\n[![codecov](https://codecov.io/gh/hzlmn/aiohttp-jwt/branch/master/graph/badge.svg)](https://codecov.io/gh/hzlmn/aiohttp-jwt)\n[![Documentation Status](https://readthedocs.org/projects/aiohttp-jwt/badge/?version=latest)](http://aiohttp-jwt.readthedocs.io/en/latest/?badge=latest)\n\n\n> The API is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. Backwards-compatibility will be maintained if reasonable.\n\nThe library provides `aiohttp` middleware and helper utils for working with JSON web tokens.\n\n * Works on Python3.5+\n * MIT License\n * Latest docs [TBD]()\n * Contributions are highly welcome!\n\n\n## Requirements\n - [Aiohttp >= 2.3.5](https://github.com/aio-libs/aiohttp)\n - [PyJWT](https://github.com/jpadilla/pyjwt)\n\n\n## Install\n```bash\n$ pip install aiohttp_jwt\n```\n\n## Simple Usage\n`server.py`\n```python\nimport jwt\nfrom aiohttp import web\n\nfrom aiohttp_jwt import JWTMiddleware\n\nsharable_secret = 'secret'\n\n\nasync def protected_handler(request):\n return web.json_response({'user': request['payload']})\n\n\napp = web.Application(\n middlewares=[\n JWTMiddleware(sharable_secret),\n ]\n)\n\napp.router.add_get('/protected', protected_handler)\n\nif __name__ == '__main__':\n web.run_app(app)\n\n```\n\n`client.py`\n```python\nimport asyncio\n\nimport aiohttp\nimport async_timeout\n\n\nasync def fetch(session, url, headers=None):\n async with async_timeout.timeout(10):\n async with session.get(url, headers=headers) as response:\n return await response.json()\n\n\nasync def main():\n async with aiohttp.ClientSession() as session:\n response = await fetch(\n session,\n 'http://localhost:8080/protected',\n headers={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InRlc3QifQ.pyNsXX_vNsUvdt6xu13F1Gs1zGELT4Va8a38eG5svBA'})\n print(response)\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n\n```\n\n## Examples\n- [Basic Example](/example/basic.py)\n- [Permissions control](/example/permissions.py)\n\n\n\n## Credits\n\nThis module inspired by official [auth0/express-jwt](https://github.com/auth0/express-jwt) middleware and\n[express-jwt-permissions](https://github.com/MichielDeMey/express-jwt-permissions) extension.\n\n\n## Related packages\n For advanced security facilities check [aio-libs/aiohttp_security](https://github.com/aio-libs/aiohttp-security)\n\n### License\nMIT License\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hzlmn/aiohttp-jwt", "keywords": "asyncio,aiohttp,jwt", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aiohttp-jwt", "package_url": "https://pypi.org/project/aiohttp-jwt/", "platform": "", "project_url": "https://pypi.org/project/aiohttp-jwt/", "project_urls": { "Homepage": "https://github.com/hzlmn/aiohttp-jwt" }, "release_url": "https://pypi.org/project/aiohttp-jwt/0.4.0/", "requires_dist": [ "aiohttp (>=2.3.5)", "PyJWT (>=1.6.0)" ], "requires_python": "", "summary": "aiohttp middleware for working with JWT", "version": "0.4.0" }, "last_serial": 4864969, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "230579d503b53f3d4ea4ccfe5d4394d8", "sha256": "10372b7f0bb376de521f307d3702e9659d4132e2c5dc73a293d153e0070e5721" }, "downloads": -1, "filename": "aiohttp_jwt-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "230579d503b53f3d4ea4ccfe5d4394d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6682, "upload_time": "2018-03-14T20:54:05", "url": "https://files.pythonhosted.org/packages/92/88/b82651262522e52772190d40e63c44c89a748240d78f07ad72b97748e711/aiohttp_jwt-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cde574fc3d4fa00f8ee40b4511dde92", "sha256": "2751992fc7c558636165846191853e63aa30e46907739322e2036c1ee6545ebf" }, "downloads": -1, "filename": "aiohttp_jwt-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1cde574fc3d4fa00f8ee40b4511dde92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4265, "upload_time": "2018-03-14T20:54:08", "url": "https://files.pythonhosted.org/packages/c0/cd/0669116e72353dbc712385b52fe89fab8f3f9bddd76edc755e07f1ff73bf/aiohttp_jwt-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e2b82d8393ccf4b27f400fecc84a357d", "sha256": "c81d69d84109025b7e66237263f8d5adfa71fb8e3513659a8687fb3094f724bf" }, "downloads": -1, "filename": "aiohttp_jwt-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e2b82d8393ccf4b27f400fecc84a357d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6743, "upload_time": "2018-03-17T14:21:33", "url": "https://files.pythonhosted.org/packages/68/84/bb4f31167d499f47f39e5602e1712f2361e655c0527462386a8edc2597cc/aiohttp_jwt-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9c03b5728c1cec4f92bca8fa98bc5f1", "sha256": "5c07cd0973bc4ff725464f73e557a93d540e91407c8dcb2b18aa31dbba05b8c6" }, "downloads": -1, "filename": "aiohttp_jwt-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d9c03b5728c1cec4f92bca8fa98bc5f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4294, "upload_time": "2018-03-17T14:21:34", "url": "https://files.pythonhosted.org/packages/28/10/9f374c7c01ce5b6258e0919f6be407053a29468c95cef6c60fd037fc8421/aiohttp_jwt-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9784afb324e18b38690c484797a918cb", "sha256": "6d6cfee88fa30b4e85c2b595721d87f2cf39d43e76c6603724cf6367b7a8e0dd" }, "downloads": -1, "filename": "aiohttp_jwt-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9784afb324e18b38690c484797a918cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8497, "upload_time": "2018-03-28T08:58:26", "url": "https://files.pythonhosted.org/packages/38/b0/f24d6aba0dc50765b6787d75859d845ff597440a57891f1b1c96105cb84a/aiohttp_jwt-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "824e2f7bb77856ab649c7fa84d34f2a3", "sha256": "53e720594a16301e9c87a96e468a86f3f59b4a58d5651278dd9b6c414ca09531" }, "downloads": -1, "filename": "aiohttp_jwt-0.1.0.tar.gz", "has_sig": false, "md5_digest": "824e2f7bb77856ab649c7fa84d34f2a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5176, "upload_time": "2018-03-28T08:58:27", "url": "https://files.pythonhosted.org/packages/3e/f8/b7665cb7c6c375f51033b2922e7663bcf6c2e9bbf91459d3f1e60be555f6/aiohttp_jwt-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "43f2515fcf14d11d57fe031e082a3031", "sha256": "5c49ce0266615a2d6924a16f4ae64e6eb162ff50495edb256678cf871ef88e30" }, "downloads": -1, "filename": "aiohttp_jwt-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "43f2515fcf14d11d57fe031e082a3031", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8496, "upload_time": "2018-04-04T11:05:29", "url": "https://files.pythonhosted.org/packages/32/e2/75662aeeef2aa69858ed31518d95b85fd014005a083ea01a88da88a3db1e/aiohttp_jwt-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "207e810535e20b3437f079ececbfa439", "sha256": "b6b1a65ca885ad756457445913781c4b506f5cb49407b97e6ed7d535a57cdefb" }, "downloads": -1, "filename": "aiohttp_jwt-0.1.1.tar.gz", "has_sig": false, "md5_digest": "207e810535e20b3437f079ececbfa439", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5169, "upload_time": "2018-04-04T11:05:30", "url": "https://files.pythonhosted.org/packages/71/98/7cf05f3b0555b2b47a106f565e1514089d5846108d8ae18d38c344213558/aiohttp_jwt-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "12843d1507f86886a611416fcf0b5a2f", "sha256": "5f4cf45fee9688a0d4438d1aa4e625aeb51a8941a999e909d8e4814bb8a41965" }, "downloads": -1, "filename": "aiohttp_jwt-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "12843d1507f86886a611416fcf0b5a2f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5959, "upload_time": "2018-10-24T17:54:18", "url": "https://files.pythonhosted.org/packages/dc/f6/df7a1a46fbc1897dbfb0e2c8c271c277ed184ac48a2be8126c5a0efd905b/aiohttp_jwt-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d131abda76c9a4ef03cfd6fac2aa86ef", "sha256": "5a2d7c9642154a1ce768cb27646762224be0ab91bf13e712ec90bf8860372854" }, "downloads": -1, "filename": "aiohttp_jwt-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d131abda76c9a4ef03cfd6fac2aa86ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5278, "upload_time": "2018-10-24T17:54:19", "url": "https://files.pythonhosted.org/packages/a0/51/8614a00d2d897a11b2b8a10e570612101629b8012fedcfcdcb0258c1c815/aiohttp_jwt-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "229ae75a2ece5f4b1009e901317a69b0", "sha256": "0af96db8314bb70b8361a8c86dde32945180739fdc2846493423f4d6daf55c09" }, "downloads": -1, "filename": "aiohttp_jwt-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "229ae75a2ece5f4b1009e901317a69b0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5963, "upload_time": "2019-02-13T13:44:38", "url": "https://files.pythonhosted.org/packages/a1/8f/3e90d682c9fbf2b0ee14f55d6ecdd556df7b86e33cf817f82ca17dbcca97/aiohttp_jwt-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a13b427de1feb3f0eeddd1dd38e3290", "sha256": "f6fbc62aaa240822e902c8e1fe80856cbc14eca9ae52f5f7bb5c00784bb6ca5c" }, "downloads": -1, "filename": "aiohttp_jwt-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7a13b427de1feb3f0eeddd1dd38e3290", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5292, "upload_time": "2019-02-13T13:44:39", "url": "https://files.pythonhosted.org/packages/04/e5/b7db74b4d79d9f76be143e0dd735f725b66fd0c438b53ae76ea00816f99c/aiohttp_jwt-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "df5c320d163094c21ba43bfd822137d3", "sha256": "9bb59451b6c5c553ceb33518e54ec380c6b3c1c4768354e233e212348297954f" }, "downloads": -1, "filename": "aiohttp_jwt-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "df5c320d163094c21ba43bfd822137d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5990, "upload_time": "2019-02-25T14:55:31", "url": "https://files.pythonhosted.org/packages/b6/b4/82c9daed33d63ea5eecd2eb8b8b97531fdae49053ebf29b1a535b4d6701e/aiohttp_jwt-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f8ab9a81898d24c3ac75c4801e5b412", "sha256": "87a06fac71404e4faa49f24e196df45c4a146941d4e5b4d9040fee5b0e1770e7" }, "downloads": -1, "filename": "aiohttp_jwt-0.4.0.tar.gz", "has_sig": false, "md5_digest": "0f8ab9a81898d24c3ac75c4801e5b412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5336, "upload_time": "2019-02-25T14:55:32", "url": "https://files.pythonhosted.org/packages/ab/f9/2ee10e94ebbae1c7573ada8155085bdad2dc13d8f5bd1391d454eff1368b/aiohttp_jwt-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df5c320d163094c21ba43bfd822137d3", "sha256": "9bb59451b6c5c553ceb33518e54ec380c6b3c1c4768354e233e212348297954f" }, "downloads": -1, "filename": "aiohttp_jwt-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "df5c320d163094c21ba43bfd822137d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5990, "upload_time": "2019-02-25T14:55:31", "url": "https://files.pythonhosted.org/packages/b6/b4/82c9daed33d63ea5eecd2eb8b8b97531fdae49053ebf29b1a535b4d6701e/aiohttp_jwt-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f8ab9a81898d24c3ac75c4801e5b412", "sha256": "87a06fac71404e4faa49f24e196df45c4a146941d4e5b4d9040fee5b0e1770e7" }, "downloads": -1, "filename": "aiohttp_jwt-0.4.0.tar.gz", "has_sig": false, "md5_digest": "0f8ab9a81898d24c3ac75c4801e5b412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5336, "upload_time": "2019-02-25T14:55:32", "url": "https://files.pythonhosted.org/packages/ab/f9/2ee10e94ebbae1c7573ada8155085bdad2dc13d8f5bd1391d454eff1368b/aiohttp_jwt-0.4.0.tar.gz" } ] }