asimov-http 25.9.0

HTTP message integrity and shared client proxy configuration
Documentation

ASIMOV.rs: HTTP Support

License Compatibility Package Documentation

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

[Features] | [Prerequisites] | [Installation] | [Examples] | [Reference] | [Development]

✨ 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 1.97+ (2024 edition)

⬇️ Installation

Installation via Cargo

cargo add asimov-http

Installation in Cargo.toml

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

Alternatively, enable only specific features:

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

👉 Examples

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 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:

cargo run -p asimov-http --example server

Then run the client:

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:

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

Packages

Package Crate Docs
asimov-account Package Documentation
asimov-agent Package Documentation
asimov-cache Package Documentation
asimov-cloud Package Documentation
asimov-config Package Documentation
asimov-construct Package Documentation
asimov-core Package Documentation
asimov-credit Package Documentation
asimov-dataset Package Documentation
asimov-directory Package Documentation
asimov-env Package Documentation
asimov-flow Package Documentation
asimov-graph Package Documentation
asimov-http Package Documentation
asimov-huggingface Package Documentation
asimov-id Package Documentation
asimov-installer Package Documentation
asimov-kb Package Documentation
asimov-keyring Package Documentation
asimov-ledger Package Documentation
asimov-module Package Documentation
asimov-module-kit Package Documentation
asimov-nexus Package Documentation
asimov-ontology Package Documentation
asimov-patterns Package Documentation
asimov-platform Package Documentation
asimov-prompt Package Documentation
asimov-protocol Package Documentation
asimov-proxy Package Documentation
asimov-registry Package Documentation
asimov-remote Package Documentation
asimov-repository Package Documentation
asimov-runner Package Documentation
asimov-runtime Package Documentation
asimov-sdk Package Documentation
asimov-server Package Documentation
asimov-snapshot Package Documentation
asimov-social Package Documentation
asimov-telemetry Package Documentation
asimov-token Package Documentation
asimov-universe Package Documentation
asimov-vault Package Documentation

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

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

Share on X Share on Reddit Share on Hacker News Share on Facebook Share on LinkedIn