Skip to main content

Feature-routing certificate service for Swarmauri

Project description

Swamauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_certs_composite


Swarmauri Certs Composite

Routing certificate service delegating to child providers based on requested features.

Installation

pip install swarmauri_certs_composite

Usage

The composite accepts a sequence of certificate service implementations and routes each call to the first provider that advertises a matching capability. Below is a minimal example using two toy providers:

from swarmauri_certs_composite import CompositeCertService
from swarmauri_base.certs.CertServiceBase import CertServiceBase


class SelfSignedOnly(CertServiceBase):

    def supports(self):
        return {"features": ("self_signed",)}

    async def create_self_signed(self, key, subject, **kw):
        return b"self-signed-cert"


class CsrOnly(CertServiceBase):

    def supports(self):
        return {"features": ("csr",)}

    async def create_csr(self, key, subject, **kw):
        return b"csr-data"


svc = CompositeCertService([SelfSignedOnly(), CsrOnly()])

# create a self-signed certificate - routed to SelfSignedOnly
cert = await svc.create_self_signed("key", {"CN": "example"})

# create a CSR and explicitly route to the second provider by class name
csr = await svc.create_csr("key", {"CN": "example"}, opts={"backend": "CsrOnly"})

supports() aggregates the advertised features of all child providers, allowing callers to inspect available capabilities before invoking them.

Entry point

The provider is registered under the swarmauri.certs entry-point as CompositeCertService.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_certs_composite-0.3.0.dev5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_certs_composite-0.3.0.dev5.tar.gz.

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev5.tar.gz
Algorithm Hash digest
SHA256 20f03f82dec45da3cc91d5cc08134473bd959240eab1e4af8138187a6b71d386
MD5 91b900c5e7fe26d657ba124253b2384a
BLAKE2b-256 6a764e4fedba9fdfd5841fbdb8a9c0b2d4e42f1276f22ec44ea9a2d223d96a0c

See more details on using hashes here.

File details

Details for the file swarmauri_certs_composite-0.3.0.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 66e9df81b5b3d68ccc8b35368e4a91804cc392089e0bbf08bfda6a82639fdb98
MD5 1ee0fc85a1511e2ebfd8b796a40f5ccc
BLAKE2b-256 80d45460f75bbc67c144b1026e06295efa74dfb1fe534aeee571be68c3536931

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page