{ "info": { "author": "Maurits van Rees", "author_email": "m.van.rees@zestsoftware.nl", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Plone", "Framework :: Plone :: 4.3", "Framework :: Plone :: 5.1", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7" ], "description": ".. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html\n This text does not appear on pypi or github. It is a comment.\n\n===================\npas.plugins.headers\n===================\n\nThis PAS plugin reads request headers and uses them for authentication.\nThink SAML headers that are set by a front web server like Apache or nginx.\n\n\nFeatures\n--------\n\nOn install in Plone, the plugin is added to the ``PluggableAuthService``.\nIt is registered for several plugin types:\n\n- Challenge plugin\n- Extraction plugin\n- Authentication plugin\n- Properties plugin\n- Roles plugin\n\nYou can configure them in the ZMI (Zope Management Interface) by editing properties in the plugin.\n\n\nInstallation\n------------\n\nInstall pas.plugins.headers by adding it to your buildout::\n\n [buildout]\n\n ...\n\n eggs =\n pas.plugins.headers\n\n\nand then running ``bin/buildout``.\nStart Plone and install the plugin in the Add-ons control panel.\n\n\nCompatibility\n-------------\n\nThis has been tested to work on Plone 4.3 and 5.1.\n\n\nPlain Zope?\n-----------\n\nNo, this does not work in plain Zope.\nTheoretically it might work if you first install ``Products.PluggableAuthService`` and ``Products.GenericSetup``.\nBut then you already almost have a ``CMF`` site.\n\n\nManual configuration\n--------------------\n\nYou can configure the plugin by going to the ZMI (Zope Management Interface).\nGo to the ``acl_users`` (``PluggableAuthService``) folder in the Plone ZMI.\nClick on the ``request_headers`` plugin.\nGo to the Properties tab.\n\nThese are the properties that you can edit:\n\n``userid_header``:\n Header to use as user id.\n\n``roles_header``:\n Header to use as roles for the current user.\n This can give multiple roles: it is split on white space.\n\n``allowed_roles``:\n Allowed roles.\n Roles that we allow in the ``roles_header``.\n Any other roles that are in the header are ignored.\n Ignored when empty: all roles are taken over, also when the role is not known in Plone.\n The roles from the header and the ``allowed_roles`` property are compared lowercase.\n The reported roles use the case from``allowed_roles``.\n For example, if the header contains ``PUPIL root`` and ``allowed_roles`` contains ``Pupil Teacher``, then the reported roles will be only ``Pupil``.\n\n``required_headers``:\n Required headers.\n Without these, the extraction plugin does not extract headers, so the user is not authenticated.\n These headers may have an empty value in the request, as long as they are all there.\n\n``deny_unauthorized``:\n Deny unauthorized access.\n Default: false.\n When this is true and the user is unauthorized, the Challenge plugin stops and presents an ugly error.\n When false, the Challenge plugin will check the ``redirect_url``.\n\n``redirect_url``:\n URL to redirect to when unauthorized.\n When empty, it has no effect.\n When set, the Challenge plugin redirects unauthorized users to this url.\n If ``deny_unauthorized`` is true, this option is ignored.\n\n``memberdata_to_header``:\n Mapping from memberdata property to request header, one per row.\n Format: ``propname|header``.\n Or: ``propname|header|parser``.\n See the Parsers_ section for information about parsers\n You can also combine several headers:\n ``propname|header_with_firstname header_with_lastname``.\n\n\nConfiguration via GenericSetup\n------------------------------\n\nThe package has a GS (``GenericSetup``) import step with id ``pas.plugins.headers``.\nIn the GS profile of your add-on, it looks for a file with name ``pas.plugins.headers.json``.\nThis file must contain a json string.\nFull example:\n\n::\n\n {\n \"purge\": true,\n \"allowed_roles\": [\n \"Member\",\n \"Zebra\"\n ],\n \"deny_unauthorized\": true,\n \"memberdata_to_header\": [\n \"uid|HEADER_uid|lower\",\n \"fullname|HEADER_firstname HEADER_lastname\"\n ],\n \"redirect_url\": \"https://maurits.vanrees.org\",\n \"required_headers\": [\n \"uid\",\n \"test\"\n ],\n \"roles_header\": \"roles\",\n \"userid_header\": \"uid\"\n }\n\nSome remarks:\n\n- When the contents cannot be parsed as json, or when the result is not a dictionary, a ``ValueError`` is raised.\n\n- ``purge`` is optional. When it is true, the default settings are restored before handling the rest of the file.\n\n- ``purge`` is only valid for the entire file.\n It does not work in individual lists.\n So you cannot add one required header and keep the current ones.\n You need to specify them all.\n\n- The keys are the properties that you see in the ZMI.\n\n- When an unknown key is used, it is silently ignored.\n\n- In ``memberdata_to_header``, the importer does not check if the parsers are registered.\n\n\nParsers\n-------\n\nIn the ``memberdata_to_header`` property, you can use parsers.\nFor example::\n\n age|HEADER_age|int\n\nWhen getting the properties for the current user, the properties plugin will calculate the ``age`` property.\nIt reads the ``HEADER_age`` header, which may give a string like ``'42'``.\nIt then calls the ``int`` parser to turn this into integer ``42``.\n\nNote: the properties plugin is currently the only part where the parsers are used.\nSo it is not used when getting for example the user id from a header.\n\nIf you specify a parser that does not exist, the parser is ignored and you get the unmodified header value.\n\nA few basic parsers are available:\n\n``bool``:\n Returns either True or False.\n When the first character of the lowercase header value is ``y/j/t/1``, the parser return True, else False.\n\n``int``:\n Returns an integer.\n When parsing as integer fails, it returns zero.\n\n``lower``:\n Returns the value in lowercase.\n\n``upper``:\n Returns the value in uppercase.\n\n``split``:\n Splits the value on whitespace, so you get a list.\n\nYou can register an own parser::\n\n def extra_parser(value):\n return value + ' extra'\n\n from pas.plugins.headers.parsers import register_parser\n register_parser('extra', extra_parser)\n\nNote: you get a warning when you override an existing parser.\n\n\nContribute\n----------\n\n- Issue tracker: https://github.com/collective/pas.plugins.headers/issues\n- Source code: https://github.com/collective/pas.plugins.headers\n\n\nSupport\n-------\n\nIf you are having issues, please let us know by adding an issue to the tracker: https://github.com/collective/pas.plugins.headers/issues\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\n\nContributors\n============\n\n- Maurits van Rees, m.van.rees@zestsoftware.nl\n\n\nChangelog\n=========\n\n\n1.0.0 (2019-04-25)\n------------------\n\n- Make final release, no changes. [maurits]\n\n\n1.0.0a2 (2018-08-03)\n--------------------\n\n- Documented our ``GenericSetup`` import step.\n Unlike most importers, this reads a ``json`` file, called ``pas.plugins.headers.json``.\n [maurits]\n\n\n1.0.0a1 (2018-08-03)\n--------------------\n\n- Initial release.\n [maurits]\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.org/project/pas.plugins.headers", "keywords": "Python Plone Zope PAS acl_users SAML", "license": "GPL version 2", "maintainer": "", "maintainer_email": "", "name": "pas.plugins.headers", "package_url": "https://pypi.org/project/pas.plugins.headers/", "platform": "", "project_url": "https://pypi.org/project/pas.plugins.headers/", "project_urls": { "Homepage": "https://pypi.org/project/pas.plugins.headers" }, "release_url": "https://pypi.org/project/pas.plugins.headers/1.0.0/", "requires_dist": [ "Products.GenericSetup (>=1.8.2)", "Products.PluggableAuthService", "setuptools", "plone.api ; extra == 'test'", "plone.app.testing ; extra == 'test'", "plone.testing (>=5.0.0) ; extra == 'test'" ], "requires_python": "", "summary": "PAS plugin for authentication based on request headers", "version": "1.0.0" }, "last_serial": 5187903, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e06b4d9988aba2a1de75412d20616665", "sha256": "c82c40bd9980d3c0c7c0b0dafc2ebe9fbaa07d60e5a6dbb8a96025455b2ac820" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e06b4d9988aba2a1de75412d20616665", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 32930, "upload_time": "2019-04-25T13:00:48", "url": "https://files.pythonhosted.org/packages/ab/d3/402d85e59282b98470383e9434cd8874b98e297fe9eb43ebb13fece6f1e6/pas.plugins.headers-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1df5ad333f97beb6bd6f9ff9c11f6a67", "sha256": "e96179d3b2236e5dc56d7b808d6429f4d41fa141d5545c663297499fc51278c7" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1df5ad333f97beb6bd6f9ff9c11f6a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28614, "upload_time": "2019-04-25T13:00:51", "url": "https://files.pythonhosted.org/packages/bb/df/8dc87499bd1f7d3dee0ded826f425d336a16dfd8e4604446758adfc1810f/pas.plugins.headers-1.0.0.tar.gz" } ], "1.0.0a1": [ { "comment_text": "", "digests": { "md5": "7bd58f5449300d720d97334cd457822d", "sha256": "9dd05318bed759e6e61055f9840d9b072065fc67d877a74ab7ed971669a38911" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0a1-py2-none-any.whl", "has_sig": false, "md5_digest": "7bd58f5449300d720d97334cd457822d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24647, "upload_time": "2018-08-03T12:52:48", "url": "https://files.pythonhosted.org/packages/2c/28/f45e19630cb8135096b8895ac7b88dbb3c5ba1a3bb3bbfe1f507f4306f6a/pas.plugins.headers-1.0.0a1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ef24069520a9109c9c4df64b2869fb2", "sha256": "2c987f957c668ca7e74c2f7a25930d031ea925e4fc2a2dba7e7c535b20bc5dba" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0a1.tar.gz", "has_sig": false, "md5_digest": "9ef24069520a9109c9c4df64b2869fb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27027, "upload_time": "2018-08-03T12:52:49", "url": "https://files.pythonhosted.org/packages/33/02/8a6d1a752ff53c0c5d583829015de430f6af1075b84e61a931fe53b81928/pas.plugins.headers-1.0.0a1.tar.gz" } ], "1.0.0a2": [ { "comment_text": "", "digests": { "md5": "b2efad35d9b0adf260ce804bde7e94cd", "sha256": "ded78b62075671ac9a9cfa803e2559161ee2711eca7917e9cf39943a68dfa935" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0a2-py2-none-any.whl", "has_sig": false, "md5_digest": "b2efad35d9b0adf260ce804bde7e94cd", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 25249, "upload_time": "2018-08-03T13:18:59", "url": "https://files.pythonhosted.org/packages/fd/44/adb6975924972366725174088e205abd81bc96e7d5b6e0fc83c91cb41733/pas.plugins.headers-1.0.0a2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d12b1c0adc8e61ed438321fc2ce4852", "sha256": "6ff5f48126795005c9fb721bd569781252f18c0ae1f81e86a0c05f6ebe2d4f52" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0a2.tar.gz", "has_sig": false, "md5_digest": "8d12b1c0adc8e61ed438321fc2ce4852", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28411, "upload_time": "2018-08-03T13:19:00", "url": "https://files.pythonhosted.org/packages/95/f5/09089d58f867528c46864ca491c4bd77167a7011cb198a4fe4baaa098a1d/pas.plugins.headers-1.0.0a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e06b4d9988aba2a1de75412d20616665", "sha256": "c82c40bd9980d3c0c7c0b0dafc2ebe9fbaa07d60e5a6dbb8a96025455b2ac820" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e06b4d9988aba2a1de75412d20616665", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 32930, "upload_time": "2019-04-25T13:00:48", "url": "https://files.pythonhosted.org/packages/ab/d3/402d85e59282b98470383e9434cd8874b98e297fe9eb43ebb13fece6f1e6/pas.plugins.headers-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1df5ad333f97beb6bd6f9ff9c11f6a67", "sha256": "e96179d3b2236e5dc56d7b808d6429f4d41fa141d5545c663297499fc51278c7" }, "downloads": -1, "filename": "pas.plugins.headers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1df5ad333f97beb6bd6f9ff9c11f6a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28614, "upload_time": "2019-04-25T13:00:51", "url": "https://files.pythonhosted.org/packages/bb/df/8dc87499bd1f7d3dee0ded826f425d336a16dfd8e4604446758adfc1810f/pas.plugins.headers-1.0.0.tar.gz" } ] }