datapress-core 0.4.21

Backend-agnostic core types, config, routing, and HTTP handlers for the datapress dataset server.
Documentation
[package]
name             = "datapress-core"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Backend-agnostic core types, config, routing, and HTTP handlers for the datapress dataset server."
documentation = "https://docs.datap-rs.org"
readme = "README.md"

[features]
# Backend crates opt in to these via `features = [...]` on their
# `datapress-core` dep. They pull in the optional deps used by the
# backend-specific `From` impls in `errors.rs`.
duckdb     = ["dep:duckdb"]
datafusion = ["dep:arrow", "dep:parquet", "dep:datafusion"]
# Embed the MkDocs Material documentation site into the binary and
# serve it from the configured `[docs].path`. Off by default to keep
# binaries small.
docs       = ["dep:include_dir", "dep:mime_guess"]
# Embed Swagger UI + a hand-written OpenAPI spec. Served from
# `[swagger].path` (default `/docs`). Off by default at compile time;
# can be disabled at runtime via `[swagger].enabled = false`. Pulls in
# `reqwest` to run OIDC discovery at startup when `[swagger.oauth2]` is
# configured, so the UI's Authorize dialog gets explicit authorize/token
# endpoints (an `oauth2` flow) instead of an empty `openIdConnect` form.
swagger    = ["dep:utoipa", "dep:utoipa-swagger-ui", "dep:reqwest"]
# Expose a Prometheus `/metrics` endpoint plus per-request HTTP metrics
# (counts + latency histograms) via middleware. Served from
# `[metrics].path` (default `/metrics`). Off by default at compile time;
# can be toggled at runtime via `[metrics].enabled`.
metrics    = ["dep:actix-web-prom"]
# OIDC bearer-token authentication + scope enforcement. Off by default;
# when enabled, `[auth]` config block must be provided. The Swagger UI's
# SSO support (`[swagger.oauth2]`) is independent of this and only
# drives the UI; the actual API enforcement lives behind this feature.
auth       = ["dep:jsonwebtoken", "jsonwebtoken/aws_lc_rs", "dep:reqwest", "dep:arc-swap"]
# Embed the dataset explorer UI (Actix + Askama templates + htmx +
# Bootstrap). Served from `[explorer].path` (default `/explore`). Off by
# default at compile time; can be toggled at runtime via
# `[explorer].enabled`. Also embeds the self-hosted DuckDB-WASM terminal
# assets (wasm + workers + bundled ESM) via `include_dir`, so the shell
# runs with no CDN dependency.
explorer   = ["dep:askama", "dep:include_dir", "dep:mime_guess"]

[dependencies]
actix-web.workspace   = true
async-trait.workspace = true
bytes.workspace       = true
futures-util.workspace = true
serde.workspace       = true
serde_json.workspace  = true
log.workspace         = true
toml.workspace        = true
glob.workspace        = true
tokio.workspace       = true
sqlparser.workspace   = true

# Optional, feature-gated (see [features] above).
duckdb     = { workspace = true, optional = true }
arrow      = { workspace = true, optional = true }
parquet    = { workspace = true, optional = true }
datafusion = { workspace = true, optional = true }
include_dir = { version = "0.7", optional = true }
mime_guess  = { version = "2",   optional = true }
utoipa            = { workspace = true, optional = true }
utoipa-swagger-ui = { workspace = true, optional = true }
actix-web-prom    = { workspace = true, optional = true }
jsonwebtoken      = { workspace = true, optional = true }
reqwest           = { workspace = true, optional = true }
arc-swap          = { workspace = true, optional = true }
askama            = { workspace = true, optional = true }

[build-dependencies]
# Used only by build.rs to pre-gzip the embedded DuckDB-WASM assets (explorer
# feature) so the binary / PyPI wheel stays under PyPI's 100 MB file limit.
flate2 = "1"

[dev-dependencies]
arrow = { workspace = true }
actix-rt = "2"