{ "info": { "author": "Russell Jancewicz", "author_email": "russell.jancewicz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: YACC", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Systems Administration :: Authentication/Directory" ], "description": "python-kadmin\n=============\n\nPython module for kerberos admin (kadm5)\n\n## Initilization\n\n### kadmin\n```python\nimport kadmin\n\nkadm = kadmin.init_with_keytab(\"user/admin@EXAMPLE.COM\", \"/path/to/keytab\")\nkadm = kadmin.init_with_ccache(\"user/admin@EXAMPLE.COM\", \"/path/to/krb5cc\")\nkadm = kadmin.init_with_password(\"user/admin@EXAMPLE.COM\", \"aStrongPassword\")\n```\n### kadmin_local\nused for direct database access as local root account.\n```python\nimport kadmin_local as kadmin\n\nkadm = kadmin.local();\n```\n\\* kadmin\\_local also supports the other init\\_with\\_<method> initializers whereas kadmin does not support local.\nIt is advised that kadmin_local is used for rapid unpacked iteration, other tasks should be handled by the gssapi connection.\n\n\n##Examples:\n\n###Principal Creation: \n\n```python\n>>> \n>>> # ank, addprinc, add_principal are all aliases for principal creation\n>>> # omitting a password or setting to None results in a randomized key\n>>> # kadm.ank(principal [, password|None] [, db_args=db_args])\n>>> \n>>> kadm.ank(\"user@EXAMPLE.COM\", \"correcthorsebatterysaple\")\n>>> kadm.addprinc(\"user@EXAMPLE.COM\", None)\n>>> # \n>>> kadm.add_principal(\"user@EXAMPLE.COM\", None, db_args={'dn':'uid=user,ou=people,dc=example,dc=com'})\n>>>\n```\n\n###Principal Attributes:\n```python\n>>> princ = kadm.getprinc(\"user@EXAMPLE.COM\")\n>>>\n>>> # getters only\n>>> princ.principal\n>>> # get: unicode\n>>>\n>>> princ.name\n>>> # get: unicode\n>>>\n>>> princ.mod_name\n>>> # get: unicode\n>>>\n>>> princ.mod_date\n>>> # get: datetime.datetime\n>>>\n>>> princ.last_pwd_change\n>>> # get: [datetime.datetime|None]\n>>>\n>>> princ.last_success\n>>> # get: [datetime.datetime|None]\n>>>\n>>> princ.last_failure\n>>> # get: [datetime.datetime|None]\n>>>\n>>>\n>>> #getters & setters\n>>> princ.expire = datetime.datetime(2014, 12, 25)\n>>> # get: datetime.datetime\n>>> # set: [str|unicode|datetime.datetime|None]\n>>>\n>>> princ.pwexpire = u'Now'\n>>> # get: datetime.datetime\n>>> # set: [str|unicode|datetime.datetime|None]\n>>>\n>>> princ.maxlife = \"8 Days\"\n>>> # get: datetime.timedelta\n>>> # set: [str|unicode|datetime.timedelta|None]\n>>>\n>>> princ.maxrenewlife = datetime.timedelta(days=2)\n>>> # get: datetime.timedelta\n>>> # set: [str|unicode|datetime.timedelta|None]\n>>>\n>>> princ.policy = \"strong_password_policy\"\n>>> # get: unicode\n>>> # set: [str|unicode|kadmin.Policy]\n>>>\n>>> princ.kvno = 1\n>>> # get: int\n>>> # set: [int]\n>>>\n>>> # at this point the local copy of the principal is modified\n>>> # the remote will not change until commit is called as shown\n>>> princ.commit()\n>>>\n>>> # for an existing principal object discard local state and\n>>> # fetch the state as it appears in the database\n>>> princ.reload()\n\n\n\n```\n\n###Change a password:\n```python\nprinc = kadm.get_princ(\"user@EXAMPLE.COM\")\nprinc.change_password(\"correcthorsebatterystaple\")\n```\n\n###Iteration:\n```python\nfor princ in kadm.principals():\n # princ is a string\n print princ\n\nfor princ in kadm.principals('r*@EXAMPLE.COM'):\n # princ is a string starting with 'r' and ending with '@EXAMPLE.COM'\n print princ\n\n# unpacked iteration\n# prints each principal, data is optiona\n\ndef callback_a(princ, data):\n\tprint(princ)\n\ndef callback_b(princ, data):\n\tprint(\"{0}{1}\".format(data, princ))\n\n# invoke callback_a for each principal, equivilent of the above iteration.\nkadm.each_principal(callback_a)\n\n# invoke callback_b for each principal resulting in \"Hello, principal@EXAMPLE.COM\"\nkadm.each_principal(callback_b, data=\"Hello, \")\n\n#\n# WARNING: unpack iteration deprecated in favor of \"each iteration\" with callbacks.\n#\t\t unless run on the default backend via kadmin_local unpack iteration is *extremely* slow.\n#\n\n# old style unpack iteration [updated]\n# replaces: kadm.principals('*', unpack=True)\n\nfor princ in kadm.principals('*'):\n\tprincipal = kadm.get_princ(princ)\n\t# use principal as needed\n\n```\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/russjancewicz/python-kadmin/tarball/v0.1.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/russjancewicz/python-kadmin", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "python-kadmin-local", "package_url": "https://pypi.org/project/python-kadmin-local/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-kadmin-local/", "project_urls": { "Download": "https://github.com/russjancewicz/python-kadmin/tarball/v0.1.2", "Homepage": "https://github.com/russjancewicz/python-kadmin" }, "release_url": "https://pypi.org/project/python-kadmin-local/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Python module for kerberos admin (kadm5) via root local interface", "version": "0.1.2" }, "last_serial": 1842172, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3dbe0878ae63112502b5838ec04268c2", "sha256": "2d7f5e493875a02584d2e3ac2fc69b10e8cb363090dd8ae22f67049f4926fb0f" }, "downloads": -1, "filename": "python-kadmin-local-0.1.tar.gz", "has_sig": false, "md5_digest": "3dbe0878ae63112502b5838ec04268c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54276, "upload_time": "2015-01-06T19:07:04", "url": "https://files.pythonhosted.org/packages/bc/4b/6a747b4196fe50dbef1d58e70838b56eb35691620b2fb6f3e24c40e5e812/python-kadmin-local-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5c04a8456bfd7206febe431c3a5bfa91", "sha256": "d4841e6c647d8b8e1cb3e0f9165f0fff73faa6de7f6f685aa57e6cb73150130c" }, "downloads": -1, "filename": "python-kadmin-local-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5c04a8456bfd7206febe431c3a5bfa91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56082, "upload_time": "2015-04-28T22:27:45", "url": "https://files.pythonhosted.org/packages/83/6d/1170e2aaad2b5d27a303ec51c26ad48ef50aeb60369403bb96e79540182b/python-kadmin-local-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a14085099ddbd641bc7eea6a15e6c837", "sha256": "b85100a9c44b38332357902fbb7f6a8842260ee6ac89d23c696ad9006ed145ed" }, "downloads": -1, "filename": "python-kadmin-local-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a14085099ddbd641bc7eea6a15e6c837", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56217, "upload_time": "2015-12-01T20:51:05", "url": "https://files.pythonhosted.org/packages/58/4a/7c03fdffc77b0a64bd8fc45b7f527c4a6dd4ac93daef7a54254d49147b3f/python-kadmin-local-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a14085099ddbd641bc7eea6a15e6c837", "sha256": "b85100a9c44b38332357902fbb7f6a8842260ee6ac89d23c696ad9006ed145ed" }, "downloads": -1, "filename": "python-kadmin-local-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a14085099ddbd641bc7eea6a15e6c837", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56217, "upload_time": "2015-12-01T20:51:05", "url": "https://files.pythonhosted.org/packages/58/4a/7c03fdffc77b0a64bd8fc45b7f527c4a6dd4ac93daef7a54254d49147b3f/python-kadmin-local-0.1.2.tar.gz" } ] }