`aitp::transport` — hardening register

Status tracker for the aitp::transport subsystems: what each module does, which RFC governs it, and what is still open. Operator-facing guidance (what to turn on in production) is in deployment.md.

aitp::transport is the only async module of aitp (reqwest/axum/tokio); the protocol modules stay sync. Its features, all on the aitp crate: http-client (default), http-server (implies http-client and source-ip), source-ip, client-spki-pinning (implies http-client; off by default), metrics and all. The Session Trust Bundle and TCT renewal endpoints live in aitp-experimental, behind that crate's http-server feature.

Status legend: scaffolded (compiles, thin) · tested (unit/integration coverage) · documented (rustdoc + usage notes) · done (tested + documented).

Subsystems

ModulePurposeRFCStatusRemaining / notes
client.rsManifestFetcher (HTTPS-only Manifest fetch, expiry-bounded per-AID cache, optional retry) and JwksFetcher0003 / 0007doneCache honors published_at/expires_at; no HTTP validators (ETag/If-None-Match). Retry defaults to RetryPolicy::none(). http://localhost / 127.0.0.1 accepted only after with_insecure_localhost_dangerous(), which also admits loopback addresses through the host guard. verify_manifest applies the same rule to a handshake_endpoint, under the opt-in on ManifestVerifyContext, PeerConfig, HandshakeServer and DelegationVerifyContext. The cache holds only VerifiedManifests: fetch returns one and maybe_replace_inline takes one. JWKS network resolution follows RFC-AITP-0007 §2.3: OIDC discovery first, /.well-known/aitp-keys only when discovery is not validly exposed.
client_config.rsConnection-pool + TLS knobs per fetcher—doneRustdoc example for pool sizing (with_pool_max_idle_per_host).
net_guard.rsSSRF HostGuard on peer-derived fetches (Manifest, JWKS/discovery/aitp-keys, facade handshake/renew): redirect-block, resolved-address classification (link-local/metadata always denied; private ranges per mode), DNS-rebind-safe address pinning0009doneHostGuard::default() is GuardMode::DenyPrivate; intranet deployments pass HostGuard::new(GuardMode::WarnPrivate), air-gapped/test networks HostGuard::new(GuardMode::AllowAll). HostGuard::allow_loopback_dangerous() admits loopback addresses only; the fetchers' with_insecure_localhost_dangerous() applies it.
replay_store.rsPluggable ReplayGuard (InMemoryReplayGuard default) for envelope message_id dedup0001 §5.5donecheck_and_record(key, ttl) maps to Redis SET NX EX; supply a shared backend for clustered deployments (HandshakeServer::with_replay_guard).
key_resolution.rsKeyResolutionPolicy: cache → pinned issuer store → network (JwksFetcher::resolve), with fail modes0007doneThe network step runs only in the async JwksResolver::prefetch, which the server and the facade await before each synchronous handshake step; the sync resolve answers from the cache and pinned store and never blocks a runtime thread. SoftFail fails closed on resolve(); degraded state only via resolve_outcome().
retry.rsExponential backoff + jitter for idempotent outbound reads—doneJitter strategy + max-attempts are configurable; keep retries to idempotent GETs only.
revocation.rs, revocation_fetch.rsRevocationFetcher (per-issuer cache, fail modes, HTTP fetch or an async RevocationProvider) and PreparedRevocation::decide; EmptyRevocationProvider for tests/dev0008doneSnapshot member-set and shape failures surface as RevocationError::UnknownField / Malformed (the REVOCATION_SNAPSHOT_INVALID case, RFC-AITP-0008 §1.5; an unknown version is Malformed too, #265), distinct from SignatureInvalid. Keep RevocationFailMode default = fail-closed.
server.rsManifestServer + HandshakeServer (hello/commit), RevocationListProducer0003 / 0004 / 0009doneHello/commit run replay → rate limit → timestamp (RFC-AITP-0009 §3.1). Manifest structural failures map to MANIFEST_INVALID; unknown members to UNKNOWN_FIELD. Rate limiting is on by default at the RFC-AITP-0009 §3.1 values; DEFAULT_MAX_SESSIONS is the §3.1 1 000; serve() starts a background session sweeper (without_session_sweeper() opts out). Open: the body cap is above the §3.1 recommendation (see deployment). Producer must never mint a fresh empty list on backing-store failure.
server_limits.rsRequest body-size cap (axum-level) + header recommendations0009doneDocument how the cap composes with axum::DefaultBodyLimit.
tls_pinning.rsSHA-256 SPKI pinning for outbound HTTPSRFC 7469doneBehind client-spki-pinning (off by default — avoids pulling a rustls CryptoProvider). Rustdoc covers compute_spki_hash and a reqwest integration example.
aitp_experimental::session_bundle::serverSession Trust Bundle HTTP transport (§4.3.1) — in-memory store, no verification0010 (Draft, opt-in)testedIn crates/aitp-experimental/src/session_bundle/server.rs, behind aitp-experimental/http-server. Unknown body member → UNKNOWN_FIELD; wrapper defect or bare (unwrapped) body → SESSION_BUNDLE_INVALID. Advertise the route with aitp_experimental::session_bundle::advertise_bundle_uri and SessionBundleServer::bundle_uri (see session-bundle).
obs.rsLow-cardinality counters at trust-decision points—doneBehind metrics; metric names in deployment.

Cross-cutting acceptance criteria

  • Async stays contained. No async leaks into aitp::core / aitp::tct / aitp::handshake. New blocking-bridge points must document the Tokio-context requirement (as key_resolution.rs does).
  • Fail-closed defaults. Revocation and key-resolution soft-fail modes must fail closed on the plain accessor; degraded state is opt-in via the *_outcome() variants.
  • Feature minimalism. Pinning stays behind client-spki-pinning so a default http-client build doesn't pull in a rustls CryptoProvider.

Open items (rolled up)

Nothing is open now.