Expand description
alkhttp: HTTP interface for the alk stack — serves HTTP/1.1 + HTTP/2 on standard ALPNs (with WebSocket upgrade carrying the channels protocol) and hosts the HTTP-backed call-protocol adapters.
§Feature sides
The crate serves two independent use cases, selectable via features:
server— the producer side: the axumRouterhost (server), the gateway routes (gateway), the WebSocket upgrade path (websocket),to_openapi, andto_mcp(withmcp).client— the consumer side: the shared outbound client host (client) and the import adapters (from_jsonschema,from_openapi,from_mcpwithmcp).
Both default on; lean builds take default-features = false with
the side they need. The shared OpenAPI document model rides behind
openapi (implied by both sides); openapi_spec and to_openapi
compile with it alone.
§Documentation gate (HY-02)
Public-API items must be documented: this crate is pre-crates.io and docs.rs renders straight from the rustdoc. The deny below keeps the gate from regressing.
Re-exports§
pub use server::decoy_fallback;pub use server::decoy_method_not_allowed;pub use server::healthz;pub use server::healthz;pub use server::DecoyConfig;
Modules§
- adapters
- The HTTP-backed call-protocol adapters:
from_openapi/from_jsonschema/from_mcp(credential-injecting consumers) andto_openapi/to_mcp(gateway projections of local operations). HTTP-backed call-protocol adapters:from_openapi/from_jsonschema(import external HTTP APIs as operations),to_openapi/to_mcp(project local operations onto HTTP surfaces),from_mcp, andfrom_wss(featurewss). - client
- The shared outbound client host: hot-reloadable reqwest stack with
same-host-only redirects, idempotent-only retries, and TLS config.
Shared HTTP client (
ClientWithMiddleware): reqwest + retry middleware stack, used byfrom_openapi/from_mcpforwarding handlers. - gateway
- The 6 fixed gateway endpoints and their shared dispatch spine — the sole HTTP invoke path.
- server
- The HTTP server host: the
HttpAdapterrouter, auth, stealth decoy,/healthz,/openapi.json. - websocket
- The WebSocket upgrade path carrying the native call-protocol
session (browsers; ADR-044, ADR-048). The
upgradesubmodule compiles underserver; the shared byte-stream adapter also underwss(thefrom_wssconsumer seam). WebSocket subsystem: the browser bidirectional path (ADR-067,docs/architecture/decisions).