{ "info": { "author": "Robert Niederreiter", "author_email": "dev@bluedynamics.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope2", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "LDAP convenience library\n========================\n\nThis Package provides objects for LDAP communication. \n\nLDAP Session\n------------\n\nYou can work with the ``LDAPSession`` object.\n::\n\n >>> from bda.ldap import ONELEVEL\n >>> from bda.ldap import LDAPSession\n >>> from bda.ldap import LDAPProps\n \n >>> props = LDAPProps('localhost',\n ... 389,\n ... 'cn=user,dc=example,dc=com',\n ... 'secret'\n ... cache=True,\n ... timeout=12345)\n >>> session = LDAPSession(props)\n >>> res = session.search('(uid=*)', ONELEVEL)\n \nLDAP Node\n---------\n\nYou can build and edit LDAP data trees with the ``LDAPNode`` which is based on \n``zodict.Node``. \n\nThe root Node expects the base DN and the server properties to initialize.\n::\n\n >>> from bda.ldap import LDAPNode\n >>> root = LDAPNode('dc=my-domain,dc=com', props=props)\n >>> root.keys()\n ['ou=customers']\n\nYou can create and add new LDAP entries.\n::\n\n >>> person = LDAPNode()\n >>> person.attributes['objectClass'] = ['top', 'person']\n >>> person.attributes['sn'] = 'Mustermann'\n >>> person.attributes['cn'] = 'Max'\n >>> person.attributes['description'] = 'Description'\n >>> customers['cn=max'] = person\n >>> customers.keys()\n ['cn=max']\n\nOn ``__call__`` the modifications of the tree are written to the directory.\n::\n\n >>> customers()\n\nModification of entry attributes.\n::\n\n >>> person.attributes['description'] = 'Another description'\n >>> person()\n \n >>> del person.attributes['description']\n >>> person()\n\nDeleting of entries.\n::\n\n >>> del customers['cn=max']\n >>> customers()\n\nFor more details see the corresponding source and test files.\n\n\nCharacter Encoding\n------------------\n\nLDAP (v3 at least, `RFC 2251`_) uses utf8 string encoding. Since 1.5.1,\nLDAPSession and LDAPNode translate these to unicodes for you. Consider it a\nbug, if you receive anything else than unicode from LDAPSession or LDAPNode.\nEverything below that LDAPConnector and LDAPCommunicator give you the real ldap\nexperience. - Should we change that, too?\n\nUnicode strings you pass to nodes or sessions are automatically encoded to uft8\nfor LDAP. If you feed them normal strings they are decoded as utf8 and\nreencoded as utf8 to make sure they are utf8 or compatible, e.g. ascii.\n\nIf decoding as utf8 fails, the value is assumed to be in binary and left as a\nstring (see TODO).\n\nIf you have an LDAP server that does not use utf8, monkey-patch\nbda.ldap.strcodec.LDAP_CHARACTER_ENCODING.\n\nIf you are confused by all that encoding/decoding: python knows in what\nencoding it stores its unicodes, however, it cannot know for normal strs.\nTherefore, you should only use unicodes. In order to get a unicode for a str, a\nstring is decoded according to a given encoding schema (eg utf8). And encoding\na unicode produces a str in a specific encoding (eg utf8).\n\n.. _`RFC 2251`: http://www.ietf.org/rfc/rfc2251.txt\n\n\nCaching Support\n---------------\n\n``bda.ldap`` caches LDAP searches using the lightweight ``bda.cache``. You need \nto provide a utility in you application in order to make caching work. If you\ndont, ``bda.ldap`` falls back to use the NullCache, which does not cache \nanything. \n\nTo provide an cache based on ``Memcached`` install the memcached server, \nconfigure and start it. I suppose its started on localhost port 11211 (which is \na common default). Then you need to provide a utility acting as a factory. \n::\n \n >>> from bda.ldap.cache import MemcachedProviderFactory\n >>> providerfactory = MemcachedProviderFactory()\n >>> from zope.component import provideUtility\n >>> provideUtility(providerfactory)\n \nIn the case you have more than one memcached server running or hav it running on \nanother maschine, you need to initialize the factory different:: \n\n >>> providerfactory = MemcachedProviderFactory(servers=[10.0.0.10:22122,\n ... 10.0.0.11:22322])\n >>> provideUtility(providerfactory)\n\n\nDependencies\n============\n\n- python-ldap\n\n- zodict\n\n- bda.cache\n\n\nNotes on python-ldap\n====================\n\nAlthough python-ldap is available via pypi, we excluded it from\n``install_requires`` due to different compile issues on different platforms.\n\nSo you have to make sure that ``pyhon-ldap`` is available on your system in\nany way.\n\n\nTODO\n====\n\n- TLS/SSL Support. in LDAPConnector\n could be useful: python-ldap's class SmartLDAPObject(ReconnectLDAPObject) -\n Mainly the __init__() method does some smarter things like negotiating the\n LDAP protocol version and calling LDAPObject.start_tls_s().\n\n- Improve retry logic in LDAPSession\n could be useful, python-ldap's class ReconnectLDAPObject(SimpleLDAPObject) -\n In case of server failure (ldap.SERVER_DOWN) the implementations of all\n synchronous operation methods (search_s() etc.) are doing an automatic\n reconnect and rebind and will retry the very same operation.\n\n- Extend LDAPSession object to handle Fallback server(s)\n\n- Encoding/Decoding the data sent to ldap changed the order of dict entries,\n probably due to dict implementation. Investigate effects of that. I had the\n impression so far that ldap (at least openldap) preserves the order if you\n give it an ldif file. Iff, then python-ldap should use odicts not dicts.\n\n- check/implement silent sort on only the keys LDAPNode.sortonkeys()\n\n- binary attributes: 1. introduce Binary: ``node['cn=foo'].attributes['image']\n = Binary(stream)``, 2. parse ldap schema to identify binary attributes\n\n\nChanges\n=======\n\n1.5.2\n-----\n\n- assume strings that fail to decode to be binary and leave them as-is\n (chaoflow, 2010-07-19)\n\n- session.search, default filter ``'(objectClass=*)'`` and scope ``BASE``, i.e.\n just calling search returns the basedn entry. Further it is possible to call\n session.search(scope=ONELEVEL) to get all entries one level below the basedn.\n (chaoflow, 2010-07-19)\n\n1.5.1\n-----\n\n- character encoding: LDAPSession and LDAPNode only return unicode and\n enforces utf8 or compatible encoding on all strings they receive,\n see ``Character Encoding``.\n (chaoflow, 2010-07-17)\n\n- introduced strcodec module for unicode->str->unicode translation\n (chaoflow, 2010-07-17)\n\n- add LDAPNode.get to use LDAPNode.__getitem__ instead of odict's\n (chaoflow, 2010-07-16)\n\n- more tests, explode_dn for dn handling (with spaces and escaped commas)\n (chaoflow, 2010-07-16)\n\n- ignore results with dn=None. ActiveDirectory produces them\n (chaoflow, 2010-07-15)\n\n- default filter for session.search, if you pass '', u'' or None as filter\n (chaoflow, 2010-07-15)\n\n- tests for attrlist and attrsonly\n (chaoflow, 2010-07-15)\n\n- adopt for latest zodict.\n (rnix, 2010-07-15)\n\n- added support for sort to node. Note: This wakes up all children of Node.\n (jensens, 2010-04-16) \n\n- added support for \"items() to Node\".\n (jensens, 2010-04-16) \n\n- BBB compatibility for zope2.9\n (rnix, jensens, 2010-02-17)\n\n- If a Node was added and no child added __iter__ failed. Fixed now.\n (jensens, 2010-01-19) \n\n- If a Node was added we cant load its attributes. Takes this into account now.\n (jensens, 2010-01-17) \n\n1.5.0\n-----\n\n- Made ``MemcachedProviderFactory`` configureable. Defaults behave like in prior\n versions. New: We can pass ``server=`` keyword argument to the \n constructor expecting a list of servers, each in the form *server:port*.\n (jensens, 2009-12-30)\n\n- Dont provide any cache provider factory by default. Added a \n ``nullCacheProviderFactory`` which provides a non-caching behaviour. Use this\n as fallback if no utility was registered. \n (jensens, 2009-12-30)\n\n- Add read property ``ldap_session`` to ``LDAPNode``. This way its clean to take \n the session of ``LDAPNode`` in an application i.e. for searching. Be careful \n while using the session directly to manipulate the LDAP; responsibility to \n invalidate the ``LDAPNode`` instances is on the application developer.\n (jensens, 2009-12-30)\n\n1.4.0\n-----\n\n- Add ``LDAPProps`` object. Its points to ``LDAPServerProperties`` class. The\n latter one will be renamed to ``LDAPProps`` in version 1.5. Too long class\n name. (rnix, 2009-12-23)\n\n- Add ``LDAPSession.unbind`` function. (rnix, 2009-12-23)\n\n- Add some tests for ``LDAPSession``. (rnix, 2009-12-23)\n\n- Remove deprecated ``cache`` kwarg from ``LDAPSession.__init__.``. Cache\n timeout and flag if cache is enabled is done due to ``LDAPServerProperties``.\n (rnix, 2009-12-23)\n\n- Deprecate Signature of ``LDAPConnector.__init__``. (rnix, 2009-12-23)\n\n- Deprecate ``LDAPConnector.setProtocol``, ``LDAPCommunicator.setBaseDN``,\n ``LDAPCommunicator.getBaseDN``, ``LDAPSession.setBaseDN``. (rnix, 2009-12-23)\n \n- Refactor the whole ``LDAPNode`` to use ``zodict.LifecycleNode``. Clean up of\n the ``LDAPNode`` code. (jensens, rnix, 2009-12-22)\n\n- improved stop mechanism of ldap server in tests (jensens, 2009-12-16)\n\n- remove deprecation warning: use `hashlib` for md5 and fallback to `md5` \n with python2.4. (jensens, 2009-12-16)\n\n1.3.2\n-----\n\n- handle timeout of cache, workaround atm (rnix, 2009-09-02)\n\n1.3.1\n-----\n\n- add ``cache`` property to ``LDAPProperties``. (rnix, 2009-05-08)\n\n- modify session to fit this new cache property. (rnix, 2009-05-07)\n\n- add ``queryNode`` function. (rnix, 2009-05-07)\n\n- add ``get`` function to node, this failed due LDAP read logic.\n (rnix, 2009-05-07)\n\n1.3\n---\n\n- support ``attrlist`` and ``attrsonly`` for search functions.\n (rnix, 2009-04-16)\n\n- add LDAPEntry object. (rnix, 2009-04-16)\n\n- add search base to cache key. (rnix, 2009-04-16)\n\n1.2.3\n-----\n\n- bugfix in ``LDAPSession``. Pass ``force_reload`` to relevant execution\n function. (rnix, 2009-02-11)\n\n1.2.2\n-----\n\n- add buildout for standalone testing. (rnix, jensens - 2009-02-11)\n\n- add tests. (rnix, jensens - 2009-02-11)\n\n- provide relevant objects via package ``__init__``.\n (rnix, jensens - 2009-02-11)\n\n1.2.1\n-----\n\n- provide same ``search()`` signature in ``LDAPSession`` as\n in ``LDAPCommunicator``. (rnix - 2009-02-10)\n \n- log only on debug. (rnix - 2009-02-10)\n\n<= 1.2\n------\n\n- make it work. \n (all contributors)\n\nCopyright\n=========\n\nCopyright (c) 2006-2009: BlueDynamics Alliance, Austria\n\nCredits\n=======\n\n- Robert Niederreiter \n\n- Jens Klein \n\n- Georg Bernhard \n\n- Florian Friesdorf \n\n- Johannes Raggam ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://svn.plone.org/svn/collective/bda.ldap", "keywords": "", "license": "General Public Licence", "maintainer": null, "maintainer_email": null, "name": "bda.ldap", "package_url": "https://pypi.org/project/bda.ldap/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/bda.ldap/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://svn.plone.org/svn/collective/bda.ldap" }, "release_url": "https://pypi.org/project/bda.ldap/1.5.2/", "requires_dist": null, "requires_python": null, "summary": "LDAP convenience library", "version": "1.5.2" }, "last_serial": 786759, "releases": { "1.1-rc1": [ { "comment_text": "", "digests": { "md5": "905fa9ea08800489a2aec07b62b3c0f3", "sha256": "3c8e44edcd510cfc082c333cae3b7162c2f8b860506581164228f3172bab3586" }, "downloads": -1, "filename": "bda.ldap-1.1-rc1.tar.gz", "has_sig": false, "md5_digest": "905fa9ea08800489a2aec07b62b3c0f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4552, "upload_time": "2008-03-18T07:19:16", "url": "https://files.pythonhosted.org/packages/01/b4/1fa2530acf476e16293a9020d3823a400a703a4ef2411ab37af9e568080b/bda.ldap-1.1-rc1.tar.gz" } ], "1.1-rc2": [ { "comment_text": "", "digests": { "md5": "f54ee26745ad5edf3be32514f25646d6", "sha256": "21d323ccba7e240ce61406d5222257ebf6acbf646572b9d5b1dd11e3213da723" }, "downloads": -1, "filename": "bda.ldap-1.1-rc2.tar.gz", "has_sig": false, "md5_digest": "f54ee26745ad5edf3be32514f25646d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5547, "upload_time": "2008-09-23T08:32:48", "url": "https://files.pythonhosted.org/packages/6f/9b/6700df44fd3052482d68f12d01fe5a87bad0db4470a22a54f9cefac9e5e1/bda.ldap-1.1-rc2.tar.gz" } ], "1.1-rc3": [ { "comment_text": "", "digests": { "md5": "73bddf1aedffe338266d753016ab0c65", "sha256": "e8b70835061b385cce6e383a80a50505e4aaefc8d5301083036a3f9e295a611b" }, "downloads": -1, "filename": "bda.ldap-1.1-rc3.tar.gz", "has_sig": false, "md5_digest": "73bddf1aedffe338266d753016ab0c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5551, "upload_time": "2008-09-24T13:30:49", "url": "https://files.pythonhosted.org/packages/85/07/a24e58a9c2a99a4ed34c3e953f2b6f0f96a6fa8b74a4d8cba85938998c1f/bda.ldap-1.1-rc3.tar.gz" } ], "1.1-rc4": [ { "comment_text": "", "digests": { "md5": "8567a68b30e8d84286e173ec18e1c567", "sha256": "69dfcc2b1bdc0ac51ea6958a428202f0e479e0d75ea84ec8d7e118c0edd82826" }, "downloads": -1, "filename": "bda.ldap-1.1-rc4.tar.gz", "has_sig": false, "md5_digest": "8567a68b30e8d84286e173ec18e1c567", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5629, "upload_time": "2008-09-24T14:20:43", "url": "https://files.pythonhosted.org/packages/bb/af/f68188cecb66f4af8a20f307320b6fdb4932f2b7d34bc74448fe727811ec/bda.ldap-1.1-rc4.tar.gz" } ], "1.1-rc5": [ { "comment_text": "", "digests": { "md5": "f1213cb15605072e243b30984160d057", "sha256": "da23f8bc0cab394cb4a4876e03178b33b5129f36af38e3f3e476ad2ee53a6afe" }, "downloads": -1, "filename": "bda.ldap-1.1-rc5.tar.gz", "has_sig": false, "md5_digest": "f1213cb15605072e243b30984160d057", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5640, "upload_time": "2008-09-24T15:57:14", "url": "https://files.pythonhosted.org/packages/f3/d8/465e47eaa1e638c91fba48a6eeec403f2fcbabab62d971337b10d450eb9a/bda.ldap-1.1-rc5.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "66f800ac5843ab11e34b1d6c2f4765d8", "sha256": "0b164189a0f344ff254a5b1f430bd5c0598155f955111ecd382b694838983d4d" }, "downloads": -1, "filename": "bda.ldap-1.2.tar.gz", "has_sig": false, "md5_digest": "66f800ac5843ab11e34b1d6c2f4765d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5689, "upload_time": "2009-02-10T15:18:27", "url": "https://files.pythonhosted.org/packages/89/8a/edaba77cb28f6b990a5f68532a3bb64e16998cd1ca61e302d06fbd079b0d/bda.ldap-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "bf4bb81cbb27c9bf4230028c89766e65", "sha256": "9ca441d7ecfd4087833a3fd5235dba2f250452e5d2f4badeda454ef5d4ad507e" }, "downloads": -1, "filename": "bda.ldap-1.2.1.tar.gz", "has_sig": false, "md5_digest": "bf4bb81cbb27c9bf4230028c89766e65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5879, "upload_time": "2009-02-10T15:33:54", "url": "https://files.pythonhosted.org/packages/75/89/e6bb5da4607d53fe9cc0ac290872fa3138ce9afd273e5017dbe8987ebe11/bda.ldap-1.2.1.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "c3ad72c7817163e7e9e2919957c3e385", "sha256": "1b573e892e5ecfba6c2a9c211e80cd2c62c81956c67da60e88ae875137a407ec" }, "downloads": -1, "filename": "bda.ldap-1.2.3.tar.gz", "has_sig": false, "md5_digest": "c3ad72c7817163e7e9e2919957c3e385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10019, "upload_time": "2009-04-16T10:09:40", "url": "https://files.pythonhosted.org/packages/82/af/00971de71f91db7a09795cd735857d4948771ebcdfd15c8b4168d9e8e508/bda.ldap-1.2.3.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "178cf0158726e145bca44b72c8da8974", "sha256": "89a5dd1f0070e5017b32e4ca3aec1e420d205f3a09a6822fa20ff626ae57fc1e" }, "downloads": -1, "filename": "bda.ldap-1.3.tar.gz", "has_sig": false, "md5_digest": "178cf0158726e145bca44b72c8da8974", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14510, "upload_time": "2009-04-28T17:16:02", "url": "https://files.pythonhosted.org/packages/db/96/3c212243480851ba7044d6771f944f8e199bfa532503a1c98af50d72f24d/bda.ldap-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "4c2ddb4c989a26056d31888e1062813d", "sha256": "5fbe2c125ba77b0aba39a3a8db5529f96aec814cce9ca3a8f7600c1f7759f986" }, "downloads": -1, "filename": "bda.ldap-1.3.1.tar.gz", "has_sig": false, "md5_digest": "4c2ddb4c989a26056d31888e1062813d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15045, "upload_time": "2009-08-12T09:24:52", "url": "https://files.pythonhosted.org/packages/bd/f9/dc8a49a851f6bcc1c3e9632cf43629cca813f5b8f43e4df123334ccd1eaf/bda.ldap-1.3.1.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "fc2ed63952965b8b543edf8c6227f1cc", "sha256": "7115344c9b5c174da0f65920ac4ae29c176affc00d24b71bb007e990c5d9997e" }, "downloads": -1, "filename": "bda.ldap-1.4.0.tar.gz", "has_sig": false, "md5_digest": "fc2ed63952965b8b543edf8c6227f1cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16938, "upload_time": "2009-12-23T17:52:23", "url": "https://files.pythonhosted.org/packages/d3/bf/6632f46edca12b6b05902e9b21f99a398d5f0002e131cbd69d2be001dd68/bda.ldap-1.4.0.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "c23f86482edb62b2c53729828a8380db", "sha256": "1c0c733803960ec41f58fd31466a977153979c45b42eb5468339594474724540" }, "downloads": -1, "filename": "bda.ldap-1.5.1.tar.gz", "has_sig": false, "md5_digest": "c23f86482edb62b2c53729828a8380db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23734, "upload_time": "2010-07-19T12:38:37", "url": "https://files.pythonhosted.org/packages/68/95/34490eb7f6f4198bc619cc0a467bf23d985911e454fd88493b4e67245567/bda.ldap-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "cef1bde33d047c857bde31c21bcfae68", "sha256": "af3c1caedbb9a9f3c05e82654899486d14d8b99f58a35158c6e9e4a9f906d7e5" }, "downloads": -1, "filename": "bda.ldap-1.5.2.tar.gz", "has_sig": false, "md5_digest": "cef1bde33d047c857bde31c21bcfae68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24513, "upload_time": "2010-07-19T16:19:31", "url": "https://files.pythonhosted.org/packages/fd/05/77bcd280a1748da1455f6abc084b66066b34610a578ce07f81eb5ec16661/bda.ldap-1.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cef1bde33d047c857bde31c21bcfae68", "sha256": "af3c1caedbb9a9f3c05e82654899486d14d8b99f58a35158c6e9e4a9f906d7e5" }, "downloads": -1, "filename": "bda.ldap-1.5.2.tar.gz", "has_sig": false, "md5_digest": "cef1bde33d047c857bde31c21bcfae68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24513, "upload_time": "2010-07-19T16:19:31", "url": "https://files.pythonhosted.org/packages/fd/05/77bcd280a1748da1455f6abc084b66066b34610a578ce07f81eb5ec16661/bda.ldap-1.5.2.tar.gz" } ] }