ullun-api 0.4.12

Express.js-inspired web framework for Rust - simple, fast, batteries-included
Documentation
[package]
name = "ullun-api"
version = "0.4.12"
edition = "2021"
authors = ["yedoma-labs"]
description = "Express.js-inspired web framework for Rust - simple, fast, batteries-included"
license = "MIT OR Apache-2.0"
repository = "https://github.com/yedoma-labs/ullun-api"
homepage = "https://github.com/yedoma-labs/ullun-api"
documentation = "https://docs.rs/ullun-api"
readme = "README.md"
keywords = ["web", "framework", "api", "microservices", "http"]
categories = ["web-programming::http-server"]
exclude = [
    ".github/*",
    ".dockerignore",
    ".githooks/*",
    "release-plz.toml",
    "Dockerfile",
    "target/*",
    "bench/*",
    "scripts/*",
]

[features]
default = []
# HMAC-SHA256 signing: signed cookies
signing = ["dep:hmac", "dep:sha2", "dep:base64"]
# HS256 JSON Web Tokens and a bearer-auth middleware
jwt = ["signing"]
# gzip response compression middleware
compression = ["dep:flate2"]
# WebSocket upgrades (App::ws)
websocket = ["dep:tokio-tungstenite", "dep:futures-util"]
# HTTPS (rustls with the ring provider), certificate reload, client certificates
tls = ["dep:tokio-rustls"]
# outbound HTTPS for ullun::client (rustls + Mozilla root certificates)
client-tls = ["dep:tokio-rustls", "dep:webpki-roots"]
# RS256 / ES256 JSON Web Tokens and JWKS (ring)
jwt-asymmetric = ["jwt", "dep:ring"]
# Redis client (no dependencies) and Redis stores for sessions, rate limits, idempotency keys
redis = []
# OpenAPI schemas derived from Rust types (schemars)
openapi-schemars = ["dep:schemars"]
# encrypted ("private") cookies: ChaCha20-Poly1305
encryption = ["dep:chacha20poly1305", "dep:base64"]
full = ["jwt", "jwt-asymmetric", "signing", "encryption", "redis", "openapi-schemars", "compression", "websocket", "tls", "client-tls"]

[package.metadata.docs.rs]
all-features = true

[dependencies]
# Core HTTP
http = "1.5"
hyper = { version = "1.12", features = ["full"] }
hyper-util = { version = "0.1.21", features = ["tokio"] }
http-body-util = "0.1.5"
tokio = { version = "1.54", features = ["full"] }

# Serialization
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.154"

# Routing
matchit = "0.9.2"

# Async traits
async-trait = "0.1.92"

# HTTP types
bytes = "1.12"
urlencoding = "2.1.3"
serde_urlencoded = "0.7.1"
getrandom = "0.4"

# Optional (see [features])
hmac = { version = "0.13", optional = true }
sha2 = { version = "0.11", optional = true }
base64 = { version = "0.23", optional = true }
flate2 = { version = "1.1", optional = true }
tokio-tungstenite = { version = "0.30", default-features = false, features = ["handshake"], optional = true }
futures-util = { version = "0.3", default-features = false, features = ["sink"], optional = true }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"], optional = true }
webpki-roots = { version = "1.0", optional = true }
schemars = { version = "1", optional = true }
ring = { version = "0.17", optional = true }
chacha20poly1305 = { version = "0.11", default-features = false, features = ["alloc"], optional = true }

[dev-dependencies]
tokio-tungstenite = { version = "0.30", features = ["connect"] }
futures-util = "0.3"
# password hashing for the taskboard example
argon2 = "0.6"
# pooled HTTP client for the gateway example
hyper-util = { version = "0.1.21", features = ["client-legacy", "http1", "tokio"] }
# certificates for the TLS tests and the secure_api example
rcgen = { version = "0.14", default-features = false, features = ["crypto", "pem", "ring"] }
# HMAC signatures for the webhooks example
hmac = "0.13"
sha2 = "0.11"
# markdown for the blog example
pulldown-cmark = { version = "0.13", default-features = false, features = ["html"] }
criterion = { version = "0.8", features = ["async_tokio"] }
chrono = { version = "0.4.45", default-features = false, features = ["clock"] }

[[bench]]
name = "router_benchmark"
harness = false

[[bench]]
name = "http_benchmark"
harness = false

[[bench]]
name = "middleware_benchmark"
harness = false

[lib]
name = "ullun"
path = "src/lib.rs"

[[example]]
name = "hello_world"
path = "examples/hello_world.rs"

[[example]]
name = "full_api"
path = "examples/full_api.rs"

[[example]]
name = "todo_api"
path = "examples/todo_api.rs"

[[example]]
name = "jwt_auth"
path = "examples/jwt_auth.rs"
required-features = ["jwt"]

[[example]]
name = "realtime_chat"
path = "examples/realtime_chat.rs"
required-features = ["websocket"]

[[example]]
name = "templates_site"
path = "examples/templates_site.rs"
required-features = ["compression"]

[[example]]
name = "taskboard"
path = "examples/taskboard/main.rs"
required-features = ["jwt"]

[[example]]
name = "blog"
path = "examples/blog/main.rs"

[[example]]
name = "gateway"
path = "examples/gateway/main.rs"

[[example]]
name = "chat"
path = "examples/chat/main.rs"
required-features = ["websocket", "jwt"]

[[example]]
name = "webhooks"
path = "examples/webhooks/main.rs"

[[example]]
name = "secure_api"
path = "examples/secure_api/main.rs"
required-features = ["tls"]