crates/korp-map-wire/Cargo.toml
[package]
name = "korp-map-wire"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
publish = false
description = "korp map wire, contract v1: the MapSource trait, the HTTP Arrow IPC door, the Arrow Flight door, and a file-backed source over GeoParquet native files"
repository = "https://git.gunnar.rs/nordisk/korp-map"
# Self-rooting, like the other `crates/*` leaves: it depends on nothing in korp's
# `src/`, builds and tests alone (`cargo test` in this directory), and korp's root
# lists it in `exclude`. korp-map takes it as a path dependency.
[workspace]
# ── THE ARROW MAJOR, in one place ────────────────────────────────────────────
# Every arrow crate, arrow-flight and parquet share one major and must move together
# (59 today, korp's lock; 60 when the version bump reaches korp). Change it HERE only.
[workspace.dependencies]
arrow-array = "59"
arrow-schema = "59"
arrow-buffer = "59"
arrow-select = "59"
arrow-ipc = { version = "59", features = ["zstd"] }
arrow-flight = "59"
parquet = { version = "59", default-features = false, features = ["arrow", "zstd"] }
[dependencies]
arrow-array = { workspace = true }
arrow-schema = { workspace = true }
arrow-buffer = { workspace = true }
arrow-select = { workspace = true }
arrow-ipc = { workspace = true }
arrow-flight = { workspace = true }
parquet = { workspace = true }
# arrow-flight's own tonic line (0.14); only the server types and Status are used.
tonic = { version = "0.14", default-features = false, features = ["codegen"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "sync", "time"] }
hyper = { version = "1", features = ["server", "http1", "http2"] }
hyper-util = { version = "0.1", features = ["tokio", "server", "server-auto", "http1", "http2"] }
http = "1"
http-body = "1"
http-body-util = "0.1"
bytes = "1"
futures = { version = "0.3", default-features = false, features = ["std"] }
serde = { version = "1", features = ["derive"] }
# `float_roundtrip`: a region's bbox read back by a client is the bbox the server wrote,
# to the last bit (the default parser can be one ulp off).
serde_json = { version = "1", features = ["float_roundtrip"] }
# HTTP content encoding of the replies (`encoding`), all pure Rust: `zstd` is the
# mzstd stand-in through `[patch.crates-io]`, brotli the `brotli` crate, gzip flate2 on
# miniz_oxide.
zstd = "0.13"
brotli = { version = "8", default-features = false, features = ["std"] }
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
# The sha256 of every served file (`files`), pure Rust.
sha2 = "0.10"
# ── The client side (feature `client`, off by default): the HTTP and Flight readers of
# a map server. A server-only build links none of it.
async-trait = { version = "0.1", optional = true }
# ── TLS (features `tls`, `acme` and `client-tls`, off by default): rustls on the ring
# provider only, no aws-lc and no OpenSSL. `tls` serves the doors over HTTPS with a
# certificate from PEM files; `acme` adds Let's Encrypt certificates over TLS-ALPN-01;
# `client-tls` lets the client doors talk https.
rustls = { version = "0.23.31", default-features = false, features = ["ring", "std", "tls12"], optional = true }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"], optional = true }
rustls-acme = { version = "0.15", default-features = false, features = ["ring", "tls12", "webpki-roots", "tokio"], optional = true }
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "ring", "tls12"], optional = true }
webpki-roots = { version = "1", optional = true }
[features]
client = ["dep:async-trait", "hyper-util/client-legacy", "hyper/client", "tonic/transport"]
tls = ["dep:rustls", "dep:tokio-rustls", "tokio/time", "tokio/io-util"]
acme = ["tls", "dep:rustls-acme"]
client-tls = ["client", "tls", "dep:hyper-rustls", "dep:webpki-roots", "tonic/tls-ring", "tonic/tls-webpki-roots"]
[dev-dependencies]
hyper-util = { version = "0.1", features = ["client-legacy", "http1", "tokio"] }
tonic = { version = "0.14", features = ["transport"] }
tempfile = "3"
# The file tests run DuckDB in a child process.
tokio = { version = "1", features = ["process"] }
# The self-signed certificates of the HTTPS tests (ring, like everything TLS here).
rcgen = { version = "0.13", default-features = false, features = ["crypto", "ring", "pem"] }
[[test]]
name = "client"
required-features = ["client"]
[[test]]
name = "https"
required-features = ["client-tls"]
# zstd on the map path runs on mzstd: the stand-in crate named `zstd` (znippy-zoomies
# `crates/zstd-on-mzstd`) replaces the C-backed crates.io `zstd` 0.13 under
# parquet and arrow-ipc. Applies when this crate is the root; korp's root carries the
# same row once korp-map is split out.
[patch.crates-io]
zstd = { path = "../../../znippy-zoomies/crates/zstd-on-mzstd" }