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

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev2.tar.gz
Algorithm Hash digest
SHA256 96792bafdd4e1f17b04b268d94937c7fc89844f7b6ec8f159bf15f54cfe025da
MD5 737cb4dd9bfa10d5341201e1394423b1
BLAKE2b-256 439786f229f792d0c28035ecc19c29a69cb3c99632e4e6cceb509de10f2b94a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e79e3c4664361a4d2422b61173fdfc7de1c9d25b189e1c373cd6a0b2a3146e8
MD5 d4378532e79ab6b424070fe355e67919
BLAKE2b-256 9087166adc3452f04f505c41fec3b703c793037db85696a34d729c4a649dd364

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