This release is a pre-release and may not be stable for production use.
Swarmauri Certs Composite
CompositeCertService is a lightweight router that coordinates multiple
certificate providers behind a single facade. Configure it with the services
you already have (self-signed, ACME, Vault, PKCS#11, etc.) and the composite
chooses the right backend based on the feature you request.
Highlights
- Compose any
ICertServiceimplementations into one entry point. - Route automatically by declared capability or override explicitly per call.
- Inspect supported features at runtime to drive UI/UX decisions.
- Ship as the default
swarmauri.certsplugin namedCompositeCertService.
Installation
Choose the tool that matches your workflow:
# pip
pip install swarmauri_certs_composite
# Poetry
poetry add swarmauri_certs_composite
# uv
uv add swarmauri_certs_composite
Quickstart
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 self-contained example that you can run with python quickstart.py.
import asyncio
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 PrimaryCSR(CertServiceBase):
def supports(self):
return {"features": ("csr",)}
async def create_csr(self, key, subject, **kw):
return b"primary-csr"
class SecondaryCSR(CertServiceBase):
def supports(self):
return {"features": ("csr",)}
async def create_csr(self, key, subject, **kw):
return b"secondary-csr"
async def main():
svc = CompositeCertService([SelfSignedOnly(), PrimaryCSR(), SecondaryCSR()])
features = svc.supports()["features"]
print("Advertised features:", sorted(features))
cert = await svc.create_self_signed("key", {"CN": "example"})
print("Self-signed cert:", cert)
csr = await svc.create_csr("key", {"CN": "example"})
print("CSR from primary provider:", csr)
csr_override = await svc.create_csr(
"key", {"CN": "example"}, opts={"backend": "SecondaryCSR"}
)
print("CSR via explicit backend override:", csr_override)
if __name__ == "__main__":
asyncio.run(main())
supports() aggregates the advertised features of all child providers so callers
can inspect available capabilities before invoking them. Passing
opts={"backend": "ProviderType"} overrides the automatic routing when you
need to target a specific provider.
For Contributors
If you want to contribute to swarmauri_certs_composite, please read our
guidelines for contributing
and
style guide
to get started.
License
swarmauri_certs_composite is licensed under the Apache License 2.0. See the
LICENSE file
for details.
Entry point
The provider is registered under the swarmauri.certs entry-point as CompositeCertService.
Metadata
Release files for swarmauri_certs_composite 0.11.0.dev2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_certs_composite-0.11.0.dev2.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_certs_composite-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / swarmauri_certs_composite-0.11.0.dev2.tar.gz
| Download URL | swarmauri_certs_composite-0.11.0.dev2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7ef8fdaab0fe4582ce05553e2d8f9a4260a1168884d14b6ba2431630d93f274
|
|
BLAKE2b-256 checksum How to use checksums |
a7517fc7019533d7b83bd5777b1c400861b169ac84eb877aea1d0d048b0fc803
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_certs_composite-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_certs_composite-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06bafb94a2ed5f2fd8e60c928f32f047b9328a5617bb76164cccb06324837e53
|
|
BLAKE2b-256 checksum How to use checksums |
25d1326dbc17690375d304b7a50b62e50f7bf57c238accce0e66ad8e1e8de0e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|