gufo-acme


Namegufo-acme JSON
Version 0.4.0 PyPI version JSON
download
home_page
Summary
upload_time2023-11-23 13:45:18
maintainer
docs_urlNone
authorGufo Labs
requires_python>=3.8
licenseBSD 3-Clause License
keywords acme automatic certificate management environment rfc8555
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Gufo ACME

*Gufo ACME is a Python asyncio client for the ACME protocol.*

[![PyPi version](https://img.shields.io/pypi/v/gufo_acme.svg)](https://pypi.python.org/pypi/gufo_acme/)
![Python Versions](https://img.shields.io/pypi/pyversions/gufo_acme)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
![Build](https://img.shields.io/github/actions/workflow/status/gufolabs/gufo_acme/py-tests.yml?branch=master)
![Sponsors](https://img.shields.io/github/sponsors/gufolabs)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)
---

**Documentation**: [https://docs.gufolabs.com/gufo_acme/](https://docs.gufolabs.com/gufo_acme/)

**Source Code**: [https://github.com/gufolabs/gufo_acme/](https://github.com/gufolabs/gufo_acme/)

---

The Automatic Certificate Management Environment (ACME) protocol defines a method
for automated certificate signing, now widely used by services
such as Let's Encrypt. Gufo ACME is a Python asyncio ACME client library that
simplifies the protocol complexity with a straightforward and robust API.

Gufo ACME contains various clients which can be applied to your tasks:

* AcmeClient - base client to implement any fulfillment functionality
    by creating subclasses.
* DavAcmeClient - http-01 fulfillment using WebDAV methods.
* PowerDnsAcmeClient - dns-01 PowerDNS fulfillment.
* WebAcmeClient - http-01 static file fulfillment.

## Supported Certificate Authorities

* [Letsencrypt](https://letsencrypt.org/)
* [ZeroSSL](https://zerossl.com/)
* Google Public CA
* Any [RFC-8555](https://tools.ietf.org/html/rfc8555) compatible CA.

## Examples

### Account Creation

Create an account and store state to the file.
``` python
client_key = AcmeClient.get_key()
async with AcmeClient(DIRECTORY, key=client_key) as client:
    await client.new_account(email)
    state = client.get_state()
with open(client_state_path, "wb") as fp:
    fp.write(state)
```

### Private Key Generation

To generate a private key in PEM format.
``` python
private_key = AcmeClient.get_domain_private_key()
```

### Generate CSR

To generate a certificate signing request.
``` python
csr = AcmeClient.get_domain_csr(domain, private_key)
```

### Sign Certificate

Sign the certificate using `http-01` challenge:

``` python
CHALLENGE_DIR = "/www/acme/"


class SignAcmeClient(AcmeClient):
    async def fulfill_http_01(
        self, domain: str, challenge: AcmeChallenge
    ) -> bool:
        v = self.get_key_authorization(challenge)
        with open(os.path.join(CHALLENGE_DIR, challenge.token), "wb") as fp:
            fp.write(v)
        return True

    async def clear_http_01(
        self: AcmeClient, domain: str, challenge: AcmeChallenge
    ) -> None:
        os.unlink(os.path.join(CHALLENGE_DIR, challenge.token))

    ...
async with SignAcmeClient.from_state(state) as client:
    cert = await client.sign(domain, csr)
```

## Virtues

* Pure-Python implementation.
* Asynchronous.
* Fully typed.
* Clean API.
* Robust well-tested code.
* Batteries included.
* 99%+ test coverage.

## On Gufo Stack

This product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort 
led by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible 
set of tools to create network management software and automate 
routine administration tasks.

To do this, we extract the key technologies that have proven themselves 
in the [NOC][NOC] and bring them as separate packages. Then we work on API,
performance tuning, documentation, and testing. The [NOC][NOC] uses the final result
as the external dependencies.

[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products
can benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make 
the other network management products better.

[Gufo Labs]: https://gufolabs.com/
[Gufo Stack]: https://gufolabs.com/products/gufo-stack/
[NOC]: https://getnoc.com/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gufo-acme",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "ACME,Automatic Certificate Management Environment,RFC8555",
    "author": "Gufo Labs",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/f8/eb/c6b0fe850e31a86a09888557e06115028bcc69a92ef63f50fdd65cb32e57/gufo_acme-0.4.0.tar.gz",
    "platform": null,
    "description": "# Gufo ACME\n\n*Gufo ACME is a Python asyncio client for the ACME protocol.*\n\n[![PyPi version](https://img.shields.io/pypi/v/gufo_acme.svg)](https://pypi.python.org/pypi/gufo_acme/)\n![Python Versions](https://img.shields.io/pypi/pyversions/gufo_acme)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n![Build](https://img.shields.io/github/actions/workflow/status/gufolabs/gufo_acme/py-tests.yml?branch=master)\n![Sponsors](https://img.shields.io/github/sponsors/gufolabs)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)\n---\n\n**Documentation**: [https://docs.gufolabs.com/gufo_acme/](https://docs.gufolabs.com/gufo_acme/)\n\n**Source Code**: [https://github.com/gufolabs/gufo_acme/](https://github.com/gufolabs/gufo_acme/)\n\n---\n\nThe Automatic Certificate Management Environment (ACME) protocol defines a method\nfor automated certificate signing, now widely used by services\nsuch as Let's Encrypt. Gufo ACME is a Python asyncio ACME client library that\nsimplifies the protocol complexity with a straightforward and robust API.\n\nGufo ACME contains various clients which can be applied to your tasks:\n\n* AcmeClient - base client to implement any fulfillment functionality\n    by creating subclasses.\n* DavAcmeClient - http-01 fulfillment using WebDAV methods.\n* PowerDnsAcmeClient - dns-01 PowerDNS fulfillment.\n* WebAcmeClient - http-01 static file fulfillment.\n\n## Supported Certificate Authorities\n\n* [Letsencrypt](https://letsencrypt.org/)\n* [ZeroSSL](https://zerossl.com/)\n* Google Public CA\n* Any [RFC-8555](https://tools.ietf.org/html/rfc8555) compatible CA.\n\n## Examples\n\n### Account Creation\n\nCreate an account and store state to the file.\n``` python\nclient_key = AcmeClient.get_key()\nasync with AcmeClient(DIRECTORY, key=client_key) as client:\n    await client.new_account(email)\n    state = client.get_state()\nwith open(client_state_path, \"wb\") as fp:\n    fp.write(state)\n```\n\n### Private Key Generation\n\nTo generate a private key in PEM format.\n``` python\nprivate_key = AcmeClient.get_domain_private_key()\n```\n\n### Generate CSR\n\nTo generate a certificate signing request.\n``` python\ncsr = AcmeClient.get_domain_csr(domain, private_key)\n```\n\n### Sign Certificate\n\nSign the certificate using `http-01` challenge:\n\n``` python\nCHALLENGE_DIR = \"/www/acme/\"\n\n\nclass SignAcmeClient(AcmeClient):\n    async def fulfill_http_01(\n        self, domain: str, challenge: AcmeChallenge\n    ) -> bool:\n        v = self.get_key_authorization(challenge)\n        with open(os.path.join(CHALLENGE_DIR, challenge.token), \"wb\") as fp:\n            fp.write(v)\n        return True\n\n    async def clear_http_01(\n        self: AcmeClient, domain: str, challenge: AcmeChallenge\n    ) -> None:\n        os.unlink(os.path.join(CHALLENGE_DIR, challenge.token))\n\n    ...\nasync with SignAcmeClient.from_state(state) as client:\n    cert = await client.sign(domain, csr)\n```\n\n## Virtues\n\n* Pure-Python implementation.\n* Asynchronous.\n* Fully typed.\n* Clean API.\n* Robust well-tested code.\n* Batteries included.\n* 99%+ test coverage.\n\n## On Gufo Stack\n\nThis product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort \nled by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible \nset of tools to create network management software and automate \nroutine administration tasks.\n\nTo do this, we extract the key technologies that have proven themselves \nin the [NOC][NOC] and bring them as separate packages. Then we work on API,\nperformance tuning, documentation, and testing. The [NOC][NOC] uses the final result\nas the external dependencies.\n\n[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products\ncan benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make \nthe other network management products better.\n\n[Gufo Labs]: https://gufolabs.com/\n[Gufo Stack]: https://gufolabs.com/products/gufo-stack/\n[NOC]: https://getnoc.com/\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "",
    "version": "0.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/gufolabs/gufo_acme/issues",
        "Changelog": "https://github.com/gufolabs/gufo_acme/blob/master/CHANGELOG.md",
        "Documentation": "https://docs.gufolabs.com/gufp_acme/",
        "Homepage": "https://github.com/gufolabs/gufo_acme/",
        "Source Code": "https://github.com/gufolabs/gufo_acme/"
    },
    "split_keywords": [
        "acme",
        "automatic certificate management environment",
        "rfc8555"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5eddd57a95ea6324493525993b9d10e3370cbfb136b881100ee4e8df31cea1e",
                "md5": "715d1d504d8904b5f24cc5e559750520",
                "sha256": "028d32922b9fbb467677bb24b3de3369de96e72edfdcd076fa12aebf846f97d3"
            },
            "downloads": -1,
            "filename": "gufo_acme-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "715d1d504d8904b5f24cc5e559750520",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19978,
            "upload_time": "2023-11-23T13:45:08",
            "upload_time_iso_8601": "2023-11-23T13:45:08.255041Z",
            "url": "https://files.pythonhosted.org/packages/d5/ed/dd57a95ea6324493525993b9d10e3370cbfb136b881100ee4e8df31cea1e/gufo_acme-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8ebc6b0fe850e31a86a09888557e06115028bcc69a92ef63f50fdd65cb32e57",
                "md5": "22508a68e6312ad3545fe41c05d11413",
                "sha256": "f96969f58f9a3cb0c7ac101bc3d8ded547c44bd73c512e9bad0ba7089b6b4bc9"
            },
            "downloads": -1,
            "filename": "gufo_acme-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "22508a68e6312ad3545fe41c05d11413",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 21851,
            "upload_time": "2023-11-23T13:45:18",
            "upload_time_iso_8601": "2023-11-23T13:45:18.357682Z",
            "url": "https://files.pythonhosted.org/packages/f8/eb/c6b0fe850e31a86a09888557e06115028bcc69a92ef63f50fdd65cb32e57/gufo_acme-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-23 13:45:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gufolabs",
    "github_project": "gufo_acme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gufo-acme"
}
        
Elapsed time: 0.17759s