{ "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", "package_url": "https://pypi.org/project/python-kadmin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-kadmin/", "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/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Python module for kerberos admin (kadm5)", "version": "0.1.2" }, "last_serial": 1842170, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "624a13e49741cd5bc9ba17fed9856faf", "sha256": "a75ceb30ad6164431087e42b0023b8d738f3d6f7c3d18dcfd368be047337ba72" }, "downloads": -1, "filename": "python-kadmin-0.1.tar.gz", "has_sig": false, "md5_digest": "624a13e49741cd5bc9ba17fed9856faf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54249, "upload_time": "2015-01-06T19:07:02", "url": "https://files.pythonhosted.org/packages/75/50/d1930df2bee139856003635487b13fd5c6ca2969cb06032ab91b71482d63/python-kadmin-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6ea7f772792bffc06fde71a232660be7", "sha256": "3da1a4a8fafe7e1687be7ddea20b802551edf90fa405d4e5590e3c4e93188212" }, "downloads": -1, "filename": "python-kadmin-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6ea7f772792bffc06fde71a232660be7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56043, "upload_time": "2015-04-28T22:27:41", "url": "https://files.pythonhosted.org/packages/d0/64/65447d02c5242ccde0d97a711ccd6eea6c487df577ccd758fdb1a6c77b44/python-kadmin-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "93b04e87574b857845b0fa1c94931051", "sha256": "eefed8b41c555176356e32a9dec31c65b4bcd05567784a511e5451223fb56c44" }, "downloads": -1, "filename": "python-kadmin-0.1.2.tar.gz", "has_sig": false, "md5_digest": "93b04e87574b857845b0fa1c94931051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56195, "upload_time": "2015-12-01T20:50:58", "url": "https://files.pythonhosted.org/packages/8e/80/db00a44f980036388e62d70fe290c44dfa102687a5b16ed8a96e2124cf41/python-kadmin-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93b04e87574b857845b0fa1c94931051", "sha256": "eefed8b41c555176356e32a9dec31c65b4bcd05567784a511e5451223fb56c44" }, "downloads": -1, "filename": "python-kadmin-0.1.2.tar.gz", "has_sig": false, "md5_digest": "93b04e87574b857845b0fa1c94931051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56195, "upload_time": "2015-12-01T20:50:58", "url": "https://files.pythonhosted.org/packages/8e/80/db00a44f980036388e62d70fe290c44dfa102687a5b16ed8a96e2124cf41/python-kadmin-0.1.2.tar.gz" } ] }