{ "info": { "author": "Simplon B.V. - Wichert Akkerman", "author_email": "wichert@wiggy.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Pyramid authentication stack\n============================\n\n.. image:: https://travis-ci.org/wichert/pyramid_authstack.png?branch=master\n :target: https://travis-ci.org/wichert/pyramid_authstack\n\nThe `pyramid_authstack` package makes it possible to stack multiple\nauthentication policies in a `pyramid `_ project.\nThis can be useful in several scenarios:\n\n- You need to be able to identify a user for a long period of time, while\n requiting a recent login to access personal information. Amazon is an\n example of a site doing this.\n\n- You want to send a newsletter to users and log the user in automatically when\n they follow a link in the newsletter, but not give automatically give them\n access to sensitive information.\n\nConfusing a multi-authentication policy is simple: create an instance\nof the `AuthenticationStackPolicy` object, add the authentication policies\nyou want to it and then tell Pyramid to use it.\n\n::\n\n from pyramid.authentication import AuthTktAuthenticationPolicy\n from pyramid_authstack import AuthenticationStackPolicy\n\n auth_policy = AuthenticationStackPolicy()\n # Add an authentication policy with a one-hour timeout to control\n # access to sensitive information.\n auth_policy.add_policy(\n 'sensitive',\n AuthTktAuthenticationPolicy('secret', timeout=60 * 60))\n # Add a second authentication policy with a one-year timeout so\n # we can identify the user.\n auth_policy.add_policy(\n 'identity',\n AuthTktAuthenticationPolicy('secret', timeout=60 * 60 * 24 * 365))\n config.set_authentication_policy(auth_policy)\n\nThe name used for the sub-policy (`sensitive` and `identity` in the example\nabove) will be added to the principals if the sub-policy can authenticate the\nuser. This makes it very easy to check which authentication policies matched\nin an ACL::\n\n class MyModel(object):\n # Only allow access if user authenticated recently.\n __acl__ = [(Allow, 'auth:sensitive', 'view')]\n\n\nWhen you call `remember()\n`_ or `forget()\n`_ all sub-policies will be trigged. You can filter the list\nof policies used by adding a `policies` parameter. A use case where this\nis important is a user coming to the site via a link in a newsletter: in\nthat scenario you can identify the user, but do not want to give access\nto sensitive information without asking for extra credentials.\n\n::\n\n from pyramid.security import remember\n\n # Only set identity-authentication.\n headers = remember(request, 'chrism', policies=['identity'])\n\n\nComparison to pyramid_multiauth\n===============================\n\nMozilla has a similar project: `pyramid_multiauth\n`_. There are a few difference\nbetween that package and this one:\n\n* pyramid_multiauth has no way to indicate which authentication policy matched,\n which makes it unusable for my uses causes unless you always use custom\n authentication sub-policies which add custom an extra principal. This could\n be fixed, but it would require changing the API in a non-backward compatible\n way.\n* pyramid_multiauth duplicates some of the callback-handling code instead of\n reusing pyramid's CallbackAuthenticationPolicy.\n* pyramid_multiauth allows configuration via the PasteDeploy .ini file, which\n pyramid_authstack does not support.\n\n\nChangelog\n=========\n\n1.0.1 - August 10, 2013\n-----------------------\n\n- Fix use of obsolete naming in the README.\n\n- Add callback parameter to constructor.\n\n\n1.0.0 - August 10, 2013\n-----------------------\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wichert/pyramid_authstack", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pyramid_authstack", "package_url": "https://pypi.org/project/pyramid_authstack/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_authstack/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wichert/pyramid_authstack" }, "release_url": "https://pypi.org/project/pyramid_authstack/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Use multiple authentication policies with pyramid", "version": "1.0.1" }, "last_serial": 837320, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5d0c666f2547ee474b5add07ed79aeb2", "sha256": "2ae346a28a6eb51556c558dc2ec19a4afc550c7e752aa89dcb6239d5e0f53652" }, "downloads": -1, "filename": "pyramid_authstack-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5d0c666f2547ee474b5add07ed79aeb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5060, "upload_time": "2013-08-10T17:11:41", "url": "https://files.pythonhosted.org/packages/e0/19/d725a7715bfbc2939882a1f970b3b6699fde36679f304aa41e795e83c67b/pyramid_authstack-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8e199862b5a5cd6385f7d5209cee2f12", "sha256": "039a291588f99a00585f145deca40a48ba23194aa2582e4f244d5da98303cad3" }, "downloads": -1, "filename": "pyramid_authstack-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8e199862b5a5cd6385f7d5209cee2f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5168, "upload_time": "2013-08-10T21:52:39", "url": "https://files.pythonhosted.org/packages/01/4b/e84cb8fda19f0f03f96231195fd074212b9291f732aa07f90edcfb21ff34/pyramid_authstack-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e199862b5a5cd6385f7d5209cee2f12", "sha256": "039a291588f99a00585f145deca40a48ba23194aa2582e4f244d5da98303cad3" }, "downloads": -1, "filename": "pyramid_authstack-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8e199862b5a5cd6385f7d5209cee2f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5168, "upload_time": "2013-08-10T21:52:39", "url": "https://files.pythonhosted.org/packages/01/4b/e84cb8fda19f0f03f96231195fd074212b9291f732aa07f90edcfb21ff34/pyramid_authstack-1.0.1.tar.gz" } ] }