{ "info": { "author": "Souheil Chelfouh", "author_email": "souheil@chelfouh.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "Sitting on the top the ``zope.pluggableauth`` package,\n``dolmen.authentication`` extends it to add reusable component\ndescriptions and implementations.\n\nOverview\n========\n\n``dolmen.authentication`` provides interfaces and components::\n\n >>> import dolmen.authentication\n >>> from dolmen.authentication import IAuthenticationInterfaces\n >>> from dolmen.authentication import IAuthenticationEvents\n >>> from dolmen.authentication import IAuthenticationAPI\n\n >>> IAuthenticationAPI.isOrExtends(IAuthenticationInterfaces)\n True\n \n >>> IAuthenticationAPI.isOrExtends(IAuthenticationEvents)\n True\n\n >>> from zope.interface.verify import verifyObject\n >>> verifyObject(IAuthenticationAPI, dolmen.authentication)\n True\n\n\nDescriptive interfaces\n======================\n\n``dolmen.authentication`` provides a set of base interfaces that can be\nused to normalize an authentication system::\n\n >>> print IAuthenticationInterfaces.__doc__\n This interface describes and exposes the meaningful interfaces\n of the authentication module.\n\n >>> interfaceDescription(IAuthenticationInterfaces)\n IPrincipalFolder: A container specialized in storing principal representations.\n IAccountStatus: Abstraction component allowing to check the status of a principal.\n IPrincipal: A principal representation, directly inheriting from zope.security IPrincipal, but redefining several fields for a user-friendly form display.\n IGroup: A logical grouping of principals. This component is an IPrincipal itself.\n IPasswordProtected: This interface defines any component protected by a password\n IPasswordChecker: Abstraction component in charge of resolving a principal'scredentials.\n\n >>> IAuthenticationInterfaces.providedBy(dolmen.authentication.interfaces)\n True\n\n >>> verifyObject(IAuthenticationInterfaces, dolmen.authentication.interfaces)\n True\n\n\nEvents interfaces and implementations\n=====================================\n\n``dolmen.authentication`` provides a set of basic events that can be\nused and declined, in order to handle and trace principals' lifecycles::\n\n >>> print IAuthenticationEvents.__doc__\n This interface describes and exposes the meaningful events\n descriptions and components of the authentication module.\n\n >>> interfaceDescription(IAuthenticationEvents)\n IUserLoggedOutEvent: IObjectEvent extending event : a user has logged out.\n IUserLoggedInEvent: IObjectEvent extending event : a user has logged in.\n UserLogoutEvent: An IUserLoggedOutEvent implementation.\n UserLoginEvent: An IUserLoggedInEvent implementation.\n\n >>> IAuthenticationEvents.providedBy(dolmen.authentication.events)\n True\n\n >>> verifyObject(IAuthenticationEvents, dolmen.authentication.events)\n True\n\n\nPrincipal related components\n============================\n\nFinally, ``dolmen.authentication`` provides components that can be used to\ninteract with ``zope.pluggableauth``.\n\nLocatable PrincipalInfo\n-----------------------\n\nIf your principal is persisted in a container, it is locatable. The principal\nrepresentation (IPrincipalInfo), handled by ``zope.pluggableauth``, could\nbenefit from the principal location's information.\n\nThis is what the LocatablePrincipalInfo component provides::\n\n >>> from zope.location import ILocation\n >>> from dolmen.authentication import LocatablePrincipalInfo\n\n >>> 'LocatablePrincipalInfo' in IAuthenticationAPI\n True\n\n >>> ILocation.implementedBy(LocatablePrincipalInfo)\n True\n\nIt can be used to link a user to its own representation in the site or\nto any object, like a homefolder or a preferences sheet.\n\nThis component is registered an adapter, for the IPrincipal components. Let's\ncreate a persisted principal, to check the behavior::\n\n >>> from zope.interface import implements\n\n >>> class User(object):\n ... implements(dolmen.authentication.IPrincipal)\n ...\n ... def __init__(self, id, title):\n ... self.id = id\n ... self.title = title\n ... self.description = u\"A test user\"\n ... self.groups = []\n\n >>> myuser = User('Manfred', u\"A nice mammoth\")\n\n >>> verifyObject(dolmen.authentication.IPrincipal, myuser)\n True\n\nCurrently, `myuser` is not providing ILocation. Adapting it will work,\nbut the location information will be unexistant::\n\n >>> from zope.pluggableauth.interfaces import IPrincipalInfo\n >>> adapter = IPrincipalInfo(myuser)\n\n >>> adapter\n \n\n >>> IPrincipalInfo.providedBy(adapter)\n True\n\n >>> print adapter.__name__\n None\n >>> print adapter.__parent__\n None\n\nNow, if we make the principal a valid ILocation, we can exploit the results::\n\n >>> from zope.interface import alsoProvides\n\n >>> class MyParent(object):\n ... pass\n\n >>> myuser.__name__ = u\"Manfred the mammoth\"\n >>> myuser.__parent__ = MyParent()\n >>> alsoProvides(myuser, ILocation)\n\n >>> adapter = IPrincipalInfo(myuser)\n\n >>> print adapter.__name__\n Manfred the mammoth\n >>> print adapter.__parent__\n \n\nNow, the principal info can be resolved into an URL and used as a practical\nrepresentation of te principal.\n\nChanges\n=======\n\n0.3 (2012-01-17)\n----------------\n\n - Updates on code to fit last changes in the Dolmen/Grok stack.\n\n\n0.2 (2010-05-29)\n----------------\n\n - the LocatablePrincipalInfo adapter now implements _and_ provides\n the IPrincipalInfo interface. This allows the adapter to be used in\n the AuthenticatedPrincipalFactory adaptation.\n\n\n0.1 (2010-03-26)\n----------------\n\n - Initial release.", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/dolmen.authentication", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.dolmen-project.org", "keywords": "Grok Zope3 Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "dolmen.authentication", "package_url": "https://pypi.org/project/dolmen.authentication/", "platform": "Any", "project_url": "https://pypi.org/project/dolmen.authentication/", "project_urls": { "Download": "http://pypi.python.org/pypi/dolmen.authentication", "Homepage": "http://www.dolmen-project.org" }, "release_url": "https://pypi.org/project/dolmen.authentication/0.3/", "requires_dist": null, "requires_python": null, "summary": "Authentication for Grok applications", "version": "0.3" }, "last_serial": 791325, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0b812c82de33b3259e1bb29fd6dbcaaa", "sha256": "c0f4d8e3bed4b47c8a9655c35c873f872cee3b11a4acfc511b9a28f55d69c411" }, "downloads": -1, "filename": "dolmen.authentication-0.1.tar.gz", "has_sig": false, "md5_digest": "0b812c82de33b3259e1bb29fd6dbcaaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5901, "upload_time": "2010-03-26T18:33:52", "url": "https://files.pythonhosted.org/packages/f0/70/de897b54c0b2e116886a4136bfadb80f841652c3afabb20e58d377abc9f8/dolmen.authentication-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e7830b83f4a635a8504ba513ce0deff5", "sha256": "6012d489096ef1da40fd63f757baef62941de253163242231966d7797e8fa95f" }, "downloads": -1, "filename": "dolmen.authentication-0.2.tar.gz", "has_sig": false, "md5_digest": "e7830b83f4a635a8504ba513ce0deff5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6021, "upload_time": "2010-05-29T19:02:29", "url": "https://files.pythonhosted.org/packages/8c/e8/10fc375dc88092515ce12861481a1ee1a57681c83d052dda3c3e03aaf182/dolmen.authentication-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "59c4e508b20d033c8f89ff0090ea60b8", "sha256": "3c1387f6a19f026686a8de524634e300fb5b644180ebdfd464d628c4d7f3e8b3" }, "downloads": -1, "filename": "dolmen.authentication-0.3.tar.gz", "has_sig": false, "md5_digest": "59c4e508b20d033c8f89ff0090ea60b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6049, "upload_time": "2012-01-18T14:14:29", "url": "https://files.pythonhosted.org/packages/e8/d6/fac60527b4a3000901f464a1158533f84e8bcce07c5445792b94ccabbafb/dolmen.authentication-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "59c4e508b20d033c8f89ff0090ea60b8", "sha256": "3c1387f6a19f026686a8de524634e300fb5b644180ebdfd464d628c4d7f3e8b3" }, "downloads": -1, "filename": "dolmen.authentication-0.3.tar.gz", "has_sig": false, "md5_digest": "59c4e508b20d033c8f89ff0090ea60b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6049, "upload_time": "2012-01-18T14:14:29", "url": "https://files.pythonhosted.org/packages/e8/d6/fac60527b4a3000901f464a1158533f84e8bcce07c5445792b94ccabbafb/dolmen.authentication-0.3.tar.gz" } ] }