{ "info": { "author": "Markus Unterwaditzer", "author_email": "markus@unterwaditzer.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "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 :: Implementation :: CPython" ], "description": "# sensitive_variables - strip local variables in tracebacks\n\n[![Build Status](https://travis-ci.com/untitaker/python-sensitive-variables.svg?token=KCykhJnWfRnhkGxeQkqY&branch=master)](https://travis-ci.com/untitaker/python-sensitive-variables)\n[![PyPi page link -- version](https://img.shields.io/pypi/v/sensitive-variables.svg)](https://pypi.python.org/pypi/sensitive-variables)\n\n`sensitive_variables` is a decorator you can apply to your functions to\nprevent certain local variables from being read by debugging tools, such as the\n[Django crash reporter](https://docs.djangoproject.com/en/2.2/howto/error-reporting/) or [Sentry](https://sentry.io/).\n\nUnlike Django's `sensitive_variables` it is independent of the web framework\nyou use and also does not rely on debugging tools to know about the decorator\nfor things to work.\n\n```python\nfrom sentry_sdk import init\n\nfrom sensitive_variables import sensitive_variables\n\ninit()\n\n@sensitive_variables('password')\ndef login_user(username, password):\n print(\"Logging in \" + username + \" with \" + password)\n\n# TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'\nlogin_user(None, \"secret123\")\n```\n\nresults in:\n\n\"Picture\n\n## How does it work?\n\nWhen the decorated function throws an exception, `sensitive_variables` walks through the traceback, removes sensitive data from `frame.f_locals` and reraises the exception.\n\nThis is usually not problematic because a function that just threw an exception is unlikely to still use its local variables.\n\n## Why would I use this over Django's decorator?\n\nDjango has a decorator also called `sensitive_variables`, which this package is inspired by. It adds an attribute to the function that contains the variable names.\n\nDebugging tools have to know about this attribute and respect it. For anything outside of the Django world, this is unlikely to be the case.\n\nThis decorator will always work because it actually modifies your locals.\n\n## Why would I use this over Sentry's datascrubbing options?\n\n* This decorator does not couple your configuration for what is sensitive data to a specific crash reporting tool.\n\n* Behavior of the decorator is easily unit-testable (see `tests/` folder).\n\n## Why would I not use this?\n\nThis decorator inherently requires custom code for each Python implementation. Currently this is only tested against CPython 2.7, CPython 3.7 and PyPy 2.7.\n\n## License\n\nLicensed under the MIT, see ``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/untitaker/python-sensitive-variables", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sensitive-variables", "package_url": "https://pypi.org/project/sensitive-variables/", "platform": "", "project_url": "https://pypi.org/project/sensitive-variables/", "project_urls": { "Homepage": "https://github.com/untitaker/python-sensitive-variables" }, "release_url": "https://pypi.org/project/sensitive-variables/0.1.2/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "strip local variables in tracebacks", "version": "0.1.2" }, "last_serial": 5736443, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "65a1ce221a4488c1931cefea7ee2661d", "sha256": "6065b1c00c499a19706e78d8b2b7c387ff1e39e71fcc589eebbe500b99984afd" }, "downloads": -1, "filename": "sensitive_variables-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "65a1ce221a4488c1931cefea7ee2661d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4274, "upload_time": "2019-08-12T20:09:35", "url": "https://files.pythonhosted.org/packages/bf/7d/ae6e94055f158df8a6322dc0acdeeb89bbf06829422119088fa9da1f529d/sensitive_variables-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8732833c063b99e5e467bb46ca863673", "sha256": "ad98b0749dbdbe368569e672b1b0440e87335acbfcc3636e95a47b8648e938e7" }, "downloads": -1, "filename": "sensitive-variables-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8732833c063b99e5e467bb46ca863673", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4316, "upload_time": "2019-08-12T20:09:37", "url": "https://files.pythonhosted.org/packages/f0/8e/fda223c6d5bef295d60797da185cddbfb5b9258f0e678d66a3ddf1fd2af4/sensitive-variables-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "fee26c09f47cfd89d4e8c79c10fa1e49", "sha256": "f2df02269908c86d340b7820bf7a35e3ad57f0eaaf53c51890fda02b1c69c518" }, "downloads": -1, "filename": "sensitive_variables-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fee26c09f47cfd89d4e8c79c10fa1e49", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4483, "upload_time": "2019-08-14T14:48:18", "url": "https://files.pythonhosted.org/packages/be/df/2c4d2dc5e028262df4a3d45ed7b7f2539134270e96897d4fab3d24923b58/sensitive_variables-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8fbe8e75eb377b1f2320bdf2ba519566", "sha256": "599c249ce079dcaf3a682f73d434df4b3cf71b05ff5b54a93e8546a1b5ee2d54" }, "downloads": -1, "filename": "sensitive-variables-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8fbe8e75eb377b1f2320bdf2ba519566", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4540, "upload_time": "2019-08-14T14:48:19", "url": "https://files.pythonhosted.org/packages/8d/b0/a81e14fcd40466dc6311279ed85e7bac9725996cb25473400f8c97425fca/sensitive-variables-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8f38333138536f4580d0fc55cdd4e82d", "sha256": "04cf65dc4396ae285528efcc2c0f054f90523fa10d5a4f3cfadc15bfd94f466f" }, "downloads": -1, "filename": "sensitive_variables-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8f38333138536f4580d0fc55cdd4e82d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4491, "upload_time": "2019-08-14T14:51:45", "url": "https://files.pythonhosted.org/packages/ba/e6/cf199d774e60bb8da61fc6aa036a3cfd9eb6cc51ce8d735bccd80d80cefd/sensitive_variables-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d068aa8ba57570e5b39a89ca3935a1fb", "sha256": "17f7c56bef0efb3570a73539492687a3a5662bd41a2993791cc36b2956da9f49" }, "downloads": -1, "filename": "sensitive-variables-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d068aa8ba57570e5b39a89ca3935a1fb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4538, "upload_time": "2019-08-14T14:51:47", "url": "https://files.pythonhosted.org/packages/59/ee/cbc5dc46fc1a954f87623914b86a8bcea21cb02e4c96befa2a10ca5e15dd/sensitive-variables-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f38333138536f4580d0fc55cdd4e82d", "sha256": "04cf65dc4396ae285528efcc2c0f054f90523fa10d5a4f3cfadc15bfd94f466f" }, "downloads": -1, "filename": "sensitive_variables-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8f38333138536f4580d0fc55cdd4e82d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4491, "upload_time": "2019-08-14T14:51:45", "url": "https://files.pythonhosted.org/packages/ba/e6/cf199d774e60bb8da61fc6aa036a3cfd9eb6cc51ce8d735bccd80d80cefd/sensitive_variables-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d068aa8ba57570e5b39a89ca3935a1fb", "sha256": "17f7c56bef0efb3570a73539492687a3a5662bd41a2993791cc36b2956da9f49" }, "downloads": -1, "filename": "sensitive-variables-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d068aa8ba57570e5b39a89ca3935a1fb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4538, "upload_time": "2019-08-14T14:51:47", "url": "https://files.pythonhosted.org/packages/59/ee/cbc5dc46fc1a954f87623914b86a8bcea21cb02e4c96befa2a10ca5e15dd/sensitive-variables-0.1.2.tar.gz" } ] }