{ "info": { "author": "Josh Wilson", "author_email": "josh.wilson@fivestars.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "###########\nfalcon-epdb\n###########\n\n|pypi| |build| |coverage| |src| |docs| |pyversions| |license| |black|\n\nA `Falcon middleware`__ that wraps the excellent `epdb`_ tool and allows one to connect to a running Falcon app and use interactive debugging to step through the code.\n\nBetter documentation can be found at `readthedocs`_.\n\nSource code can be found on GitHub at `jcwilson/falcon-epdb`__.\n\n__ Falcon_middleware_\n\n.. _Falcon_middleware: https://falcon.readthedocs.io/en/stable/api/middleware.html\n\n__ jcwilson_falcon_epdb_\n\n.. _jcwilson_falcon_epdb: https://github.com/jcwilson/falcon-epdb\n\n.. _readthedocs: https://falcon-epdb.readthedocs.io\n\n\n************\nInstallation\n************\nIf you are only planning on debugging in a development environment where access to your service is restricted to you or trusted partners, you may find the `Base64`_ backend sufficient to your purposes. You can just install the library as you would any Python library.\n\n**requirements.txt**\n\n.. code-block:: text\n\n falcon-epdb\n\n**pip**\n\n.. code-block:: bash\n\n pip install falcon-epdb\n\n**poetry**\n\n.. code-block:: bash\n\n poetry add falcon-epdb\n\nHowever, if you need a little more security, you can use one of the other authenticated backends (`Fernet`_, `JWT`_). Choose the one that best fits your use case and install it as a Python `extra`_.\n\n**requirements.txt**\n\n.. code-block:: text\n\n falcon-epdb[fernet]\n\n**pip**\n\n.. code-block:: bash\n\n pip install falcon-epdb[fernet, jwt]\n\n**poetry**\n\n.. code-block:: bash\n\n poetry add falcon-epdb[jwt]\n\n.. _extra: https://www.python.org/dev/peps/pep-0508/#extras\n\n\n*****\nUsage\n*****\n\nThis library adds a middleware to your Falcon API stack, and as such will run for all requests, save those excluded by ``exempt_methods`` provided to the ``EPDBServer`` constructor. If it detects a well-formed (and possibly authenticated) ``X-EPDB`` header on the request it will start the `epdb`_ server on the configured port and block until it establishes a connection from an `epdb`_ client, at which point processing continues but under the control of the remote debugging session.\n\nSubsequent requests with an acceptable header will reuse the client connection and automatically drop into the remote debugging session again.\n\nConfiguring the middleware\n==========================\nThe ``EPDBServe`` middleware accepts a handful of parameters. The most important are the ``backend`` and ``serve_options`` parameters. The ``backend`` determines how a request is examined for the \"secret knock\" to start the remote debugging server. The included implementations assume a well-formed ``X-EPDB`` header, but nothing precludes you from sub-classing ``EPDBBackend`` and implementing your own.\n\nThe ``serve_options`` are options that are passed through to the ``epdb.serve()`` call. See `Backends`_ for details on how to add this middleware to your API.\n\nConstructing the ``X-EPDB`` header\n==================================\n\nThe content of the header is as follows:\n\n.. code-block:: json\n\n {\n \"epdb\": {}\n }\n\nDepending on the backend in use, one should encode this content into the appropriate header-safe value. Then append this value to the name of the backend.\n\n.. code-block:: text\n\n X-EPDB: Base64 eyJlcGRiIjoge319\n\nConnecting the client\n=====================\nExample code for connecting to the waiting port:\n\n.. code-block:: python\n\n import epdb\n\n edpb.connect(host=, port=9000)\n\n\n.. _epdb: https://pypi.org/project/epdb/\n\nBackends\n========\n\nBase64\n------\n**Server side configuration**\n\n.. code-block:: python\n\n epdb_middleware = EPDBServe(\n backend=Base64Backend(),\n serve_options={'port': 9000})\n api = falcon.API(middleware=[epdb_middleware])\n\n**Crafting an appropriate header**\n\n.. code-block:: python\n\n import base64\n import json\n\n header_content = base64.b64encode(json.dumps({'epdb': {}}).encode()).decode()\n header_value = 'Base64 {}'.format(header_content)\n\nFernet\n------\n**Server side configuration**\n\n.. code-block:: python\n\n fernet_key = Fernet.generate_key() # The shared key\n epdb_middleware = EPDBServe(\n backend=FernetBackend(key=fernet_key),\n serve_options={'port': 9000})\n api = falcon.API(middleware=[epdb_middleware])\n\n**Crafting an appropriate header**\n\n.. code-block:: python\n\n import json\n from cryptography.fernet import Fernet\n\n f = Fernet() # Key configured on the server\n header_content = f.encrypt(json.dumps({'epdb': {}}).encode()).decode()\n header_value = 'Fernet {}'.format(header_content)\n\nJWT\n------\n**Server side configuration**\n\n.. code-block:: python\n\n jwt_key = uuid.uuid4().hex # The shared key\n epdb_middleware = EPDBServe(\n backend=JWTBackend(key=jwt_key),\n serve_options={'port': 9000})\n api = falcon.API(middleware=[epdb_middleware])\n\n**Crafting an appropriate header**\n\n.. code-block:: python\n\n import jwt\n\n header_content = jwt.encode({'epdb': {}}, , algorithm='HS256').decode()\n header_value = 'JWT {}'.format(header_content)\n\n\n***************\nTroubleshooting\n***************\nYou must be sure to allow access to the configured port on your host. Be sure to check your security groups and firewall rules.\n\nConfigure your web app to only run one worker process. If you have multiple workers, only the first one will be able to serve on the configured port. If this is not possible you will have to take steps to ensure that all requests that wish to use the remote debugging port are routed to the same worker. This will depend heavily on your HTTP stack and is beyond the scope of this documentation.\n\nBe sure to up your request timeout limit to something on the order of minutes so that the HTTP server doesn't close your request connection or kill your worker process while you're debugging.\n\nYou may need to provide the ``HTTP-`` prefix on your ``X-EPDB`` header for it to be handled correctly. So instead of sending ``X-EPDB``, you would send ``HTTP-X-EPDB``.\n\n.. |pypi| image:: https://img.shields.io/pypi/v/falcon-epdb.svg\n :target: https://pypi.org/project/falcon-epdb/\n :alt: Build version\n\n.. |build| image:: https://travis-ci.org/jcwilson/falcon-epdb.svg?branch=master\n :target: https://travis-ci.org/jcwilson/falcon-epdb\n :alt: Build status\n\n.. |coverage| image:: https://coveralls.io/repos/github/jcwilson/falcon-epdb/badge.svg\n :target: https://coveralls.io/github/jcwilson/falcon-epdb\n :alt: Coverage status\n\n.. |src| image:: https://img.shields.io/badge/src-github-blue.svg\n :target: https://github.com/jcwilson/falcon-epdb\n :alt: Source code\n\n.. |docs| image:: https://readthedocs.org/projects/falcon-epdb/badge/?version=latest\n :target: https://falcon-epdb.readthedocs.io/en/latest\n :alt: Documentation status\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/falcon-epdb.svg\n :target: https://pypi.org/project/falcon-epdb/\n :alt: Supported Python versions\n\n.. |license| image:: https://img.shields.io/pypi/l/falcon-epdb.svg\n :target: https://opensource.org/licenses/BSD-3-Clause\n :alt: Build version\n\n.. |black| image:: https://img.shields.io/badge/code%20format-black-black.svg\n :target: https://pypi.org/project/black/\n :alt: Black code formatter\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jcwilson/falcon-epdb", "keywords": "", "license": "BSD-3-Clause", "maintainer": "Josh Wilson", "maintainer_email": "josh.wilson@fivestars.com", "name": "falcon-epdb", "package_url": "https://pypi.org/project/falcon-epdb/", "platform": "", "project_url": "https://pypi.org/project/falcon-epdb/", "project_urls": { "Documentation": "https://falcon-epdb.readthedocs.io/", "Homepage": "https://github.com/jcwilson/falcon-epdb", "Repository": "https://github.com/jcwilson/falcon-epdb" }, "release_url": "https://pypi.org/project/falcon-epdb/1.1.2/", "requires_dist": [ "epdb (>=0.15.1,<0.16.0)", "cryptography (>=2.5,<3.0); extra == \"fernet\"", "PyJWT (>=1.7,<2.0); extra == \"jwt\"" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "Interactive debugging for your Falco apps", "version": "1.1.2" }, "last_serial": 4789209, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3de24b2b6facf954a360da5d8f6824a6", "sha256": "d64081bfafd18b7d3a5fbf9aa7aa033fd53b1255f305afde6d89c25f448e2049" }, "downloads": -1, "filename": "falcon_epdb-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3de24b2b6facf954a360da5d8f6824a6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 12706, "upload_time": "2019-02-03T01:19:36", "url": "https://files.pythonhosted.org/packages/e4/39/cf7f1992b0b1e96916c4499bd83937437bfd351a11e8f185917c894b48ee/falcon_epdb-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d933898f4256308053a4f20e111e2c41", "sha256": "2ed6500351a37d15201787bbb295c5a78d27f736a61e9dd14ce23e0c2215d762" }, "downloads": -1, "filename": "falcon-epdb-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d933898f4256308053a4f20e111e2c41", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4816, "upload_time": "2019-02-03T01:19:34", "url": "https://files.pythonhosted.org/packages/5b/2c/71221936f01a1e8e19afdc0e50cec2899f31c94a3773e960bab6f43401fb/falcon-epdb-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "1ffc60eff96e0f16e79c5d81c05449d8", "sha256": "f9ef3f3ec98e896277dbb9c25263a626d581ef6689780103d56d743381df7fc0" }, "downloads": -1, "filename": "falcon_epdb-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1ffc60eff96e0f16e79c5d81c05449d8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 15260, "upload_time": "2019-02-04T03:04:53", "url": "https://files.pythonhosted.org/packages/c6/7d/f9bb0f06629225bda6c003c57c56e76cde00c7d511575eb16f20f9cc5de7/falcon_epdb-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed5d8f404b3256703f7cd890e12a1c85", "sha256": "59522747af457eb105cc11c6cd7d96dce687d4b5c5888c97b8f8af6f145c07e5" }, "downloads": -1, "filename": "falcon-epdb-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ed5d8f404b3256703f7cd890e12a1c85", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 7771, "upload_time": "2019-02-04T03:04:52", "url": "https://files.pythonhosted.org/packages/e1/ea/102c6a35099a68a83c91d9eb7c711b58b864fcb7a172be3e1cf47d1f1027/falcon-epdb-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "6d82a1283bd8eeecb80737b1bfbe8261", "sha256": "5b2d1f8ffc6424a31c29b1ed62776db1c03318c1dfc6bf32680e269279c354d8" }, "downloads": -1, "filename": "falcon_epdb-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6d82a1283bd8eeecb80737b1bfbe8261", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 15231, "upload_time": "2019-02-05T12:35:26", "url": "https://files.pythonhosted.org/packages/78/b0/f476965821f42c16c0bcb45d465dc5873b3783d01e06623414dfba15a812/falcon_epdb-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fdc99f7cc0df588c9646c339132d878", "sha256": "664366873df56ece75f933122ab6e2c9e93917527b611d5b08595ba62a7883ba" }, "downloads": -1, "filename": "falcon-epdb-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0fdc99f7cc0df588c9646c339132d878", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 7779, "upload_time": "2019-02-05T12:35:25", "url": "https://files.pythonhosted.org/packages/9e/06/3f00d5c507e252523ed41d7f33ca7bab3236b0e4608b15ca2bc1991c20f2/falcon-epdb-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "483862ab4102d467f80132733fe1b458", "sha256": "aaf9a1122673088b537dc8cdf0d0654ac46a3f7a4cd61b7b92bc46c9302dbea4" }, "downloads": -1, "filename": "falcon_epdb-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "483862ab4102d467f80132733fe1b458", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 15605, "upload_time": "2019-02-07T00:51:40", "url": "https://files.pythonhosted.org/packages/d0/bd/912322781ad023638108b779194fb88fe69c44c628c99e49238ea06bb55a/falcon_epdb-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9161dde9cb23968230c99531eaf82663", "sha256": "478596960169d6127737099a9c09ca43efe9aa4a1325738326a7219340045766" }, "downloads": -1, "filename": "falcon-epdb-1.1.2.tar.gz", "has_sig": false, "md5_digest": "9161dde9cb23968230c99531eaf82663", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 7835, "upload_time": "2019-02-07T00:51:38", "url": "https://files.pythonhosted.org/packages/ee/73/c927b08eb2123fcef43545f5c93986f1748d6e1ee54a81b13cff719504d3/falcon-epdb-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "483862ab4102d467f80132733fe1b458", "sha256": "aaf9a1122673088b537dc8cdf0d0654ac46a3f7a4cd61b7b92bc46c9302dbea4" }, "downloads": -1, "filename": "falcon_epdb-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "483862ab4102d467f80132733fe1b458", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 15605, "upload_time": "2019-02-07T00:51:40", "url": "https://files.pythonhosted.org/packages/d0/bd/912322781ad023638108b779194fb88fe69c44c628c99e49238ea06bb55a/falcon_epdb-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9161dde9cb23968230c99531eaf82663", "sha256": "478596960169d6127737099a9c09ca43efe9aa4a1325738326a7219340045766" }, "downloads": -1, "filename": "falcon-epdb-1.1.2.tar.gz", "has_sig": false, "md5_digest": "9161dde9cb23968230c99531eaf82663", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 7835, "upload_time": "2019-02-07T00:51:38", "url": "https://files.pythonhosted.org/packages/ee/73/c927b08eb2123fcef43545f5c93986f1748d6e1ee54a81b13cff719504d3/falcon-epdb-1.1.2.tar.gz" } ] }