1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
[]
= "tensor-wasm-api"
= true
= true
= true
= true
= true
= true
= "HTTP serverless API gateway (axum)."
= "https://github.com/craton-co/craton-tensor-wasm"
= "https://docs.rs/tensor-wasm-api"
= "README.md"
= ["wasm", "axum", "gateway", "serverless", "runtime"]
= ["web-programming::http-server", "wasm"]
[]
[]
= true
= true
= { = true }
= { = true }
# tensor-wasm-snapshot: consumed by the `/snapshot/save` and
# `/snapshot/restore` routes (M5). The `signed-snapshots` feature is
# required so the handlers can call `SnapshotWriter::with_hmac_sha256_key`
# / `SnapshotReader::with_hmac_sha256_key` to sign and verify blobs with
# the operator-configured `TENSOR_WASM_API_SNAPSHOT_HMAC_KEY`. We pin the
# legacy v2/v3 inline envelope on the write path (via
# `SnapshotWriter::with_legacy_envelope`) so the api crate does not pull
# in the artifact-store machinery; `default-features = false` keeps that
# dep surface off.
= { = true, = false, = ["signed-snapshots"] }
# tensor-wasm-wasi-gpu: needed by the streaming `/invoke-stream` route to
# construct a `StreamingContext` whose `mpsc::Sender<Vec<u8>>` is wired
# into the executor's spawn config (T34). The receiver end stays in the
# route handler and feeds the SSE / chunked-transfer response body.
= { = true }
# tensor-wasm-jit: pulled in only when the `kernel-registry-api` feature
# is enabled. The api crate uses it solely to expose the `/kernels` HTTP
# routes (B6.4) — manifest verification, in-memory storage, and the
# trait surface all live in `tensor-wasm-jit::registry`. The dep is
# optional so the default build keeps the lean dependency graph the
# B6.3 scaffold (jit/Cargo.toml) describes; only consumers that flip
# `--features kernel-registry-api` pull in `hmac`/`sha2`/`serde_json`
# transitively.
= { = true, = ["kernel-registry"], = true }
= "0.22"
= true
# futures: needed by the streaming `/invoke-stream` handler to build an
# `impl Stream<Item = Result<Event, _>>` that axum's `Sse` wraps, and an
# `impl Stream<Item = Result<Bytes, _>>` that `Body::from_stream` wraps
# on the non-SSE branch. The dev-dependency line below stays so existing
# tests that pull in `futures::future` helpers keep working without an
# `extern crate` shim.
= { = true }
= true
# ipnet: parse the `TENSOR_WASM_API_TRUSTED_XFCC_PROXIES` allowlist as a list
# of IPv4/IPv6 IPs or CIDR ranges so the audit middleware only consults the
# `X-Forwarded-Client-Cert` header when the immediate TCP peer is a configured
# proxy. See `crate::audit::TrustedProxies` and the threat-model comment on
# `crate::audit::extract_client_cert_subject_gated`. Pinned to the workspace's
# 2.x minor range; no workspace-level entry because this is the only crate
# that needs it today.
= "2"
= { = true }
# opentelemetry_sdk: needed only for `TraceContextPropagator` so the gateway
# can install the W3C propagator on startup and have the trace context
# extracted from inbound `traceparent` headers stitch correctly into the
# tracing span tree. The SDK is already declared in `[workspace.dependencies]`
# alongside `opentelemetry-otlp`; pulling it in unconditionally here keeps
# the propagation path enabled without forcing every binary to also enable
# the OTLP exporter feature on `tensor-wasm-core`.
= { = true }
= true
= true
# subtle: constant-time byte comparison for the bearer-token allowlist
# lookup in `crate::middleware::AuthConfig::scope_for`. The previous
# `HashMap::get` lookup short-circuits on hash mismatch and then bytes-eq
# matching entries — both timing-leakable for token discovery. See the
# `scope_for` docstring for the loop-and-no-break rationale.
= "2"
= true
= true
= true
# tower-http: workspace declaration enables {trace, timeout, cors}. We
# use axum's native `DefaultBodyLimit::max` for the 64 MiB inbound body
# cap rather than `tower_http::limit::RequestBodyLimitLayer` (which
# rewraps the body in `Limited<Body>` and breaks composition with
# `axum::middleware::from_fn`), so the `limit` feature is intentionally
# not requested here.
= { = true, = ["trace", "timeout", "cors"] }
= true
= { = true }
= true
= true
[]
= []
# Signed kernel registry HTTP surface (B6.4 — roadmap feature #3 server
# side). When enabled, the api crate compiles the `kernels` module and
# wires `POST/GET /kernels` + `GET /kernels/{name}/{version}` into the
# router. The feature gates the optional `tensor-wasm-jit` dep (which
# itself enables its own `kernel-registry` sub-feature for the manifest
# verification + InMemoryRegistry impl) so the default build is unaffected
# — operators that don't need the registry endpoints keep the lean dep
# graph. See `docs/KERNEL-REGISTRY.md` for the rollout plan.
= ["dep:tensor-wasm-jit"]
[]
# futures: now declared as a regular [dependencies] entry above for the
# streaming `/invoke-stream` handler. The dev-dependency block keeps no
# duplicate entry — Cargo resolves both `cfg(test)` and `cfg(not(test))`
# code against the same crate version.
= "0.1"
# tensor-wasm-jit + blake3: only the kernel-registry-api integration
# test (tests/kernel_registry_routes.rs) consumes these. The test is
# itself gated behind `#[cfg(feature = "kernel-registry-api")]`; we
# pull the jit crate with its `kernel-registry` sub-feature so the
# `registry` module + `sign_manifest` helper are in scope, and blake3
# so the test can recompute digests when constructing signed manifests.
# Cargo deduplicates against the optional `[dependencies]` entry once
# the api feature is on.
= { = true, = ["kernel-registry"] }
= true
# `temp-env` scopes process env-var mutations to a closure and serialises
# concurrent users behind an internal Mutex. The header-hardening tests
# use this for the `TENSOR_WASM_API_REQUIRE_TENANT=1` path (see
# `tests/header_hardening_test.rs::missing_tenant_when_required`) rather
# than raw `std::env::set_var` / `remove_var` — the latter became `unsafe`
# in Rust 2024 and parallel mutation of the process env from tests is
# undefined behaviour.
= true
= { = true, = ["macros", "rt-multi-thread"] }
= true
= { = true, = ["util"] }
# tracing-subscriber: pulled in for the concurrent-load tracing test
# (`tests/trace_concurrent_load_test.rs`), which installs a custom
# `Layer` that counts `on_new_span` callbacks to verify W4.1's
# `Instrument::instrument` wrap around `tokio::spawn` does not
# double-instrument the async-invoke job span (audit Problem #11).
= { = true }
= true
[]
= true
= ["--cfg", "docsrs"]