Expand description
HTTPS transport binding for the Trust Tasks framework.
Implements SPEC.md §9 over HTTP/1.1
using axum on the server side and reqwest on the client side. The binding
authenticates parties via an Authorization: Bearer <token> header that an
Auth implementation maps to a Verifiable Identifier.
The server and client are secure by default — attribution required, the
§7.2 item 11 duplicate-execution record and the consequential freshness
bound on, response binding checked by the client — and those defaults are
what a production deployment runs. What is demo-grade is one
implementation of Auth: BearerAuth, a static token map. A
deployment plugs in its own Auth (or JwtBearerAuth, behind the jwt
feature) and terminates TLS in front of the server.
§Binding URI
https://trusttasks.org/binding/https/0.2
§On the wire
POST /trust-tasks HTTP/1.1
Host: example.com
Content-Type: application/json
Authorization: Bearer <token>
{
"id": "...",
"type": "https://trusttasks.org/spec/acl/grant/0.1",
"issuer": "did:web:org.example",
"recipient": "did:web:maintainer.example",
"issuedAt": "2026-05-17T10:00:00Z",
"payload": { ... }
}The server maps the bearer token to a VID, runs the §7.2 / §4.8.1
consumer-side validation pipeline (cross-checking the in-band issuer
against the authenticated sender), and dispatches the document to the
handler registered for its type URI.
§Cargo features
server(default) — pulls in axum + tokio + tower; exposesHttpsServer.client(default) — pulls in reqwest; exposesHttpsClient.
Disable one or the other if your binary only acts as a producer or only as a consumer.
§Versioning
This crate exposes trust-tasks-rs types in its own public API, so a
breaking change there breaks this crate’s callers even when nothing here
changes. cargo-semver-checks cannot catch that: it compares each crate’s
rustdoc against that crate’s own published baseline, and does not track
type identity across dependency versions. The crates that share
trust-tasks-rs in their public API are therefore released as one
compatibility unit with a single shared version — see version_group in
release-plz.toml.
Structs§
- Bearer
Auth - Static
HashMap-backedAuthimplementation. Constructed from a list of(token, vid)pairs. - Https
Client client - HTTPS Trust Tasks client.
- Https
Client Builder client - Builder for
HttpsClient. - Https
Handler - A
TransportHandlerfor a single HTTPS exchange. - Https
Server server - An HTTPS Trust Tasks server.
- Https
Server Builder server - Builder for
HttpsServer. - Request
Context server - Context handed to every spec handler — the transport-authenticated peer (when present), convenience accessors for the inbound document’s metadata, and the SPEC §4.8.1-resolved party identities.
Enums§
- Client
Error client - Errors raised by
HttpsClient::send. - Transport
Error - Transport-level failures: I/O, broken HTTP framing, body that doesn’t
even parse as JSON. Distinct from
trust-task-errordocuments, which a well-behaved peer returns inside an HTTP response body and which this crate surfaces as typed values viacrate::ClientError.
Constants§
- BINDING_
URI - Stable identifier for the HTTPS binding, per SPEC.md §9.2.
- DEFAULT_
ALLOWED_ DID_ METHODS server - The DID methods a server with a verifier accepts in
proof.verificationMethodwhen neitherHttpsServerBuilder::allowed_did_methodsnorHttpsServerBuilder::allow_any_did_methodwas called:did:key, whose key is in the identifier, so verifying it never leaves the process. - DEFAULT_
CONNECT_ TIMEOUT client - Default connection-establishment timeout.
- DEFAULT_
MAX_ CONCURRENT_ REQUESTS server - Default ceiling on concurrently-executing requests, applied by
HttpsServer::into_router. Bounds the memory a flood of slow senders can pin. Override withHttpsServerBuilder::max_concurrent_requests. - DEFAULT_
MAX_ RESPONSE_ BYTES client - Default cap on a response body: 256 KiB, the request cap the bundled server applies. A trust-task response is one small JSON document.
- DEFAULT_
REQUEST_ TIMEOUT server - Default per-request wall-clock budget applied by
HttpsServer::into_router. A Trust Task exchange is one small JSON round trip; a request still in flight after this is wedged, and holding the connection open is exactly what a slowloris wants. Override withHttpsServerBuilder::request_timeout. - DEFAULT_
TIMEOUT client - Default end-to-end request timeout. A trust-task exchange is one small JSON round trip; a peer that takes longer than this is down or wedged.
- MAX_
BODY_ BYTES server - The transport bound on a Trust Task document (SPEC §12.2, §12.4): the
smallest request-body limit
HttpsServer::into_routerapplies, and the size bound held against a document whose specification declares nomaxDocumentBytes. Trust Task payloads are small; 256 KiB is generous headroom while bounding pre-auth memory use.
Traits§
- Async
Auth - Resolves bearer tokens to Verifiable Identifiers, asynchronously — what the server calls.
- Auth
- Resolves bearer tokens to Verifiable Identifiers.
Functions§
- status_
for_ code - Map a
TrustTaskCodeto a numeric HTTP status code.
Type Aliases§
- Auth
Future - The boxed future an
AsyncAuthresolves through.