{ "info": { "author": "Walter Danilo Galante", "author_email": "walter.galante@ovalmoney.com", "bugtrack_url": null, "classifiers": [ "Framework :: Pylons", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "==================\npyramid_selectauth\n==================\n\n|pypi| |travis|\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pyramid_selectauth.svg\n :target: https://pypi.python.org/pypi/pyramid_selectauth\n\n.. |travis| image:: https://travis-ci.org/OvalMoney/pyramid_selectauth.svg?branch=master\n :target: https://travis-ci.org/OvalMoney/pyramid_selectauth\n\n\nAn authentication policy for Pyramid that automagically selects the\ncorrect policy to use for a specific request, given a list of authentication policies\n\n\nOverview\n========\n\nSelectableAuthenticationPolicy is a Pyramid authentication policy that selects\n*another* provided IAuthenticationPolicy object, to provide a different auth policy\nbased on the specific request. Simply pass it a list of policies that\nshould be tried in order, and register the 'selected_policy' request method that\nwill select and cache the correct policy to use::\n\n policies = [\n IPAuthenticationPolicy(\"127.0.*.*\", principals=[\"local\"])\n IPAuthenticationPolicy(\"192.168.*.*\", principals=[\"trusted\"])\n ]\n set_selectable_authentication_policy(config, policies)\n\nThis example uses the pyramid_ipauth module to assign effective principals\nbased on originating IP address of the request. It combines two such\npolicies so that requests originating from \"127.0.*.*\" will have principal\n\"local\" while requests originating from \"192.168.*.*\" will have principal\n\"trusted\".\n\nYou can use the *create_selectable_authentication_policy* factory to just create the\n*SelectableAuthenticationPolicy* instance without setting it::\n\n policies = [\n IPAuthenticationPolicy(\"127.0.*.*\", principals=[\"local\"])\n IPAuthenticationPolicy(\"192.168.*.*\", principals=[\"trusted\"])\n ]\n policy = create_selectable_authentication_policy(config, policies)\n policy.add_policy(IPAuthenticationPolicy(\"10.0.*.*\", principals=[\"not-so-trusted\"]))\n config.set_authentication_policy(policy)\n\nYou can also just use *config.include()* to include the policy, and then add the subpolicies\nwith the registered *add_selectauth_policy* directive on config::\n\n config.include('pyramid_selectauth')\n config.add_selectauth_policy(IPAuthenticationPolicy(\"127.0.*.*\", principals=[\"local\"]))\n config.add_selectauth_policy(IPAuthenticationPolicy(\"192.168.*.*\", principals=[\"trusted\"]))\n\nPolicy selection method\n=========================\n\nThe default selection method will call *unauthenticated_userid* on the provided\npolicies in order, and select the first one that does not return `None`.\n\nYou can change the selection method by extending the *SelectableAuthenticationPolicy* and\noverriding the *select_policy* method with your logic to select the correct policy for the\ncurrent request, and then specifying your class in the factories::\n\n class MyPolicy(SelectableAuthenticationPolicy):\n def select_policy(self, request):\n return self._policies[0] # Always uses the first policy (very useful!)\n\n\n policies = [\n IPAuthenticationPolicy(\"127.0.*.*\", principals=[\"local\"])\n IPAuthenticationPolicy(\"192.168.*.*\", principals=[\"trusted\"])\n ]\n policy = create_selectable_authentication_policy(config, policies, _class=MyPolicy)\n config.set_authentication_policy(policy)\n\nDeployment Settings\n===================\n\nIt is also possible to specify the authentication policies as part of your\npaste deployment settings. Consider the following example::\n\n [app:pyramidapp]\n use = egg:mypyramidapp\n\n selectauth.policy_class = mypyramidapp.policies.MySelectAuthPolicy\n selectauth.policies = mypyramidapp.policies.ipauthpolicyfactory mypyramidapp.policies.mypolicyfactory\n\n\nTo configure authentication from these settings, simply include the multiauth\nmodule into your configurator::\n\n config.include(\"pyramid_selectauth\")\n\n\n\n\n1.0.1 - 2018-09-24\n==================\n\n- Refactored policy methods using `proxy_method` decorator.\n\n1.0.0 - 2018-09-23\n==================\n\n- Production-ready release.\n\n0.0.4 - 2018-09-21\n==================\n\n- Initial release.\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/OvalMoney/pyramid_selectauth", "keywords": "web pyramid pylons authentication", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyramid-selectauth", "package_url": "https://pypi.org/project/pyramid-selectauth/", "platform": "", "project_url": "https://pypi.org/project/pyramid-selectauth/", "project_urls": { "Homepage": "https://github.com/OvalMoney/pyramid_selectauth" }, "release_url": "https://pypi.org/project/pyramid-selectauth/1.0.1/", "requires_dist": [ "pyramid" ], "requires_python": "", "summary": "pyramid_selectauth", "version": "1.0.1" }, "last_serial": 4303805, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9f303369f4f871031b70ea4c0a88611d", "sha256": "11c1c0e0a7ee275dbeeab369460d6adba732ad16815eb79f9e8866f5eecf385c" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "9f303369f4f871031b70ea4c0a88611d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3140, "upload_time": "2018-09-19T09:54:43", "url": "https://files.pythonhosted.org/packages/02/6d/3b992d5b29eddbdb46e642ed5bc333612d27422959beeff501cfb2f07e37/pyramid_selectauth-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e2c9cc72ce46212904045b53aea8604", "sha256": "0649031de0c61406cc574488259607f57df07af9f939b555908db1385ee48b8a" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.1.tar.gz", "has_sig": true, "md5_digest": "8e2c9cc72ce46212904045b53aea8604", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10225, "upload_time": "2018-09-19T09:54:45", "url": "https://files.pythonhosted.org/packages/b9/28/08866d5d9a96e52c62a50bd84c0ec2ed495f4b8639323208ae6726aff15f/pyramid_selectauth-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7b84ef0d2f3a10a66818bf27576bd3f9", "sha256": "d9c18efd822aa6de181698c5154dab73f2e46cf08351e6feea82cfdb49c7045f" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "7b84ef0d2f3a10a66818bf27576bd3f9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8337, "upload_time": "2018-09-19T10:17:16", "url": "https://files.pythonhosted.org/packages/bb/50/6eeb88264647756976002148beb5fd0062d9f2164b4bc8f8a9c1089f76d1/pyramid_selectauth-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a3c5fda93157091d80186495ab4b3ae", "sha256": "3bb27c73ec9e085768d626b0dafcba5105a09777288fa73952d48f49ff7e615e" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.2.tar.gz", "has_sig": true, "md5_digest": "6a3c5fda93157091d80186495ab4b3ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14830, "upload_time": "2018-09-19T10:17:18", "url": "https://files.pythonhosted.org/packages/8b/fb/cf2e5fb8b73c39975cbaac4a411fccf8a881339b9392b4a2d0c58535b01f/pyramid_selectauth-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ce840c8721f3e650e01b557770b4454c", "sha256": "3bb9262445a282851f3cc9d86010a743866eaf98f748a4e6ea9c88fd2255c1de" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ce840c8721f3e650e01b557770b4454c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7383, "upload_time": "2018-09-20T17:04:09", "url": "https://files.pythonhosted.org/packages/2b/ad/74c32b438e582f88e41d7d3b0e0f4ef0d365b3c6f4f5ba1a5c3ff28827c9/pyramid_selectauth-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c8187fe087dba05e699c81f7414c337", "sha256": "5ea3be333fae1e80a2c4bcd709fb6f6c265dc8ab1b90d846011151de9956b9eb" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.3.tar.gz", "has_sig": true, "md5_digest": "6c8187fe087dba05e699c81f7414c337", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13843, "upload_time": "2018-09-20T17:04:11", "url": "https://files.pythonhosted.org/packages/ed/a6/d09fc8f672ebaa7798df2a59568c534927f06c776729b783a5e6515e5323/pyramid_selectauth-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9b6fc5581e41c872d24a0f996846c4d5", "sha256": "c0b9ccd7d2a8d1df4a6b96fd9d1037e249cdc465078944510875ed24a4c57ff3" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "9b6fc5581e41c872d24a0f996846c4d5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7145, "upload_time": "2018-09-21T09:44:13", "url": "https://files.pythonhosted.org/packages/a2/4e/bbe7a5fd67a0eb85cffa9c83dfff9f9ddd60de18f09f038daf1358b98a99/pyramid_selectauth-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbe34c2f4ab9d1dd18d05e4b1229008a", "sha256": "904f045d18d4861b2684fcb8682dd4e1d97fdf0d037a9e3b9a1187f6105949f2" }, "downloads": -1, "filename": "pyramid_selectauth-0.0.4.tar.gz", "has_sig": true, "md5_digest": "cbe34c2f4ab9d1dd18d05e4b1229008a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12796, "upload_time": "2018-09-21T09:44:16", "url": "https://files.pythonhosted.org/packages/bf/62/d591e56a81952f1466ea62e7fdb19a696def13f2f3d3a716a82b22b75a0d/pyramid_selectauth-0.0.4.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a1b49905ebc538f830cf3d5440d92006", "sha256": "8e690d5471dbe34b1479e77b5911e6fb2d8905f81aba26a8fe866aed5d0e64e4" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "a1b49905ebc538f830cf3d5440d92006", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7166, "upload_time": "2018-09-23T20:16:31", "url": "https://files.pythonhosted.org/packages/20/ae/a52475f5cce5d016c49538c598ec955f27226d886d60b27d65e32a2cb698/pyramid_selectauth-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9ad94e7e1237ecc8bdf4a8928d1bb65", "sha256": "b35ce45aa7f9c1bb79980a4b5d5d3c14b5e80a6405cf18f32423e0459f039c05" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.0.tar.gz", "has_sig": true, "md5_digest": "d9ad94e7e1237ecc8bdf4a8928d1bb65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12855, "upload_time": "2018-09-23T20:16:33", "url": "https://files.pythonhosted.org/packages/19/82/336dc831fff40fa7631bf02840c26474e242504176b2947252aca35223e3/pyramid_selectauth-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "83ad525862653cab09b33bba62cd029c", "sha256": "5be9c56be90ceebf2de6825586fa54c0693aa2d7d52613f4731710146bf7d058" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "83ad525862653cab09b33bba62cd029c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7343, "upload_time": "2018-09-24T07:29:48", "url": "https://files.pythonhosted.org/packages/70/a6/86993a23a2f22e07ed11ccb3f782d0f3f0c11cec6f2517abb8e8c3809467/pyramid_selectauth-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "707d86bc2ccd36bc60640dd1d822c70d", "sha256": "69211a9c53637dffcb20cfd6836644c09b467e9b1b9eae63fcba22dc3d1dd4b4" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.1.tar.gz", "has_sig": true, "md5_digest": "707d86bc2ccd36bc60640dd1d822c70d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13045, "upload_time": "2018-09-24T07:29:50", "url": "https://files.pythonhosted.org/packages/c0/0c/74d186cc1c58f00d49c68a06d93e787f6c17a0bb97d073b4b32b1eb65acc/pyramid_selectauth-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "83ad525862653cab09b33bba62cd029c", "sha256": "5be9c56be90ceebf2de6825586fa54c0693aa2d7d52613f4731710146bf7d058" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "83ad525862653cab09b33bba62cd029c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7343, "upload_time": "2018-09-24T07:29:48", "url": "https://files.pythonhosted.org/packages/70/a6/86993a23a2f22e07ed11ccb3f782d0f3f0c11cec6f2517abb8e8c3809467/pyramid_selectauth-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "707d86bc2ccd36bc60640dd1d822c70d", "sha256": "69211a9c53637dffcb20cfd6836644c09b467e9b1b9eae63fcba22dc3d1dd4b4" }, "downloads": -1, "filename": "pyramid_selectauth-1.0.1.tar.gz", "has_sig": true, "md5_digest": "707d86bc2ccd36bc60640dd1d822c70d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13045, "upload_time": "2018-09-24T07:29:50", "url": "https://files.pythonhosted.org/packages/c0/0c/74d186cc1c58f00d49c68a06d93e787f6c17a0bb97d073b4b32b1eb65acc/pyramid_selectauth-1.0.1.tar.gz" } ] }