[package]
name = "aitp-transport-http"
description = "HTTP client and server bindings for AITP (feature-gated)"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
homepage.workspace = true

[features]
default = []
client = ["dep:reqwest", "dep:tokio"]
server = ["dep:axum", "dep:tokio"]
# Enable SHA-256 SPKI cert pinning on the outbound HTTP client. Off by
# default so workspaces that don't need air-gapped pinning don't pull in
# rustls/x509-parser. Requires `client`.
client-spki-pinning = ["client", "dep:rustls", "dep:rustls-pki-types", "dep:x509-parser"]
# Mount the `/aitp/handshake/renew` endpoint on the HandshakeServer
# (RFC-AITP-0004 §8.1, post-v0.1). Requires `server`.
experimental-renewal = ["aitp-tct/experimental-renewal"]
# Mount the session-bundle HTTP endpoints — `POST /aitp/session/bundle`
# and `GET /aitp/session/bundle/:session_id` (RFC-AITP-0010 §4.3.1,
# Draft / non-normative). Requires `server`.
experimental-session-bundle = ["server", "dep:aitp-session-bundle"]

[dependencies]
aitp-core = { path = "../aitp-core", version = "0.2.0" }
aitp-crypto = { path = "../aitp-crypto", version = "0.2.0" }
aitp-envelope = { path = "../aitp-envelope", version = "0.2.0" }
aitp-manifest = { path = "../aitp-manifest", version = "0.2.0" }
aitp-handshake = { path = "../aitp-handshake", version = "0.2.0" }
aitp-tct = { path = "../aitp-tct", version = "0.2.0" }
aitp-session-bundle = { path = "../aitp-session-bundle", version = "0.2.0", optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
url = { workspace = true }
uuid = { workspace = true }
reqwest = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
jsonwebtoken = { workspace = true }
parking_lot = { workspace = true }
tracing = { workspace = true }
sha2 = { workspace = true }
chrono = { workspace = true }
# Used by `retry::RetryPolicy::apply_jitter` to sample a uniform delay
# inside the symmetric jitter window. Lightweight — no need for a crypto
# RNG here, `rand::thread_rng()` is appropriate.
rand = { workspace = true }
rustls = { workspace = true, optional = true }
rustls-pki-types = { workspace = true, optional = true }
x509-parser = { workspace = true, optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
axum = { workspace = true }
reqwest = { workspace = true }
tower = { workspace = true, features = ["util"] }
ed25519-dalek = { workspace = true }
