{ "info": { "author": "Andrew Teixeira", "author_email": "teixeira@broadinstitute.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# python-cert_manager\n\nThis library provides a [Python][1] interface to the [Sectigo][2] Certificate Manager REST API. python-cert_manager is open sourced under the [BSD 3-Clause license](LICENSE.txt).\n\n[![CircleCI](https://circleci.com/gh/broadinstitute/python-cert_manager/tree/master.svg?style=svg)](https://circleci.com/gh/broadinstitute/python-cert_manager/tree/master)\n[![codecov](https://codecov.io/gh/broadinstitute/python-cert_manager/branch/master/graph/badge.svg)](https://codecov.io/gh/broadinstitute/python-cert_manager)\n\n## Basics\n\ncert_manager still runs on Python 2.7, and Python >= 3.4\n\n## Features\n\nThere are many API endpoints under Certificate Manager, and this library currently supports a subset of those endpoints. The current list of written and tested endpoint classes includes:\n\n* Organization (/organization)\n* Person (/person)\n* SSL (/ssl)\n\nOther endpoints we hope to add in the near future:\n\n* Client Administrator (/admin)\n* Code Signing Certificates (/csod)\n* Custom Fields (/customField)\n* Domain Control Validation (/dcv)\n* Device Certificates (/device)\n* Discovery (/discovery)\n* Domain (/domain)\n* SMIME (/smime)\n\n## Installing\n\nYou can use pip to install cert_manager:\n\n```sh\npipenv install cert_manager\n```\n\n## Examples\n\nThis is a simple example that just shows initializing the `Client` object and using it to query the `Organization` and `SSL` endpoints:\n\n```python\nfrom cert_manager import Organization\nfrom cert_manager import Client\nfrom cert_manager import SSL\n\nclient = Client(\n base_url=\"https://cert-manager.com/api\",\n login_uri=\"SomeOrg\",\n username=\"your_username\",\n password=\"your_password\",\n)\n\norg = Organization(client=client)\nssl = SSL(client=client)\n\nprint(ssl.types)\nprint(org.all())\n```\n\nThe most common process you would do, however, is enroll and then collect a certificate you want to order from the Certificate Manager:\n\n```python\nfrom time import sleep\n\nfrom cert_manager import Organization\nfrom cert_manager import Client\nfrom cert_manager import SSL\n\nclient = Client(\n base_url=\"https://cert-manager.com/api\",\n login_uri=\"SomeOrg\",\n username=\"your_username\",\n password=\"your_password\",\n)\n\n# We need to enroll the certificate under an organization, so we will need to query the API for that\norg = Organization(client=client)\n# We need the SSL module to enroll the certificate\nssl = SSL(client=client)\n\ncert_org = org.find(dept_name=\"MyDept\")\n\nresult = ssl.enroll(cert_type_name=\"InCommon SSL (SHA-2)\", csr=\"host.csr\", term=365, org_id=cert_org[0][\"id\"])\n\n# This is just for demonstration purposes.\n# Doing a wait loop like this to poll for the certificate is not the best way to go about this.\nwhile(True):\n # Collect the certificate from Sectigo\n try:\n cert_pem = ssl.collect(cert_id=result[\"sslId\"], cert_format=\"x509CO\")\n print(cert_pem)\n break\n except Pending:\n print(\"Certificate is still pending...sleeping for 60s\")\n sleep(60)\n continue\n except Exception:\n # For some unexpected exception, exit\n break\n```\n\n## Contributing\n\nPull requests to add functionality and fix bugs are always welcome. Please check the CONTRIBUTING.md for specifics on contributions.\n\n### Testing\n\nWe try to have a high level of test coverage on the code. Therefore, when adding anything to the repo, tests should be written to test a new feature or to test a bug fix so that there won't be a regression. This library is setup to be pretty simple to build a working development environment using [Docker][4]. Therefore, it is suggested that you have [Docker][4] installed where you clone this repository to make development easier.\n\nTo start a development environment, you should be able to just run the `dev.sh` script. This script will use the `Dockerfile` in this repository to build a [Docker][4] container with all the dependencies for development installed using [Pipenv][3].\n\n```sh\n./dev.sh\n```\n\nThe first time you run the script, it should build the [Docker][4] image and then drop you into the container's shell. The directory where you cloned this repository should be volume mounted in to `/usr/src`, which should also be the current working directory. From there, you can make changes as you see fit. Tests can be run from the `/usr/src` directory by simply typing `green` as [green][5] has been setup to with the correct parameters.\n\n## Releases\n\nReleases to the codebase are typically done using the [bump2version][6] tool. This tool takes care of updating the version in all necessary files, updating its own configuration, and making a GitHub commit and tag. We typically do version bumps as part of a PR, so you don't want to have [bump2version][6] tag the version at the same time it does the commit as commit hashes may change. Therefore, to bump the version a patch level, one would run the command:\n\n```sh\nbump2version --verbose --no-tag patch\n```\n\nOnce the PR is merged, you can then checkout the new master branch and tag it using the new version number that is now in `.bumpversion.cfg`:\n\n```sh\ngit checkout master\ngit pull --rebase\ngit tag 1.0.0 -m 'Bump version: 0.1.0 \u2192 1.0.0'\ngit push --tags\n```\n\n[1]: https://www.python.org/ \"Python\"\n[2]: https://sectigo.com/ \"Sectigo\"\n[3]: https://pipenv.readthedocs.io/en/latest/ \"Pipenv\"\n[4]: https://www.docker.com/ \"Docker\"\n[5]: https://github.com/CleanCut/green \"green\"\n[6]: https://pypi.org/project/bump2version/ \"bump2version\"\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/broadinstitute/python-cert_manager", "keywords": "sectigo,comodo,certificate", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "cert-manager", "package_url": "https://pypi.org/project/cert-manager/", "platform": "", "project_url": "https://pypi.org/project/cert-manager/", "project_urls": { "Homepage": "https://github.com/broadinstitute/python-cert_manager" }, "release_url": "https://pypi.org/project/cert-manager/1.0.0/", "requires_dist": [ "requests (<3)" ], "requires_python": ">=2.7, <4", "summary": "Python interface to the Sectigo Certificate Manager REST API", "version": "1.0.0" }, "last_serial": 5099877, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b3d24d303f5d23fb039d4d9431276aaf", "sha256": "b1d368018ce9369d17dba0677b5d46afb6429140008b0409efffbb15a2bf47d4" }, "downloads": -1, "filename": "cert_manager-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b3d24d303f5d23fb039d4d9431276aaf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, <4", "size": 31079, "upload_time": "2019-04-04T16:34:50", "url": "https://files.pythonhosted.org/packages/57/dd/3063c41c9af12c80c627238dabbdd4d9945211ccfc8a7714b5a6511763f8/cert_manager-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "795d006b69ec7c8eb6db4d9065466990", "sha256": "af5670487d470e737d5ea8a5417260f59fd0a94784d6c3b4fe71fc8977a07fc3" }, "downloads": -1, "filename": "cert_manager-1.0.0.tar.gz", "has_sig": false, "md5_digest": "795d006b69ec7c8eb6db4d9065466990", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 43996, "upload_time": "2019-04-04T16:34:52", "url": "https://files.pythonhosted.org/packages/a5/19/00f130377ff5c3e5f9c74db0963db07834e7ec23b755d3edefa3d6df9915/cert_manager-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3d24d303f5d23fb039d4d9431276aaf", "sha256": "b1d368018ce9369d17dba0677b5d46afb6429140008b0409efffbb15a2bf47d4" }, "downloads": -1, "filename": "cert_manager-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b3d24d303f5d23fb039d4d9431276aaf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, <4", "size": 31079, "upload_time": "2019-04-04T16:34:50", "url": "https://files.pythonhosted.org/packages/57/dd/3063c41c9af12c80c627238dabbdd4d9945211ccfc8a7714b5a6511763f8/cert_manager-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "795d006b69ec7c8eb6db4d9065466990", "sha256": "af5670487d470e737d5ea8a5417260f59fd0a94784d6c3b4fe71fc8977a07fc3" }, "downloads": -1, "filename": "cert_manager-1.0.0.tar.gz", "has_sig": false, "md5_digest": "795d006b69ec7c8eb6db4d9065466990", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 43996, "upload_time": "2019-04-04T16:34:52", "url": "https://files.pythonhosted.org/packages/a5/19/00f130377ff5c3e5f9c74db0963db07834e7ec23b755d3edefa3d6df9915/cert_manager-1.0.0.tar.gz" } ] }