Repository navigation
Home
Shared mechanism for metalayerlab interceptors — a policy-configurable async middleware pipeline, the layered settings loader, Secret values, and Prometheus text exposition.
interpose is a small Python library for metalayerlab's interceptors (mitm-proxy, sluice), which depend on a GitHub release tag. It has three components: the pipeline, settings (with secrets) and metrics.
One middleware loop, interpose.pipeline: the project keeps its own hooks and unit of work, and fail open or closed is policy, per project and per middleware.
- API:
interpose.pipeline - How the guard works
- Performance
- A hook "timed out" although it returned a result
interpose.settings and interpose.secret. Each setting is declared once and read from a _FILE variable, the environment, a YAML file or its default, with strict types and a record of where each value came from:
from pathlib import Path
from interpose.settings import Setting, Settings, port
SETTINGS = Settings(
"MYAPP_",
(Setting("listen.port", 8080, "Port.", check=port),),
default_path=Path("/etc/myapp/config.yaml"),
)
r = SETTINGS.resolve(environ={"MYAPP_LISTEN_PORT": "9090"})
assert (r.values["listen.port"], r.sources["listen.port"]) == (9090, "MYAPP_LISTEN_PORT")- First run
-
API:
interpose.settings·interpose.secret - How a value is resolved
- Secrets
- Common problems
Prometheus text exposition, interpose.metrics, with every label's values declared up front. The project serves the text.
Getting started: Introduction · Quick Start
Using it: API Reference Help: Troubleshooting · FAQ · Security
Developers: Contributing · Architecture Internals · Testing Guide · Release Process
interpose | Shared mechanism for metalayerlab interceptors — a policy-configurable async middleware pipeline, the layered settings loader, Secret values, and Prometheus text exposition.
GitHub • Releases • Issues • Changelog • Contributing
This wiki is generated from docs/wiki/ on every push to main: edits made here are overwritten. Change it with a pull request.
- 🧅 One middleware loop; fail open or closed is policy, per project and per middleware
- 🥞 One lookup order:
_FILE> environment > YAML > default - 🧱 Strict types: no silent
0for a YAML0.5 - 🧭 Where each value came from, for every setting
- 🔒
Secret: masked in logs, reprs and errors - 📈 Prometheus text with labels from declared value sets