{ "info": { "author": "Darren P Meyer", "author_email": "darren+filtercertwarning@darrenpmeyer.com", "bugtrack_url": null, "classifiers": [], "description": "Decorators for filtering InsecureRequestWarnings in `requests` and other `urllib3`-based Python 3 modules\n\n**NOTE:** tested only for Python3.\n\nWhen developing applications/modules using the ``requests`` module (or using ``urllib3`` directly), it is\nsometimes useful to disable certificate validation, or to permit consumers/users to do so. However, doing\nso makes *each request* issue an InsecureRequestWarning, which is a lot of noise.\n\n**filter-certwarning** provides two decorators to make this behavior more reasonable.\n\n- ``@filter_certwarning.warnonce`` causes the warning to be issued only warnonce, the first time the decorated\n function is called\n\n- ``@filter_certwarning.silent`` is an alias for ``@filter_certwarning('ignore')``, and causes the warning to be\n entirely suppressed for that function call\n\nExamples:\n A requests-based app with verification off that issues the warning only warnonce::\n\n import requests\n import filter_certwarning\n\n ...\n\n @filter_certwarning.warnonce\n sub get_data():\n # the next line will fire an InsecureRequestWarning the first time this\n # function is called, but subsequent calls to this function will be silent\n resp = requests.get('https://localhost/status', verify=False)\n\n The following supresses the warning entirely. **This is not recommended unless you've given a lot of thought\n to the security implications and trade-offs.**::\n\n import requests\n import filter_certwarning\n\n ...\n\n @filter_certwarning.silent\n sub get_data():\n # the next line will fire an InsecureRequestWarning the first time this\n # function is called, but subsequent calls to this function will be silent\n resp = requests.get('https://localhost/status', verify=False)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/darrenpmeyer/filter-certwarning", "keywords": "", "license": "BSD 2-clause", "maintainer": "", "maintainer_email": "", "name": "filter-certwarning", "package_url": "https://pypi.org/project/filter-certwarning/", "platform": "", "project_url": "https://pypi.org/project/filter-certwarning/", "project_urls": { "Homepage": "https://github.com/darrenpmeyer/filter-certwarning" }, "release_url": "https://pypi.org/project/filter-certwarning/1.0/", "requires_dist": null, "requires_python": "", "summary": "Decorators for filtering InsecureRequestWarnings in requests and urllib3 apps", "version": "1.0" }, "last_serial": 4902207, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "aca739160358df4e360a729ecffe6f21", "sha256": "80fd510fd5898f2e237c4d12fa8053554ab291f034686edc47426580b9c33f76" }, "downloads": -1, "filename": "filter-certwarning-1.0.tar.gz", "has_sig": false, "md5_digest": "aca739160358df4e360a729ecffe6f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2097, "upload_time": "2019-03-05T22:15:16", "url": "https://files.pythonhosted.org/packages/52/92/7c02a299c22d8a111f1a6b42d346a70a1f5fe133cb59185e75d2d0279892/filter-certwarning-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aca739160358df4e360a729ecffe6f21", "sha256": "80fd510fd5898f2e237c4d12fa8053554ab291f034686edc47426580b9c33f76" }, "downloads": -1, "filename": "filter-certwarning-1.0.tar.gz", "has_sig": false, "md5_digest": "aca739160358df4e360a729ecffe6f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2097, "upload_time": "2019-03-05T22:15:16", "url": "https://files.pythonhosted.org/packages/52/92/7c02a299c22d8a111f1a6b42d346a70a1f5fe133cb59185e75d2d0279892/filter-certwarning-1.0.tar.gz" } ] }