asimov-http 25.9.0

HTTP message integrity and shared client proxy configuration
Documentation
# ASIMOV.rs: HTTP Support

[![License](https://img.shields.io/badge/license-Public%20Domain-blue.svg)](https://unlicense.org)
[![Compatibility](https://img.shields.io/badge/rust-1.97%2B-blue)](https://blog.rust-lang.org/2026/07/09/Rust-1.97.0/)
[![Package](https://img.shields.io/crates/v/asimov-http)](https://crates.io/crates/asimov-http)
[![Documentation](https://img.shields.io/docsrs/asimov-http?label=docs.rs)](https://docs.rs/asimov-http)

This package is part of [ASIMOV.rs], a polyglot development platform
for [trustworthy neurosymbolic machine intelligence].

<br/>

<sub>

[[Features](#-features)] |
[[Prerequisites](#%EF%B8%8F-prerequisites)] |
[[Installation](#%EF%B8%8F-installation)] |
[[Examples](#-examples)] |
[[Reference](#-reference)] |
[[Development](#%E2%80%8D-development)]

</sub>

## ✨ Features

- Computes and verifies RFC 9530 SHA-256 content digests.
- Signs and verifies RFC 9421 messages with protocol Ed25519 keys.
- Supports headers, trailers, HTTP/1.1, and HTTP/2.
- Streams response bodies with verification at EOF.
- Provides runtime-independent HTTP body adapters for Hyper and Axum.
- Supports `no_std` digest hashing and encoding.
- Provides opt-in native proxy discovery and reqwest/Hyper routing adapters.
- Cuts red tape: 100% free and unencumbered public domain software.

## 🛠️ Prerequisites

- [Rust]https://rust-lang.org 1.97+ (2024 edition)

## ⬇️ Installation

### Installation via Cargo

```bash
cargo add asimov-http
```

### Installation in `Cargo.toml`

```toml
[dependencies]
asimov-http = { version = "25" }
```

Alternatively, enable only specific features:

```toml
[dependencies]
asimov-http = { version = "25", default-features = false }
```

## 👉 Examples

```rust
use asimov_http::ContentDigest;

let digest = ContentDigest::new(b"abc");
assert_eq!(
    digest.to_field_value(),
    "sha-256=:ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=:",
);
```

The crate rustdoc contains buffered request-signing and streaming
response-signing examples. See [`DESIGN.md`](DESIGN.md) for verification,
HTTP/1.1–HTTP/2, trailer lifecycle, and origin-scoped proxy contracts.
Enable `proxy` for alloc-only configuration, `system-proxy` for discovery, or
`reqwest` for the client adapter; disable defaults for proxy-only dependencies.

### Runnable client and server

Run these commands from the workspace's `rust/` directory in two terminals.
Start the [server](examples/server.rs):

```sh
cargo run -p asimov-http --example server
```

Then run the [client](examples/client.rs):

```sh
cargo run -p asimov-http --example client
```

The client sends a signed JSON POST. The server verifies the request and emits
three JSONL records with a short delay between them, followed by `Content-Digest`
and `Signature` trailers. `Signature-Input` is sent in headers. The client prints
provisional bytes as they arrive and reports verified completion only at EOF.
Responses are bound to the originating request's signature.

The same server also provides buffered responses with all integrity fields in
headers. The client accepts either placement without changing its policy:

```sh
cargo run -p asimov-http --example client -- --headers
cargo run -p asimov-http --example client -- --http2
cargo run -p asimov-http --example client -- --http2 --headers
```

These examples use fixed demo Ed25519 keys, loopback HTTP, and an in-memory
nonce cache that resets when the server stops. HTTP/2 uses cleartext prior
knowledge. The default address is `127.0.0.1:3000`; set
`ASIMOV_HTTP_EXAMPLE_ADDR` in both terminals to use another address. Both examples
require the default-enabled `integrity` feature, which includes `std`.

## 📚 Reference

[docs.rs/asimov-http](https://docs.rs/asimov-http)

### Packages

| Package | Crate | Docs |
| :------ | :---- | :--- |
| [asimov-account]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-account | [![Package]https://img.shields.io/crates/v/asimov-account]https://crates.io/crates/asimov-account | [![Documentation]https://img.shields.io/docsrs/asimov-account?label=docs.rs]https://docs.rs/asimov-account |
| [asimov-agent]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-agent | [![Package]https://img.shields.io/crates/v/asimov-agent]https://crates.io/crates/asimov-agent | [![Documentation]https://img.shields.io/docsrs/asimov-agent?label=docs.rs]https://docs.rs/asimov-agent |
| [asimov-cache]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-cache | [![Package]https://img.shields.io/crates/v/asimov-cache]https://crates.io/crates/asimov-cache | [![Documentation]https://img.shields.io/docsrs/asimov-cache?label=docs.rs]https://docs.rs/asimov-cache |
| [asimov-cloud]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-cloud | [![Package]https://img.shields.io/crates/v/asimov-cloud]https://crates.io/crates/asimov-cloud | [![Documentation]https://img.shields.io/docsrs/asimov-cloud?label=docs.rs]https://docs.rs/asimov-cloud |
| [asimov-config]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-config | [![Package]https://img.shields.io/crates/v/asimov-config]https://crates.io/crates/asimov-config | [![Documentation]https://img.shields.io/docsrs/asimov-config?label=docs.rs]https://docs.rs/asimov-config |
| [asimov-construct]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-construct | [![Package]https://img.shields.io/crates/v/asimov-construct]https://crates.io/crates/asimov-construct | [![Documentation]https://img.shields.io/docsrs/asimov-construct?label=docs.rs]https://docs.rs/asimov-construct |
| [asimov-core]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-core | [![Package]https://img.shields.io/crates/v/asimov-core]https://crates.io/crates/asimov-core | [![Documentation]https://img.shields.io/docsrs/asimov-core?label=docs.rs]https://docs.rs/asimov-core |
| [asimov-credit]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-credit | [![Package]https://img.shields.io/crates/v/asimov-credit]https://crates.io/crates/asimov-credit | [![Documentation]https://img.shields.io/docsrs/asimov-credit?label=docs.rs]https://docs.rs/asimov-credit |
| [asimov-dataset]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-dataset | [![Package]https://img.shields.io/crates/v/asimov-dataset]https://crates.io/crates/asimov-dataset | [![Documentation]https://img.shields.io/docsrs/asimov-dataset?label=docs.rs]https://docs.rs/asimov-dataset |
| [asimov-directory]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-directory | [![Package]https://img.shields.io/crates/v/asimov-directory]https://crates.io/crates/asimov-directory | [![Documentation]https://img.shields.io/docsrs/asimov-directory?label=docs.rs]https://docs.rs/asimov-directory |
| [asimov-env]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-env | [![Package]https://img.shields.io/crates/v/asimov-env]https://crates.io/crates/asimov-env | [![Documentation]https://img.shields.io/docsrs/asimov-env?label=docs.rs]https://docs.rs/asimov-env |
| [asimov-flow]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-flow | [![Package]https://img.shields.io/crates/v/asimov-flow]https://crates.io/crates/asimov-flow | [![Documentation]https://img.shields.io/docsrs/asimov-flow?label=docs.rs]https://docs.rs/asimov-flow |
| [asimov-graph]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-graph | [![Package]https://img.shields.io/crates/v/asimov-graph]https://crates.io/crates/asimov-graph | [![Documentation]https://img.shields.io/docsrs/asimov-graph?label=docs.rs]https://docs.rs/asimov-graph |
| [asimov-http]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-http | [![Package]https://img.shields.io/crates/v/asimov-http]https://crates.io/crates/asimov-http | [![Documentation]https://img.shields.io/docsrs/asimov-http?label=docs.rs]https://docs.rs/asimov-http |
| [asimov-huggingface]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-huggingface | [![Package]https://img.shields.io/crates/v/asimov-huggingface]https://crates.io/crates/asimov-huggingface | [![Documentation]https://img.shields.io/docsrs/asimov-huggingface?label=docs.rs]https://docs.rs/asimov-huggingface |
| [asimov-id]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-id | [![Package]https://img.shields.io/crates/v/asimov-id]https://crates.io/crates/asimov-id | [![Documentation]https://img.shields.io/docsrs/asimov-id?label=docs.rs]https://docs.rs/asimov-id |
| [asimov-installer]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-installer | [![Package]https://img.shields.io/crates/v/asimov-installer]https://crates.io/crates/asimov-installer | [![Documentation]https://img.shields.io/docsrs/asimov-installer?label=docs.rs]https://docs.rs/asimov-installer |
| [asimov-kb]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-kb | [![Package]https://img.shields.io/crates/v/asimov-kb]https://crates.io/crates/asimov-kb | [![Documentation]https://img.shields.io/docsrs/asimov-kb?label=docs.rs]https://docs.rs/asimov-kb |
| [asimov-keyring]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-keyring | [![Package]https://img.shields.io/crates/v/asimov-keyring]https://crates.io/crates/asimov-keyring | [![Documentation]https://img.shields.io/docsrs/asimov-keyring?label=docs.rs]https://docs.rs/asimov-keyring |
| [asimov-ledger]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-ledger | [![Package]https://img.shields.io/crates/v/asimov-ledger]https://crates.io/crates/asimov-ledger | [![Documentation]https://img.shields.io/docsrs/asimov-ledger?label=docs.rs]https://docs.rs/asimov-ledger |
| [asimov-module]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-module | [![Package]https://img.shields.io/crates/v/asimov-module]https://crates.io/crates/asimov-module | [![Documentation]https://img.shields.io/docsrs/asimov-module?label=docs.rs]https://docs.rs/asimov-module |
| [asimov-module-kit]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-module-kit | [![Package]https://img.shields.io/crates/v/asimov-module-kit]https://crates.io/crates/asimov-module-kit | [![Documentation]https://img.shields.io/docsrs/asimov-module-kit?label=docs.rs]https://docs.rs/asimov-module-kit |
| [asimov-nexus]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-nexus | [![Package]https://img.shields.io/crates/v/asimov-nexus]https://crates.io/crates/asimov-nexus | [![Documentation]https://img.shields.io/docsrs/asimov-nexus?label=docs.rs]https://docs.rs/asimov-nexus |
| [asimov-ontology]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-ontology | [![Package]https://img.shields.io/crates/v/asimov-ontology]https://crates.io/crates/asimov-ontology | [![Documentation]https://img.shields.io/docsrs/asimov-ontology?label=docs.rs]https://docs.rs/asimov-ontology |
| [asimov-patterns]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-patterns | [![Package]https://img.shields.io/crates/v/asimov-patterns]https://crates.io/crates/asimov-patterns | [![Documentation]https://img.shields.io/docsrs/asimov-patterns?label=docs.rs]https://docs.rs/asimov-patterns |
| [asimov-platform]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-platform | [![Package]https://img.shields.io/crates/v/asimov-platform]https://crates.io/crates/asimov-platform | [![Documentation]https://img.shields.io/docsrs/asimov-platform?label=docs.rs]https://docs.rs/asimov-platform |
| [asimov-prompt]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-prompt | [![Package]https://img.shields.io/crates/v/asimov-prompt]https://crates.io/crates/asimov-prompt | [![Documentation]https://img.shields.io/docsrs/asimov-prompt?label=docs.rs]https://docs.rs/asimov-prompt |
| [asimov-protocol]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-protocol | [![Package]https://img.shields.io/crates/v/asimov-protocol]https://crates.io/crates/asimov-protocol | [![Documentation]https://img.shields.io/docsrs/asimov-protocol?label=docs.rs]https://docs.rs/asimov-protocol |
| [asimov-proxy]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-proxy | [![Package]https://img.shields.io/crates/v/asimov-proxy]https://crates.io/crates/asimov-proxy | [![Documentation]https://img.shields.io/docsrs/asimov-proxy?label=docs.rs]https://docs.rs/asimov-proxy |
| [asimov-registry]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-registry | [![Package]https://img.shields.io/crates/v/asimov-registry]https://crates.io/crates/asimov-registry | [![Documentation]https://img.shields.io/docsrs/asimov-registry?label=docs.rs]https://docs.rs/asimov-registry |
| [asimov-remote]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-remote | [![Package]https://img.shields.io/crates/v/asimov-remote]https://crates.io/crates/asimov-remote | [![Documentation]https://img.shields.io/docsrs/asimov-remote?label=docs.rs]https://docs.rs/asimov-remote |
| [asimov-repository]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-repository | [![Package]https://img.shields.io/crates/v/asimov-repository]https://crates.io/crates/asimov-repository | [![Documentation]https://img.shields.io/docsrs/asimov-repository?label=docs.rs]https://docs.rs/asimov-repository |
| [asimov-runner]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-runner | [![Package]https://img.shields.io/crates/v/asimov-runner]https://crates.io/crates/asimov-runner | [![Documentation]https://img.shields.io/docsrs/asimov-runner?label=docs.rs]https://docs.rs/asimov-runner |
| [asimov-runtime]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-runtime | [![Package]https://img.shields.io/crates/v/asimov-runtime]https://crates.io/crates/asimov-runtime | [![Documentation]https://img.shields.io/docsrs/asimov-runtime?label=docs.rs]https://docs.rs/asimov-runtime |
| [asimov-sdk]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-sdk | [![Package]https://img.shields.io/crates/v/asimov-sdk]https://crates.io/crates/asimov-sdk | [![Documentation]https://img.shields.io/docsrs/asimov-sdk?label=docs.rs]https://docs.rs/asimov-sdk |
| [asimov-server]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-server | [![Package]https://img.shields.io/crates/v/asimov-server]https://crates.io/crates/asimov-server | [![Documentation]https://img.shields.io/docsrs/asimov-server?label=docs.rs]https://docs.rs/asimov-server |
| [asimov-snapshot]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-snapshot | [![Package]https://img.shields.io/crates/v/asimov-snapshot]https://crates.io/crates/asimov-snapshot | [![Documentation]https://img.shields.io/docsrs/asimov-snapshot?label=docs.rs]https://docs.rs/asimov-snapshot |
| [asimov-social]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-social | [![Package]https://img.shields.io/crates/v/asimov-social]https://crates.io/crates/asimov-social | [![Documentation]https://img.shields.io/docsrs/asimov-social?label=docs.rs]https://docs.rs/asimov-social |
| [asimov-telemetry]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-telemetry | [![Package]https://img.shields.io/crates/v/asimov-telemetry]https://crates.io/crates/asimov-telemetry | [![Documentation]https://img.shields.io/docsrs/asimov-telemetry?label=docs.rs]https://docs.rs/asimov-telemetry |
| [asimov-token]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-token | [![Package]https://img.shields.io/crates/v/asimov-token]https://crates.io/crates/asimov-token | [![Documentation]https://img.shields.io/docsrs/asimov-token?label=docs.rs]https://docs.rs/asimov-token |
| [asimov-universe]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-universe | [![Package]https://img.shields.io/crates/v/asimov-universe]https://crates.io/crates/asimov-universe | [![Documentation]https://img.shields.io/docsrs/asimov-universe?label=docs.rs]https://docs.rs/asimov-universe |
| [asimov-vault]https://github.com/asimov-platform/asimov.rs/tree/master/lib/asimov-vault | [![Package]https://img.shields.io/crates/v/asimov-vault]https://crates.io/crates/asimov-vault | [![Documentation]https://img.shields.io/docsrs/asimov-vault?label=docs.rs]https://docs.rs/asimov-vault |

### Glossary

- **Content digest**: A hash of the exact content bytes, excluding HTTP framing.
- **Signature base**: The ordered HTTP components and parameters signed by a key.
- **Trailers**: HTTP fields delivered after the body, verified at stream EOF.
## 👨‍💻 Development

```bash
git clone https://github.com/asimov-platform/asimov.rs.git
```

---

[![Share on X](https://img.shields.io/badge/share%20on-x-03A9F4?logo=x)](https://x.com/intent/post?url=https://github.com/asimov-platform/asimov.rs&text=ASIMOV%20Software%20Development%20Kit%20%28SDK%29%20for%20Rust)
[![Share on Reddit](https://img.shields.io/badge/share%20on-reddit-red?logo=reddit)](https://reddit.com/submit?url=https://github.com/asimov-platform/asimov.rs&title=ASIMOV%20Software%20Development%20Kit%20%28SDK%29%20for%20Rust)
[![Share on Hacker News](https://img.shields.io/badge/share%20on-hn-orange?logo=ycombinator)](https://news.ycombinator.com/submitlink?u=https://github.com/asimov-platform/asimov.rs&t=ASIMOV%20Software%20Development%20Kit%20%28SDK%29%20for%20Rust)
[![Share on Facebook](https://img.shields.io/badge/share%20on-fb-1976D2?logo=facebook)](https://www.facebook.com/sharer/sharer.php?u=https://github.com/asimov-platform/asimov.rs)
[![Share on LinkedIn](https://img.shields.io/badge/share%20on-linkedin-3949AB?logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/asimov-platform/asimov.rs)

[ASIMOV]: https://asimov.sh
[ASIMOV.rs]: https://github.com/asimov-platform/asimov.rs
[Async-Flow]: https://github.com/artob/async-flow
[Flows.rs]: https://github.com/artob/flows.rs
[flow-based]: https://github.com/artob/awesome-fbp
[naming conventions]: https://rust-lang.github.io/api-guidelines/naming.html
[modules]: https://github.com/asimov-modules
[module system]: https://asimov-specs.github.io/
[program patterns]: https://asimov-specs.github.io/program-patterns/
[trustworthy neurosymbolic machine intelligence]: https://asimov.blog/introducing-asimov/