{ "info": { "author": "Mike Nacey", "author_email": "nobody@teletracking.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "[![Build Status](https://travis-ci.com/TeleTrackingTechnologies/jwt_authenticator.svg?branch=master)](https://travis-ci.com/TeleTrackingTechnologies/jwt_authenticator)\n# jwt_authenticator\n\njwt_authenticator is a simply python library for adding JWT token authentication/authorization in flask web sites/services. It controls access either by checking for just a validated token, or optionally, a single role claim from the token. Access is controlled by decorating the endpoint functions with an attribute.\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install jwt_authenticator.\n\n```bash\npip install jwt_authenticator\n```\n\n## Usage\nIn the main application initialization area\n\n```python\nfrom Flask import Flask\nfrom jwt_authenticator import AuthenticationHandler\n\nAPP = Flask(__name__)\nAuthenticationHandler.load_configuration()\n```\nIn the endpoints\n\n```python\nfrom jwt_authenticator import AuthenticationHandler, AuthError\n\n@api.route('/', methods=['GET'])\n@AuthenticationHandler.requires_auth(\"admin\")\ndef get_one(name):\n return f\"Hello {name}\"\n\n@api.route('/', methods=['GET'])\n@AuthenticationHandler.requires_auth()\ndef get_one(name):\n return f\"Hello {name}\"\n```\n\n## Configuration\njwt_authenticator requires two configuration values to work. These can be specified either in the normal Flask application configuration or as environment variables. Environment variable values will override application configuration values, when\n\n```python\nAuthenticationHanlder.load_configuration()\n```\nis called.\n\n### APP.config (i.e. flask application configuration)\n\n* SECRET - the key used to sign the JWT token\n* AUDIENCE - the audience claim used in the JWT token\n\n### Environment Variables\n\n* JWT_SECRET - will override SECRET\n* JWT_AUDIENCE - will override AUDIENCE\n\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## Building\n* Requires 'make'\n\n```bash\nmake init\nmake test\nmake package\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\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/TeleTrackingTechnologies/jwt_authenticator", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "jwt-authenticator", "package_url": "https://pypi.org/project/jwt-authenticator/", "platform": "", "project_url": "https://pypi.org/project/jwt-authenticator/", "project_urls": { "Homepage": "https://github.com/TeleTrackingTechnologies/jwt_authenticator" }, "release_url": "https://pypi.org/project/jwt-authenticator/1.0.0/", "requires_dist": [ "Flask", "python-jose" ], "requires_python": "", "summary": "Simple JWT token flask service security library.", "version": "1.0.0" }, "last_serial": 4741803, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "dc7e64daff6ad884b72451fd413a40ee", "sha256": "a9d396c22fc6d5e0d1488f46edda8c4cb788aea188b50f9f2ec86b31762f2011" }, "downloads": -1, "filename": "jwt_authenticator-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dc7e64daff6ad884b72451fd413a40ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4663, "upload_time": "2019-01-25T21:15:27", "url": "https://files.pythonhosted.org/packages/ee/4a/be93b8f343951ac082dc146d0af945a43ab118dad3c44451d30dacf8f238/jwt_authenticator-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e0260fb8aafd0ecc38dcc3725b2455a", "sha256": "b882c19105bf5d50450953a6770a88b69c215cf628eae3bc548412fcc68bfc58" }, "downloads": -1, "filename": "jwt_authenticator-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1e0260fb8aafd0ecc38dcc3725b2455a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3306, "upload_time": "2019-01-25T21:15:30", "url": "https://files.pythonhosted.org/packages/ce/51/3f608946894e28502dde81f620c94fa44d4fdc4b5f200905c6219a10b3e2/jwt_authenticator-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dc7e64daff6ad884b72451fd413a40ee", "sha256": "a9d396c22fc6d5e0d1488f46edda8c4cb788aea188b50f9f2ec86b31762f2011" }, "downloads": -1, "filename": "jwt_authenticator-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dc7e64daff6ad884b72451fd413a40ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4663, "upload_time": "2019-01-25T21:15:27", "url": "https://files.pythonhosted.org/packages/ee/4a/be93b8f343951ac082dc146d0af945a43ab118dad3c44451d30dacf8f238/jwt_authenticator-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e0260fb8aafd0ecc38dcc3725b2455a", "sha256": "b882c19105bf5d50450953a6770a88b69c215cf628eae3bc548412fcc68bfc58" }, "downloads": -1, "filename": "jwt_authenticator-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1e0260fb8aafd0ecc38dcc3725b2455a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3306, "upload_time": "2019-01-25T21:15:30", "url": "https://files.pythonhosted.org/packages/ce/51/3f608946894e28502dde81f620c94fa44d4fdc4b5f200905c6219a10b3e2/jwt_authenticator-1.0.0.tar.gz" } ] }