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.dev4.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.dev4.tar.gz.

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev4.tar.gz
Algorithm Hash digest
SHA256 56b80fec4b062bd5d3452263ec44c12c40ecc99be094545e53eb6c22052b1ecd
MD5 6e7513aacba9c56e20e0487606a7c528
BLAKE2b-256 354d5f963dbec73e336f11c4c361d410819c84447d2c2680d39391026e7d1d06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe558ea9a723cd1cfdda1f43211c613f74bdad30d118a9cb59525c5602dc35c3
MD5 ee549763e676da713c3d610009d64cf5
BLAKE2b-256 5e0ade90f90fc3fcf0066cc6ef489c22342962099817c3bec91d2d92dca54334

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