allframe-core 0.1.21

AllFrame core - complete web framework with HTTP/2 server, REST/GraphQL/gRPC, DI, CQRS
Documentation
[package]
name = "allframe-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
keywords.workspace = true
categories.workspace = true
description = "AllFrame core - complete web framework with HTTP/2 server, REST/GraphQL/gRPC, DI, CQRS"
readme = "README.md"

# docs.rs configuration - build with all features for complete documentation
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# Targets to build documentation for
targets = ["x86_64-unknown-linux-gnu"]

[features]
default = ["di", "openapi", "router", "otel", "health"]

# Core features
di = ["allframe-macros"]
openapi = []
health = ["hyper", "hyper-util"]
otel = ["allframe-macros", "tracing"]
otel-otlp = [
    "otel",
    "opentelemetry",
    "opentelemetry_sdk",
    "opentelemetry-otlp",
    "tracing-opentelemetry",
    "tracing-subscriber",
]

# Router features
router = []
router-graphql = ["router", "async-graphql", "async-graphql-parser"]
router-grpc = [
    "router",
    "tonic",
    "tonic-reflection",
    "tonic-health",
    "prost",
    "prost-types",
    "tonic-build",
    "tokio-stream",
    "futures",
]
router-full = ["router-graphql", "router-grpc"]

# TLS features for gRPC (enables tonic TLS with rustls-ring)
router-grpc-tls = [
    "router-grpc",
    "tonic/tls-ring",
    "tonic/tls-native-roots",
    "rustls-pemfile",
    "tokio-rustls",
]

# HTTP Client (re-exports reqwest for downstream use)
http-client = ["reqwest"]

# Metrics (Prometheus metrics)
metrics = ["prometheus"]

# Caching infrastructure
cache-memory = ["moka", "dashmap"]
cache-redis = ["redis"]

# Rate limiting (basic governor re-export)
rate-limit = ["governor"]

# Resilience (comprehensive retry, circuit breaker, rate limiting)
resilience = ["allframe-macros", "backoff", "governor", "dashmap", "parking_lot", "rand"]

# Resilience with Redis backend for distributed rate limiting
resilience-redis = ["resilience", "redis"]

# Security utilities
security = ["allframe-macros", "url"]

# Authentication (layered approach)
auth = []  # Core traits only, no deps
auth-jwt = ["auth", "jsonwebtoken", "chrono"]  # JWT validation
auth-axum = ["auth", "tower", "hyper"]  # Axum extractors (uses existing hyper)
auth-tonic = ["auth", "router-grpc"]  # gRPC interceptors (uses existing tonic)

# Utilities bundle
utils = ["chrono", "url", "parking_lot", "rand"]

# CQRS + Event Sourcing features (optional, not in default)
cqrs = ["allframe-macros"]

# AllSource Core integration (production event store)
cqrs-allsource = ["cqrs", "allsource-core", "chrono"]
# DEPRECATED: AllSource v0.10.3 deprecated the postgres feature in favor of
# WAL-backed event-sourced repositories. Use cqrs-allsource instead.
# This feature flag will be removed in a future release.
cqrs-postgres = ["cqrs-allsource", "allsource-core/postgres"]
cqrs-rocksdb = ["cqrs-allsource", "allsource-core/rocksdb-storage"]
cqrs-sqlite = ["cqrs", "rusqlite"]
offline = ["cqrs", "cqrs-sqlite", "di", "security"]

# AllSource search features (optional, requires cqrs-allsource)
vector-search = ["cqrs-allsource", "allsource-core/vector-search"]
keyword-search = ["cqrs-allsource", "allsource-core/keyword-search"]

# Legacy alias (deprecated, use router-grpc-tls)
grpc-tls = ["router-grpc-tls"]

[dependencies]

# Optional features - uses workspace version for consistency
allframe-macros = { workspace = true, optional = true }

# AllSource Core for CQRS + Event Sourcing
allsource-core = { version = "0.10.3", optional = true, default-features = false }

# GraphQL support (production-ready)
async-graphql = { version = "7.0", optional = true }
async-graphql-parser = { version = "7.0", optional = true }
async-trait = { workspace = true }

# Resilience (resilience feature)
backoff = { version = "0.4", optional = true, features = ["tokio"] }

# Utilities (utils feature)
chrono = { version = "0.4", optional = true, features = ["serde"] }
dashmap = { version = "6.0", optional = true }
futures = { version = "0.3", optional = true }
futures-core = "0.3"

# Rate limiting (rate-limit feature)
governor = { version = "0.6", optional = true }
hyper = { workspace = true, optional = true }
hyper-util = { version = "0.1", features = ["tokio", "server-auto"], optional = true }

# Authentication (auth-jwt feature)
jsonwebtoken = { version = "9.3", optional = true }

# Caching (cache-memory, cache-redis features)
moka = { version = "0.12", optional = true, features = ["future"] }

# OpenTelemetry support
opentelemetry = { version = "0.27", optional = true }
opentelemetry-otlp = { version = "0.27", optional = true, features = ["tonic"] }
opentelemetry_sdk = { version = "0.27", optional = true, features = ["rt-tokio"] }
parking_lot = { version = "0.12", optional = true }

# Metrics (metrics feature)
prometheus = { version = "0.13", optional = true }
prost = { version = "0.14", optional = true }
prost-types = { version = "0.14", optional = true }
rand = { version = "0.8", optional = true }
redis = { version = "0.27", optional = true, features = ["tokio-comp", "connection-manager"] }

# HTTP Client (http-client feature)
reqwest = { version = "0.12", optional = true, default-features = false, features = ["json", "rustls-tls"] }
rusqlite = { workspace = true, optional = true }

# TLS support
rustls-pemfile = { version = "2.0", optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-rustls = { version = "0.26", optional = true }
tokio-stream = { version = "0.1", optional = true }
tokio-util = { version = "0.7", features = ["rt"] }
toml = { version = "0.8" }

# gRPC/Protobuf support (production-ready)
tonic = { version = "0.14", optional = true, features = ["transport", "codegen"] }
tonic-health = { version = "0.14", optional = true }
tonic-reflection = { version = "0.14", optional = true }

# HTTP middleware (auth-axum feature)
tower = { version = "0.5", optional = true }
tracing = { version = "0.1", optional = true }
tracing-opentelemetry = { version = "0.28", optional = true }
tracing-subscriber = { version = "0.3", optional = true, features = ["env-filter", "json"] }
url = { version = "2.5", optional = true }

[build-dependencies]
tonic-build = { version = "0.14", optional = true }

[dev-dependencies]
mockall = { workspace = true }
proptest = { workspace = true }
tokio-stream = "0.1"