[workspace] members = ["crates/aci-protocol", "crates/aci-verify"] default-members = ["."] resolver = "2" [package] name = "private-ai-gateway" version = "0.1.0" edition = "2021" description = "Rust implementation of the Attested Confidential Inference (ACI) aggregator service" license = "Apache-2.0" [lib] name = "private_ai_gateway" path = "src/lib.rs" [[bin]] name = "private-ai-gateway" path = "src/main.rs" [dependencies] aci-protocol = { path = "crates/aci-protocol" } aci-verify = { path = "crates/aci-verify" } # Canonical-JSON, types, and serialization. serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } # Full RFC 8785 JCS (ES6 number formatting, UTF-16 key order) for the 0G # Private Computer AAD, which binds arbitrary cleartext JSON. serde_json_canonicalizer = "0.4" dstack-sdk = "0.1.2" bytes = "1" rust_decimal = "1" # Cryptography. sha2 = "0.10" sha3 = "0.10" ed25519-dalek = { version = "2", features = ["rand_core"] } k256 = { version = "0.13", features = ["ecdsa", "arithmetic", "ecdh"] } curve25519-dalek = "4" x25519-dalek = { version = "2", features = ["static_secrets"] } aes-gcm = "0.10" base64 = "0.22" chacha20poly1305 = "0.10" flate2 = "1" hkdf = "0.12" # RFC 9180 HPKE (base mode, DHKEM-X25519 / HKDF-SHA256 / ChaCha20Poly1305) for # the 0G Private Computer E2EE protocol; 0.12 reuses the RustCrypto versions above. hpke = { version = "0.12", default-features = false, features = ["alloc", "x25519"] } ml-kem = { version = "0.3", features = ["getrandom"] } rand = "0.8" rand_core = "0.6" hex = "0.4" rustls-pemfile = "2" x509-parser = "0.16" rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] } webpki-roots = "1" # HTTP server. axum = "0.7" tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal", "net", "process", "io-util", "time"] } tower = "0.5" tower-http = { version = "0.6", features = ["cors"] } futures-util = "0.3" multer = "3" mime = "0.3" # Serving the public entry directly (rather than via axum::serve) is what lets the # connection IO be wrapped with a write-idle timeout; axum 0.7 takes a concrete # TcpListener and offers no hook for that. Deliberately NOT hyper-util's # `server-auto`: it would enable hyper-util/http2, and Cargo unifies features # crate-wide, so every axum::serve here would start negotiating HTTP/2 — where # flow control means a stalled reader never blocks the socket write and the # timeout below could never arm. hyper = { version = "1", features = ["server", "http1"] } hyper-util = { version = "0.1", features = ["tokio", "service"] } http-body-util = "0.1" async-stream = "0.3" # Server-sent event framing at provider and client boundaries. sse-stream = "0.3" # HTTP client (upstream forwarding). Rustls with native roots keeps TLS # validation normal without linking against system OpenSSL. reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-native-roots", "json", "stream", "multipart"] } # Errors and logging. thiserror = "1" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } prometheus = "0.13" # Async traits used by upstream and verifier abstractions. async-trait = "0.1" # Upstream ACI/DCAP verification. dcap-qvl = { version = "0.3.12", default-features = false, features = ["std", "report", "rustcrypto"] } [target.'cfg(unix)'.dependencies] libc = "0.2" [dev-dependencies] tempfile = "3" tokio = { version = "1", features = ["macros", "rt-multi-thread", "test-util"] } serde_json = "1" [lints.rust] unused_must_use = "deny"