{ "info": { "author": "Ross Patterson", "author_email": "me@rpatterson.net", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=======================\nz3c.recipe.ldap package\n=======================\n\n.. contents::\n\nWhat is z3c.recipe.ldap ?\n=========================\n\nThis recipe can be used to deploy an OpenLDAP server in a\nzc.buildout. More specifically it provides for initializing an LDAP\ndatabase from an LDIF file and for setting up an LDAP instance in the\nbuildout. This recipe can also be used to provide an isolated LDAP\ninstance as a test fixture.\n\nHow to use z3c.recipe.ldap ?\n============================\n\n-------------------------\nInstalling slapd instance\n-------------------------\n\nThe default recipe in z3c.recipe.ldap can be used to deploy a slapd\nLDAP server in the buildout. Options in the slapd part not used by\nthe recipe itself will be used to create and populate a slapd.conf\nfile.\n\nThe only required option is the suffix argupent. Specifying the\nsuffix with a dc requires that the \"dc\" LDAP attribute type\nconfiguration. Write a buildout.cfg with a suffix and include\ncore.schema for the attribute type configuration. Also specify that\nthe server should use a socket instead of a network port::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = slapd\n ... find-links = http://download.zope.org/ppix/\n ...\n ... [slapd]\n ... recipe = z3c.recipe.ldap\n ... slapd = %(openldap)s/libexec/slapd\n ... use-socket = True\n ... allow = bind_v2\n ... include =\n ... %(openldap)s/etc/openldap/schema/core.schema\n ... foo.schema\n ... bar.conf\n ... modulepath = \n ... moduleload = \n ... suffix = \"dc=localhost\"\n ... \"\"\" % globals())\n\nCreate the files to be included::\n\n >>> write(sample_buildout, 'foo.schema', '\\n')\n >>> write(sample_buildout, 'bar.conf', '\\n')\n\nRun the buildout::\n\n >>> print system(buildout),\n Installing slapd.\n Generated script '/sample-buildout/bin/slapd'.\n\nThe configuration file is created in the part by default. Note that\nkeys that can be specified multiple times in slapd.conf, such as\ninclude, will be constitued from multiple line separated values when\npresent. Also note that keys that contain file paths in slapd.conf,\nsuch as include, will be expanded from the buildout directory.\nFinally note that options specified with blank values will be\nexcluded::\n\n >>> ls(sample_buildout, 'parts', 'slapd')\n - slapd.conf\n >>> cat(sample_buildout, 'parts', 'slapd', 'slapd.conf')\n include\t.../etc/openldap/schema/core.schema\n include\t/sample-buildout/foo.schema\n include\t/sample-buildout/bar.conf\n pidfile\t/sample-buildout/parts/slapd/slapd.pid\n allow\tbind_v2\n database\tbdb\n suffix\t\"dc=localhost\"\n directory\t/sample-buildout/var/slapd\n dbconfig\tset_cachesize\t0\t268435456\t1\n dbconfig\tset_lg_regionmax\t262144\n dbconfig\tset_lg_bsize\t2097152\n index\tobjectClass\teq\n\nThe socket path is properly escaped in the configuration::\n\n >>> cat(sample_buildout, '.installed.cfg')\n [buildout]...\n [slapd]...\n urls = ldapi://...%2Fsample-buildout%2Fparts%2Fslapd%2Fslapd.socket\n ...\n\nAn empty directory is created for the LDAP database::\n\n >>> ls(sample_buildout, 'var')\n d slapd\n >>> ls(sample_buildout, 'var', 'slapd')\n\nA script is also created for starting and stopping the slapd server::\n\n >>> ls(sample_buildout, 'bin')\n - buildout\n - slapd\n\nStart the slapd server::\n\n >>> bin = join(sample_buildout, 'bin', 'slapd')\n >>> print system(bin+' start'),\n\nOn first run, the LDAP database is created::\n\n >>> ls(sample_buildout, 'var', 'slapd')\n - DB_CONFIG\n - __db.001...\n\nWhile the server is running a pid file is created and also a socket in\nthis case::\n\n >>> ls(sample_buildout, 'parts', 'slapd')\n - slapd.conf\n - slapd.pid\n - slapd.socket\n\nStop the slapd server::\n\n >>> print system(bin+' stop'),\n\nWhen the slapd server finishes shutting down the pid file is deleted::\n\n >>> ls(sample_buildout, 'parts', 'slapd')\n - slapd.conf\n\nThe slapd binary\n----------------\n\nThe slapd binary to be used can be specified as we did above when we\nspecified the slapd binary from the buildout OpenLDAP CMMI part::\n\n >>> cat(sample_buildout, '.installed.cfg')\n [buildout]...\n [slapd]...\n slapd = .../parts/openldap/libexec/slapd\n ...\n\nIf no binary is specified, it's left up to the environment.\nWrite a buildout.cfg with no slapd specified::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = slapd\n ...\n ... [slapd]\n ... recipe = z3c.recipe.ldap\n ... use-socket = True\n ... \"\"\")\n\nRun the buildout::\n\n >>> print system(buildout),\n Uninstalling slapd.\n Installing slapd.\n Generated script '/sample-buildout/bin/slapd'.\n\nNow it will find the binary on the system path::\n\n >>> cat(sample_buildout, '.installed.cfg')\n [buildout]...\n [slapd]...\n slapd = slapd\n ...\n\n----------------------------\nInitalizing an LDAP database\n----------------------------\n\nThe z3c.recipe.ldap.Slapadd can be used initialize an LDAP database\nfrom an LDIF file. In the simplest form, simply provide an \"ldif\"\noption in the part with one or more filenames.\n\nWrite a buildout.cfg that lists some LDIF files::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = slapd slapadd\n ...\n ... [slapd]\n ... recipe = z3c.recipe.ldap\n ... include =\n ... %(openldap)s/etc/openldap/schema/core.schema\n ... %(openldap)s/etc/openldap/schema/cosine.schema\n ... modulepath = \n ... moduleload = \n ... suffix = \"dc=localhost\"\n ...\n ... [slapadd]\n ... recipe = z3c.recipe.ldap:slapadd\n ... slapadd = %(openldap)s/sbin/slapadd\n ... conf = ${slapd:conf}\n ... ldif =\n ... dc.ldif\n ... admin.ldif\n ... \"\"\" % globals())\n\nWrite the LDIF files::\n\n >>> write(sample_buildout, 'dc.ldif',\n ... \"\"\"\n ... dn: dc=localhost\n ... dc: localhost\n ... objectClass: top\n ... objectClass: domain\n ... \"\"\")\n >>> write(sample_buildout, 'admin.ldif',\n ... \"\"\"\n ... dn: cn=admin,dc=localhost\n ... objectClass: person\n ... cn: admin\n ... sn: Manager\n ... \"\"\")\n\nRun the buildout::\n\n >>> print system(buildout),\n Uninstalling slapd.\n Installing slapd.\n Generated script '/sample-buildout/bin/slapd'.\n Installing slapadd.\n\nThe entries have been added to the LDAP database::\n\n >>> print system(os.path.join(openldap, 'sbin', 'slapcat')+' -f '+\n ... os.path.join(sample_buildout,\n ... 'parts', 'slapd', 'slapd.conf')),\n dn: dc=localhost\n dc: localhost\n objectClass: top\n objectClass: domain...\n dn: cn=admin,dc=localhost\n objectClass: person\n cn: admin\n sn: Manager...\n\nThe LDIF files are added on update also.\n\nRemove the existing LDAP database::\n\n >>> rmdir(sample_buildout, 'var', 'slapd')\n >>> mkdir(sample_buildout, 'var', 'slapd')\n\nRun the Buildout to add the LDIF files again::\n\n >>> print system(buildout),\n Updating slapd.\n Updating slapadd.\n\nThe entries have been added to the LDAP database::\n\n >>> print system(os.path.join(openldap, 'sbin', 'slapcat')+' -f '+\n ... os.path.join(sample_buildout,\n ... 'parts', 'slapd', 'slapd.conf')),\n dn: dc=localhost\n dc: localhost\n objectClass: top\n objectClass: domain...\n dn: cn=admin,dc=localhost\n objectClass: person\n cn: admin\n sn: Manager...", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/z3c.recipe.ldap", "keywords": "", "license": "ZPL", "maintainer": null, "maintainer_email": null, "name": "z3c.recipe.ldap", "package_url": "https://pypi.org/project/z3c.recipe.ldap/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/z3c.recipe.ldap/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/z3c.recipe.ldap" }, "release_url": "https://pypi.org/project/z3c.recipe.ldap/0.1/", "requires_dist": null, "requires_python": null, "summary": "Deploy an OpenLDAP server in a zc.buildout", "version": "0.1" }, "last_serial": 802080, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3ec4acb5556403ca4cb2f21b20ab0f95", "sha256": "0599b5235c8d9e838e6764284f2de1306c723ecfb1349def5ddb335b6b880a71" }, "downloads": -1, "filename": "z3c.recipe.ldap-0.1.tar.gz", "has_sig": false, "md5_digest": "3ec4acb5556403ca4cb2f21b20ab0f95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8129, "upload_time": "2008-01-25T01:54:52", "url": "https://files.pythonhosted.org/packages/da/d6/2907103314d0fa6e769c01949258b0f4be8d687ea9e621d0660fbb16a15e/z3c.recipe.ldap-0.1.tar.gz" } ], "0.1dev-r83198": [ { "comment_text": "", "digests": { "md5": "827d4fe4632d20387c153a8a2a713c6c", "sha256": "66363a7c42a81e961af33dbb96ce762dd4aaf630742a2e08b73e4f7bf8ca1056" }, "downloads": -1, "filename": "z3c.recipe.ldap-0.1dev-r83198.tar.gz", "has_sig": false, "md5_digest": "827d4fe4632d20387c153a8a2a713c6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8158, "upload_time": "2008-01-25T01:53:59", "url": "https://files.pythonhosted.org/packages/a9/27/c9644ce10adcad0718a53a091620325de5092c5efa42a207b24f377f7dd1/z3c.recipe.ldap-0.1dev-r83198.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ec4acb5556403ca4cb2f21b20ab0f95", "sha256": "0599b5235c8d9e838e6764284f2de1306c723ecfb1349def5ddb335b6b880a71" }, "downloads": -1, "filename": "z3c.recipe.ldap-0.1.tar.gz", "has_sig": false, "md5_digest": "3ec4acb5556403ca4cb2f21b20ab0f95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8129, "upload_time": "2008-01-25T01:54:52", "url": "https://files.pythonhosted.org/packages/da/d6/2907103314d0fa6e769c01949258b0f4be8d687ea9e621d0660fbb16a15e/z3c.recipe.ldap-0.1.tar.gz" } ] }