{ "info": { "author": "Norman Kr\u00e4mer", "author_email": "kraemer.norman@googlemail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "wsgicors\n========\n\nThis is a WSGI middleware that answers CORS preflight requests and adds\nthe needed header to the response. For CORS see:\nhttp://www.w3.org/TR/cors/\n\nUsage\n-----\n\nEither plug it in programmatically as in this pyramid example:\n\n.. code:: python\n\n\n def app(global_config, **settings):\n \"\"\" This function returns a WSGI application.\n\n It is usually called by the PasteDeploy framework during\n ``paster serve``.\n \"\"\"\n\n def get_root(request):\n return {}\n\n config = Configurator(root_factory=get_root, settings=settings)\n config.begin()\n # whatever it takes to config your app goes here\n config.end()\n\n from wsgicors import CORS\n return CORS(config.make_wsgi_app(), headers=\"*\", methods=\"*\", maxage=\"180\", origin=\"*\")\n\nor plug it into your wsgi pipeline via paste ini to let it serve by\nwaitress for instance:\n\n::\n\n [app:myapp]\n use = egg:mysuperapp#app\n\n ###\n # wsgi server configuration\n ###\n\n [server:main]\n use = egg:waitress#main\n host = 0.0.0.0\n port = 6543\n\n [pipeline:main]\n pipeline =\n cors\n myapp\n\n [filter:cors]\n use = egg:wsgicors#middleware\n # define a \"free\" policy\n free_origin=copy\n free_headers=*\n free_expose_headers=*\n free_methods=HEAD, OPTIONS, GET\n free_maxage=180\n\n # define a \"subdom\" policy\n subdom_origin=http://example.com http://example2.com https://*.example.com\n subdom_headers=*\n subdom_methods=HEAD, OPTIONS, GET, POST, PUT, DELETE\n subdom_expose_headers=Foo, Doom\n subdom_maxage=180\n\n # define a combination of policies, they are evaluated in the order given by the policy keyword\n # the first that matches the request's origin will be used\n policy=subdom,free\n # policy matching strategy\n # matchstrategy=firstmatch\n\nKeywords are:\n\n- ``origin``\n- ``headers``\n- ``methods``\n- ``credentials``\n- ``maxage``\n\nfor ``origin``:\n\n- use ``copy`` which will copy whatever origin the request comes from\n- a space separated list of hostnames - they can also contain wildcards\n like ``*`` or ``?`` (fnmatch lib is used for matching). If a match is\n found the original host is returned.\n- any other literal will be be copied verbatim (like ``*`` for instance\n to allow any source)\n\nfor ``headers``:\n\n- use ``*`` which will allow whatever header is asked for\n- any other literal will be be copied verbatim\n\nfor ``expose_headers``:\n\n- use ``*`` to allow access to any header the client might wish to access\n- any other literal will be be copied verbatim\n\nfor ``methods``:\n\n- use ``*`` which will allow whatever method is asked for\n- any other literal will be be copied verbatim (like\n ``POST, PATCH, PUT, DELETE`` for instance)\n\nfor ``credentials``:\n\n- use ``true``\n- anything else will be ignored (that is no response header for\n ``Access-Control-Allow-Credentials`` is sent)\n\nfor ``maxage``:\n\n- give the number of seconds the answer can be used by a client,\n anything nonempty will be copied verbatim\n\nAs can be seen in the example above, a policy needs to be created with\nthe ``policy`` keyword. The options need then be prefixed with the\npolicy name and a ``_``.\nThe ``policy`` keyword itself can be a comma separated list. If so the origin of the request is matched against the origins defined in the policies and the first matching is the policy used.\nAn alternative matching strategy would be ``verbmatch``, that selects the first of the listed that also matches the request method. To switch between the strategies use the\n\n``matchstrategy`` keyword:\n\n- use ``firstmatch`` (the default) to select the first of the policies that matches on the ``origin`` keyword\n- use ``verbmatch`` to select the first of the policies that matches on the ``methods`` and ``origin`` keyword\n\n\nChanges\n=======\n\nVersion 0.7.0\n-------------\n- ``verbmulti`` matching strategy, that matches the first listed policy that also matches the requested METHOD\n- relaxed dependency on lru_cache version\n\nVersion 0.6.0\n-------------\n- support for multiple policies\n- caching of matching results\n\nVersion 0.5.1\n-------------\n- check for request being preflight\n- reworked tests\n\nVersion 0.5.0\n-------------\n\n- support for Access-Control-Expose-Headers\n- Header ``Vary`` is set to ``Origin`` if origin policy differs from ``*``\n\nVersion 0.4.1\n-------------\n\n- py3 utf-8 related setup fixes\n\nVersion 0.4\n-----------\n\n- python3 compatibility\n\nVersion 0.3\n-----------\n\n- ``origin`` now takes space separated list of hostnames. They can be\n filename patterns like \\*.domain.tld\n\nVersion 0.2\n-----------\n\n- Access-Control-Allow-Credentials is now returned in the actual\n reponse if specified by policy\n\n\n\nCredits\n=======\n\n\u201cwsgicors\u201d is written and maintained by Norman Kr\u00e4mer.\n\n\nContributors\n------------\n\nThe following people contributed directly or indirectly to this project:\n\n- `Julien De Vos `_\n- `Ryan Shaw `_\n- `David Douard `_\n- `MattSANU `_\n- `Sami Salonen `_\n- `Sami Salonen `_\n- `Wouter Claeys `_\nPlease add yourself here when you submit your first pull request.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/may-day/wsgicors", "keywords": "wsgi,cors", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "wsgicors", "package_url": "https://pypi.org/project/wsgicors/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wsgicors/", "project_urls": { "Homepage": "https://github.com/may-day/wsgicors" }, "release_url": "https://pypi.org/project/wsgicors/0.7.0/", "requires_dist": null, "requires_python": "", "summary": "WSGI for Cross Origin Resource Sharing (CORS)", "version": "0.7.0" }, "last_serial": 2669661, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "afcee84e043e92098d2cc1fff21a3d1b", "sha256": "13f28c28534fd490647681aefd2b7f6efd102ecb6eab4ef9d0721508be7a0ba2" }, "downloads": -1, "filename": "wsgicors-0.1.tar.gz", "has_sig": false, "md5_digest": "afcee84e043e92098d2cc1fff21a3d1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3555, "upload_time": "2012-11-23T17:34:27", "url": "https://files.pythonhosted.org/packages/f8/3e/e428b59e241fe5cfc51abb808337b8630a04df035a57aebdd399d6fff6d9/wsgicors-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "3abd41808913ff74df4c90208c39f3ac", "sha256": "227042d5b28c6346d118753d14c975b6660053557da4730cfc9086a57b9fa945" }, "downloads": -1, "filename": "wsgicors-0.2.tar.gz", "has_sig": false, "md5_digest": "3abd41808913ff74df4c90208c39f3ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3788, "upload_time": "2013-02-27T22:53:31", "url": "https://files.pythonhosted.org/packages/88/35/faf70f1053a2e6c42dd3c48f036a0f32696b86587c66209bf718a7c79dfb/wsgicors-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "06f7f48042db5d5bbe006b4d8338d21e", "sha256": "b1266dd150ebbe0df870fb5cbb95fb50e323466e4110054c665f6c3697ab8b0b" }, "downloads": -1, "filename": "wsgicors-0.3.tar.gz", "has_sig": false, "md5_digest": "06f7f48042db5d5bbe006b4d8338d21e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4268, "upload_time": "2014-08-21T20:21:43", "url": "https://files.pythonhosted.org/packages/25/ea/6595a98065dee45885d048469f8ecc01db23927d556a8020962b2a8559da/wsgicors-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "5b75ba6f23a4547c996e376d6a5aefa2", "sha256": "06458011bdb7cb40253e1d618199a7220d84bc2c6e50bc135f224b6c30b0a091" }, "downloads": -1, "filename": "wsgicors-0.4.tar.gz", "has_sig": false, "md5_digest": "5b75ba6f23a4547c996e376d6a5aefa2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4580, "upload_time": "2014-12-06T21:52:18", "url": "https://files.pythonhosted.org/packages/30/15/212cd8130705f5f68729188095cccda3ab257ab73096b24c290cb1024c79/wsgicors-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "5f449451401175c1b22f647871803984", "sha256": "460d48eeada0ded91114e96317abd4ca2f849a19e7564f2ee06e790dd38e03af" }, "downloads": -1, "filename": "wsgicors-0.4.1.tar.gz", "has_sig": false, "md5_digest": "5f449451401175c1b22f647871803984", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5910, "upload_time": "2015-03-23T21:09:34", "url": "https://files.pythonhosted.org/packages/04/26/5af4156b2012173033a37a04bfa6bdad652fb954a7b195e4557ea4639f43/wsgicors-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "82611710588cb8357294d203e48af3ec", "sha256": "0fd1b952fa215e95858437ca816e5802be216a471320b6e311abe24d8cfc0f54" }, "downloads": -1, "filename": "wsgicors-0.5.0.tar.gz", "has_sig": false, "md5_digest": "82611710588cb8357294d203e48af3ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10042, "upload_time": "2015-07-12T20:38:38", "url": "https://files.pythonhosted.org/packages/54/2e/3b4df043c45eebc6b565c0c6702ea9ab550d25e557350a14b9ec840904d0/wsgicors-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "4bb63b275c0af9a04846ea457102c355", "sha256": "738de9d69a8cd0c3ec82975e1a267a354bfd80a8c25be2b15f9103f674717e4b" }, "downloads": -1, "filename": "wsgicors-0.5.1.tar.gz", "has_sig": false, "md5_digest": "4bb63b275c0af9a04846ea457102c355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10972, "upload_time": "2015-08-09T14:17:48", "url": "https://files.pythonhosted.org/packages/a5/cf/96adb709f1808140cc13372f88f9b6a0c3aae36d6ea2c116a25e652a51a4/wsgicors-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "8104597113004b64b02ae575b4a099dc", "sha256": "5d50e5b1a82765065a78089f028716ff40a1531147f6c2d13163b01b4f21acad" }, "downloads": -1, "filename": "wsgicors-0.6.0.tar.gz", "has_sig": false, "md5_digest": "8104597113004b64b02ae575b4a099dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12513, "upload_time": "2015-09-16T20:05:18", "url": "https://files.pythonhosted.org/packages/d3/47/10b3b2f7c7bc840d822aacee312d0c91cd4ac837faccb3f16d838f492b6b/wsgicors-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "fb2160024a0eae9f757211d1c8f34cc6", "sha256": "ccab43d60f02971d548f24209939818bb85fddf9367d4668e0db787b071f3d99" }, "downloads": -1, "filename": "wsgicors-0.7.0.tar.gz", "has_sig": false, "md5_digest": "fb2160024a0eae9f757211d1c8f34cc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13829, "upload_time": "2017-02-26T21:26:56", "url": "https://files.pythonhosted.org/packages/0a/94/022f1ca2838e854fd526012d888d50e391a8332b48ee6ad665d75763ebb3/wsgicors-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fb2160024a0eae9f757211d1c8f34cc6", "sha256": "ccab43d60f02971d548f24209939818bb85fddf9367d4668e0db787b071f3d99" }, "downloads": -1, "filename": "wsgicors-0.7.0.tar.gz", "has_sig": false, "md5_digest": "fb2160024a0eae9f757211d1c8f34cc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13829, "upload_time": "2017-02-26T21:26:56", "url": "https://files.pythonhosted.org/packages/0a/94/022f1ca2838e854fd526012d888d50e391a8332b48ee6ad665d75763ebb3/wsgicors-0.7.0.tar.gz" } ] }