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

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev3.tar.gz
Algorithm Hash digest
SHA256 5683679303f206f1f8dcef98083642b94645f12e18b4a595c0b0946203bea883
MD5 0375b6f5a5942feace1f89e31185c865
BLAKE2b-256 3ede7db387e32b7bd76fcf561099ce99dd5e09f0ac928b2e38b0a72967ba2917

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for swarmauri_certs_composite-0.3.0.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 8ccf60bb576873e082d37bb34b5b4bf34af9d58074c60929c79d5c2822e73bdd
MD5 5174be9f47a3307704d4a535fa790497
BLAKE2b-256 e10958b1438d725d693c77fbc64e84b5ca8705ed794dfd75ee2547f8bf1bce95

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