{ "info": { "author": "John Vrbanac", "author_email": "john.vrbanac@linux.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "Falcon Middleware: Policy Middleware |Build Status| |codecov.io|\n================================================================\n\nThe ``falcon-policy`` package provides a middleware component\nthat enables simple policy controls such as role-based access on routes\nvia configuration.\n\nThe configuration approach to policy rules enables dynamic authorization\nuse-cases where the policy needs to be adjusted on-demand without a new\nservice deployment.\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install falcon-policy\n\nUsage\n-----\n\nThe ``RoleBasedPolicy`` middleware class examines each incoming request\nand verifies the ``roles`` list from the request context; which should be\npopulated by an authentication middleware. If the request context isn't\npopulated with a ``roles`` list, then the middleware will fall back on\nthe ``X-Roles`` header for the appropriate role given the request being made.\nUsage of the ``X-Roles`` header, is primarily used when handling\nauthentication outside of the middleware stack or for development with\nauthentication disabled.\n\nImplementation Note:\n\nIf the request context type isn't a dictionary, the middleware will assume\nthat ``req.context`` is an Object with a ``roles`` attribute.\n\n\nGetting Started:\n\n* Create a policy configuration\n* Create an instance of ``RoleBasedPolicy`` using the configuration\n* Pass the instance to the ``falcon.API()`` initializer:\n\n.. code:: python\n\n from falcon_policy import RoleBasedPolicy\n\n policy_config = {\n 'roles': [\n 'admin',\n 'creator',\n 'observer',\n ],\n 'groups': {\n 'create': ['admin', 'creator'],\n 'update': ['admin', 'creator'],\n 'read': ['admin', 'creator', 'observer'],\n 'delete': ['admin'],\n },\n 'routes': {\n '/quote': {\n 'GET': ['read'],\n 'POST': ['create'],\n 'PUT': ['update'],\n 'DELETE': ['delete'],\n },\n '/quote/{id}': {\n 'GET': ['read'],\n 'POST': ['create'],\n 'PUT': ['update'],\n 'DELETE': ['delete'],\n },\n '/status': {\n 'GET': ['@any-role'],\n 'HEAD': ['@passthrough'],\n },\n },\n }\n\n app = falcon.API(\n middleware=[\n RoleBasedPolicy(policy_config)\n ]\n )\n\n\nIf validation fails an instance of ``falcon.HTTPForbidden`` is raised.\n\nConfiguration\n-------------\n\nThe policy configuration is separated into three sections:\n\n* Roles: Is a list of names that correspond with Role values provided\n by your authentication system.\n* Groups: Is an alias/grouping of multiple role names for convenience.\n* Routes: A structure containing role and/or group permissions for a given\n Falcon route and method.\n\nSpecialty Roles:\n\n ``falcon-policy`` offers two specialty roles types that should be used with\n care:\n\n * ``@any-role``: Allows any defined role\n * ``@passthrough``: Allows all users (authenticated and unauthenticated)\n\n\nAbout Falcon\n------------\n\nFalcon is a `bare-metal Python web\nframework `__ for building lean and\nmean cloud APIs and app backends. It encourages the REST architectural style,\nand tries to do as little as possible while remaining `highly\neffective `__.\n\n\n.. |Build Status| image:: https://travis-ci.org/falconry/falcon-policy.svg\n :target: https://travis-ci.org/falconry/falcon-policy\n.. |codecov.io| image:: https://codecov.io/gh/falconry/falcon-policy/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/falconry/falcon-policy\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/falconry/falcon-policy", "keywords": "falcon middleware policy rbac role based access", "license": "Apache v2", "maintainer": "", "maintainer_email": "", "name": "falcon-policy", "package_url": "https://pypi.org/project/falcon-policy/", "platform": "", "project_url": "https://pypi.org/project/falcon-policy/", "project_urls": { "Homepage": "https://github.com/falconry/falcon-policy" }, "release_url": "https://pypi.org/project/falcon-policy/0.2.0/", "requires_dist": [ "falcon", "six" ], "requires_python": "", "summary": "Policy middleware for Falcon APIs", "version": "0.2.0" }, "last_serial": 4372481, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4139efbad6423d9c9c9f469f89e8f465", "sha256": "1e2c3b674c46c184fcecd9f90b68220cd76ca644ce7ffeced11aaca33dbf465d" }, "downloads": -1, "filename": "falcon_policy-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4139efbad6423d9c9c9f469f89e8f465", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6505, "upload_time": "2017-06-27T03:06:42", "url": "https://files.pythonhosted.org/packages/c3/f1/87de92981b15c4a51beb842444b69bb20a30afc5545e1b5b352155099a44/falcon_policy-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1406b4be87bede7cabbf21ca27878f73", "sha256": "f0c6defb4c70d8c159e98490e5882a6202ee91627bf2367492c86a0cf532db4b" }, "downloads": -1, "filename": "falcon-policy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1406b4be87bede7cabbf21ca27878f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3622, "upload_time": "2017-06-27T03:06:44", "url": "https://files.pythonhosted.org/packages/53/b9/2edc95af2c983befc56beec8216099f434a12376c4da07b981b00f75dc34/falcon-policy-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "93c606b88f4600052ae46752969b68a1", "sha256": "61b3674f9bcb4b76e0c69ac1048f2e4df1be52dce6ff396cafd5f55f0bde363d" }, "downloads": -1, "filename": "falcon_policy-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "93c606b88f4600052ae46752969b68a1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6696, "upload_time": "2017-06-27T03:27:10", "url": "https://files.pythonhosted.org/packages/15/56/4e13a369eb51753af78cc9e73ff014d19580722683f476d0232df191a913/falcon_policy-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a52b78414c90abf5183d323cdf3094e", "sha256": "1b88746fe376854abf89c821ea5d3a7814e678ce55a5629f9720d9551e25f14c" }, "downloads": -1, "filename": "falcon-policy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4a52b78414c90abf5183d323cdf3094e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3782, "upload_time": "2017-06-27T03:27:12", "url": "https://files.pythonhosted.org/packages/d4/ea/0eeae53a426321e11fef514d525fcda5d6de0280990c8bdd469d2138c095/falcon-policy-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "98d0493601f62c14690f9f953e5c973b", "sha256": "5c6a541ca5c0bdc2d20932b1238260888c3f203067ec02c9c8ec17040b188328" }, "downloads": -1, "filename": "falcon_policy-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "98d0493601f62c14690f9f953e5c973b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5329, "upload_time": "2018-10-13T18:29:55", "url": "https://files.pythonhosted.org/packages/e5/f9/c62be2b865694b89413297e7ec5273ce17a20687f785393b8fbee301952b/falcon_policy-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47a3f6ef400de98a4a7e7e2fb093aa9a", "sha256": "ed72cca681cdfaf0530ca87b964f7754d00e736c3bb2b17fe72939dd26e28061" }, "downloads": -1, "filename": "falcon-policy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "47a3f6ef400de98a4a7e7e2fb093aa9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4146, "upload_time": "2018-10-13T18:29:57", "url": "https://files.pythonhosted.org/packages/7f/40/3a660d05127c9ba2ed9affae4e33a6031bd2dfdd3564c31dfb2283b9bcfa/falcon-policy-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "98d0493601f62c14690f9f953e5c973b", "sha256": "5c6a541ca5c0bdc2d20932b1238260888c3f203067ec02c9c8ec17040b188328" }, "downloads": -1, "filename": "falcon_policy-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "98d0493601f62c14690f9f953e5c973b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5329, "upload_time": "2018-10-13T18:29:55", "url": "https://files.pythonhosted.org/packages/e5/f9/c62be2b865694b89413297e7ec5273ce17a20687f785393b8fbee301952b/falcon_policy-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47a3f6ef400de98a4a7e7e2fb093aa9a", "sha256": "ed72cca681cdfaf0530ca87b964f7754d00e736c3bb2b17fe72939dd26e28061" }, "downloads": -1, "filename": "falcon-policy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "47a3f6ef400de98a4a7e7e2fb093aa9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4146, "upload_time": "2018-10-13T18:29:57", "url": "https://files.pythonhosted.org/packages/7f/40/3a660d05127c9ba2ed9affae4e33a6031bd2dfdd3564c31dfb2283b9bcfa/falcon-policy-0.2.0.tar.gz" } ] }