Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
trust-tasks-https
HTTPS transport binding for the Trust Tasks framework. A typed HttpsClient (reqwest) and an axum-based HttpsServer that together implement SPEC.md §9 over HTTP/1.1 with bearer-token identity authentication — enough for demos, mockups, and end-to-end testing without standing up mTLS or DIDComm.
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 <token> to a VID, runs the §7.2 consumer-side validation pipeline (cross-checking the in-band issuer against the authenticated sender per §4.8.1), and dispatches the document to the handler registered for its type URI. Success responses return as #response-variant documents inside an HTTP 200 body. Failures return as trust-task-error documents with the status mapping documented in status.rs.
Security defaults
The binding specification is explicit that it "does not permit proof to be omitted": a bearer token authenticates whoever presents it to whatever terminates TLS, which is not the same party as whoever composed the document. The runtime enforces that:
| Default | Effect | Opt out with |
|---|---|---|
require_attribution = true |
A document arriving with neither a transport-authenticated peer nor a proof is rejected proofRequired before any handler runs. Without it, an unauthenticated POST asserting "issuer": "did:web:victim" reaches handlers with that string as the caller's identity. |
.require_attribution(false) — dev and tests only |
| Discovery requires authentication | enable_discovery() answers an unauthenticated discoverer with permissionDenied rather than the full route table (SPEC §10). |
.public_discovery() |
| Route lookup precedes proof verification | An unknown type is rejected before DID resolution, so the endpoint cannot be aimed at an arbitrary host by a stranger. |
— |
Content-Type: application/json required |
A text/plain cross-origin simple POST is refused with 415 instead of reaching the pipeline. |
— |
| Request timeout + concurrency limit | Slowloris and flood controls on the router. | .request_timeout(..), .max_concurrent_requests(..) |
| Response binding on the client | HttpsClient::send checks the response's threadId, type, issuer and recipient against the request before returning it. |
— |
Optionally, .allowed_did_methods(["key"]) pre-screens proof.verificationMethod before the verifier resolves it, and HttpsClient::builder().with_response_verifier(..) requires signed responses.
Quickstart
Server:
use ;
use grant;
let server = builder
.local_vid
.with_auth
.
.build;
server.serve.await?;
Client:
use HttpsClient;
use ;
let client = builder
.server_url
.server_vid
.my_vid
.my_token
.build?;
let req = for_payload;
let resp: = client.send.await?;
Demo
A working end-to-end demo lives in examples/. In one terminal:
In another:
The client issues an acl/grant request as did:web:alice.example over the alice bearer token; the server's handler accepts it and the client prints the #response document.
Cargo features
| Feature | What it enables |
|---|---|
client (default) |
HttpsClient (pulls in reqwest) |
server (default) |
HttpsServer (pulls in axum, tokio) |
A producer-only binary can disable server; a consumer-only binary can disable client.
TLS
The crate's name says HTTPS but the server- and client-side examples use plain HTTP localhost for ergonomic local testing. For production use, terminate TLS in front of the axum server (a reverse proxy is the easiest path; axum-server with rustls works for native termination) and configure reqwest with the appropriate root-CA bundle. The framework's §6.1 requirement that type URIs use https is independent of the transport you carry the document over.
Security notes
The bearer-auth model in this crate is intentionally simple, intended for demos and end-to-end testing. Production deployments SHOULD plug in a real Auth implementation backed by a token-issuing identity provider, JWT verification, or peer-certificate validation. Several of the framework-level security properties (audience binding, identity-mismatch routing, retry semantics, error-message sanitisation) are enforced regardless of which Auth you use; see SPEC.md §10 and trust-tasks-rs.