5 releases
| 0.1.8 | Jul 5, 2026 |
|---|---|
| 0.1.7 | Jul 4, 2026 |
| 0.1.6 | Jul 4, 2026 |
| 0.1.5 | Jul 4, 2026 |
| 0.1.3 | Jul 4, 2026 |
#2053 in HTTP server
53KB
619 lines
tf-axum
TrustForge middleware for Axum. Provides drop-in zero-trust request verification, capability delegation, and policy enforcement for Axum servers.
Part of TrustForge — the open-source trust fabric for
AI-native software, devices, and verifiable action. The Rust crates and
the TypeScript packages (@trustforge-protocol/*) are mirrored
reference implementations kept in lockstep by a cross-language
conformance suite.
Install
cargo add tf-axum
Overview
tf-axum — axum/tower middleware that calls tf-daemon's /v1/decide.
Drop TrustForgeLayer into any axum Router (or any tower stack) and
every inbound request will:
- extract a host token (default:
Authorization: Bearer …), - POST to
tf-daemon's/v1/decide, - on
allow: attachExtension<TfDecision>and forward, - on
deny: short-circuit with403 Forbiddenand a JSON body, - on
approval(orapproval_required): short-circuit with202 Accepted.
The middleware is profile-agnostic and intentionally small: it only enforces the live-mode authority gate; replay packets and per-route capability mapping are handled by higher-level helpers.
Links
- API docs: docs.rs/tf-axum
- Source: crates/adapters/axum
- Specs & conformance vectors: KodyDennon/TrustForge
- Issues: KodyDennon/TrustForge/issues
Status
Draft — experimental. Apache-2.0.
Dependencies
~18–26MB
~389K SLoC