ASIMOV.rs: HTTP Support
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_stddigest 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
Installation in Cargo.toml
[]
= { = "25" }
Alternatively, enable only specific features:
[]
= { = "25", = false }
👉 Examples
use ContentDigest;
let digest = new;
assert_eq!;
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:
Then run the 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:
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
Packages
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