hegemony-secret-sdk
Public, dependency-light SDK for building Hegemony secret backend plugins — out-of-tree wheels that add secret storage backends to the core platform at runtime.
A plugin depends only on this package (which depends only on pydantic) and
exposes a register(registry) callable under the
hegemony.secret_backends entry-point group:
# In your plugin's pyproject.toml. The SDK is 0.x, where a breaking change
# releases a new minor version, so depend on one minor at a time.
[project]
dependencies = ["hegemony-secret-sdk>=0.3,<0.4"]
[project.entry-points."hegemony.secret_backends"]
my_plugin = "my_plugin:register"
Backends are leaf components
Unlike notification transports, secret backends receive no injected services or
context from the host. A registered factory builds a concrete backend
instance directly from an already-resolved configuration dict:
# my_plugin/__init__.py
from collections.abc import Mapping
from typing import Any
from hegemony_secret_sdk import SecretBackend, SecretBackendRegistry
class MyBackend:
def __init__(self, config: dict) -> None:
self._config = config
def read(self, path: str) -> dict[str, str] | None: ...
def write(self, path: str, data: Mapping[str, Any]) -> None: ...
def delete(self, path: str) -> None: ...
def test(self) -> None: ...
def build_my_backend(config: dict) -> MyBackend:
return MyBackend(config)
def register(registry: SecretBackendRegistry) -> None:
registry.register_backend_type(
backend_type="my_backend",
display_name="My Backend",
description="Stores secrets in My Backend.",
factory=build_my_backend,
config_schema={
"type": "object",
"required": ["address"],
"properties": {
"address": {"type": "string", "title": "Server address"},
"token": {"type": "string", "title": "Auth token", "x_secret_ref": True},
},
},
)
A backend implements read, write, delete, and test (a lightweight connectivity/auth
check that raises on failure). See SecretBackend.
Config-schema extension keys
The host understands a few x_-prefixed property keys in config_schema:
x_secret_ref: true— the field holds raw auth material; the host UI renders it with the secret/variable picker instead of a plain text input.x_fallback_of: "<base field>"— the field overrides<base field>when set; the host UI shows the inheritance relationship on the form.x_component: "api" | "worker"— combined withx_fallback_of, restricts the override to one host process: before calling the factory, the named process copies the field's value onto its base field and strips everyx_component-marked field. Factories therefore only ever see base fields (see the vault plugin'sapi_role_id/worker_role_id, which let the API and worker authenticate with different AppRoles).
ABI
SDK_ABI_VERSION is bumped only on incompatible changes to the registration
contract. The platform exposes its value as registry.api_version so a plugin
can self-gate if needed.
API reference
Import public contracts from hegemony_secret_sdk. These are synchronous
Python interfaces, not HTTP endpoints or coroutines. The host resolves
configuration before calling the registered BackendFactory(config), which
returns a SecretBackend.
register_backend_type(...) accepts keyword-only backend identity, display
name, description and factory, plus optional configuration model, schema,
defaults and hidden flag; it returns None. The model and schema are
independent: the host may use the model for validation and the schema for UI
rendering. The hidden flag requires host support.
| Backend method | Inputs | Result |
|---|---|---|
read |
Secret path string | Mapping of secret fields, or None if absent |
write |
Path and mapping of fields | None |
delete |
Path | None; deleting an absent secret is not an error |
test |
No arguments | None; raises on connectivity/authentication failure |
list (optional ListableSecretBackend) |
Path, defaulting to the empty string | Immediate child names; containers end in /; unknown/empty locations return an empty list |
wrap_data_key (optional DataKeyWrappingSecretBackend) |
Wrapping-key name | Tuple of fresh 256-bit plaintext key bytes and wrapped-key string; creates a missing wrapping key |
unwrap_data_key (optional DataKeyWrappingSecretBackend) |
Wrapping-key name and wrapped-key string | Plaintext key bytes |
The host feature-detects the optional protocols. Data-key wrapping keeps the wrapping key inside the store; the host stores the wrapped key alongside encrypted data. Do not include plaintext secrets or data keys in logs or errors. Backend failures raise exceptions; the SDK does not define a shared error envelope. The Vault/OpenBao and 1Password references describe backend configuration, path mapping and limitations.
From the repository root, render complete signatures and docstrings with:
uv sync --frozen --all-packages
uv run python -m pydoc hegemony_secret_sdk
uv run python -m pydoc hegemony_secret_sdk.backend
uv run python -m pydoc hegemony_secret_sdk.registry
For local HTML browsing, run uv run python -m pydoc -b, open the SDK module,
and follow its class/module links; stop the server when finished. With an
installed SDK, omit uv run.
Metadata
Release files for hegemony-secret-sdk 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hegemony_secret_sdk-0.3.6-py3-none-any.whl | Python 3 | none | any | Details for hegemony_secret_sdk-0.3.6-py3-none-any.whl |
Release files / hegemony_secret_sdk-0.3.6-py3-none-any.whl
| Download URL | hegemony_secret_sdk-0.3.6-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdbda4b3029d81d486f0d89f046e08570e3f4b5a56eec8431f29e140d7168105
|
|
BLAKE2b-256 checksum How to use checksums |
656f26728e91b5e92ff1e23edd2fdf23b25638cfdb821c74b02e06372a1a3120
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for hegemony-secret-sdk 0.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.