[package]
name = "blueprint-auth"
version = "0.2.0-alpha.5"
description = "Blueprint HTTP/WS Authentication"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
blueprint-std = { workspace = true }
blueprint-core = { workspace = true, features = ["tracing"] }

thiserror = { workspace = true }
tower = { workspace = true, features = ["util"] }
tower-http = { workspace = true, features = ["cors", "request-id", "sensitive-headers", "trace"] }
hashbrown = { workspace = true, default-features = false, features = ["default-hasher", "inline-more"] }
tiny-keccak = { workspace = true, features = ["keccak"] }
tracing = { workspace = true, features = ["attributes"] }
serde = { workspace = true, features = ["derive", "alloc"] }
hex = { workspace = true, features = ["serde", "alloc"] }
base64 = { workspace = true, features = ["alloc"] }
crc32fast = { workspace = true }
subtle = { workspace = true }

k256 = { workspace = true, features = ["ecdsa", "alloc", "serde", "pem"] }
schnorrkel = { workspace = true }
blueprint-crypto = { workspace = true, features = ["bn254"] }
serde_json = { workspace = true }
pasetors = { workspace = true, default-features = false, features = ["v4", "serde_json", "std"] }
uuid = { workspace = true, features = ["v4", "serde"] }
jsonwebtoken = { workspace = true, default-features = false }
pem = { workspace = true, default-features = false }
chacha20poly1305 = { workspace = true, features = ["alloc", "getrandom"] }
time = { workspace = true }

axum = { workspace = true, default-features = false, features = ["json", "form", "http1", "http2", "tokio"] }
hyper-util = { workspace = true, features = ["client", "client-legacy", "tokio", "http2", "server"] }
hyper = { workspace = true, features = ["full"] }
hyper-rustls = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tokio-rustls = { workspace = true, features = ["default"] }
rustls = { workspace = true, features = ["default"] }
rustls-pemfile = { workspace = true, features = ["std"] }
rcgen = { workspace = true, features = ["crypto", "ring", "pem", "x509-parser"] }
once_cell = { workspace = true }
x509-parser = { workspace = true }

# Database
rocksdb = { workspace = true, features = ["lz4"] }
prost = { workspace = true, features = ["derive"] }

# Standalone Binary
tempfile = { workspace = true, optional = true }


[dev-dependencies]
# Note: do NOT add `blueprint-sdk` here. The workspace declares it with both
# a `path` and a `version`, so cargo publish would carry the version
# constraint into this crate's published manifest and then fail to resolve
# `^0.2.0-alpha.X` against crates.io (the umbrella depends on this crate,
# so the umbrella can never be on crates.io before this crate is). If you
# need SDK re-exports in tests, either depend on the underlying sub-crates
# directly or use a path-only override:
#   blueprint-sdk = { path = "../sdk", features = ["std"] }
serde_json = { workspace = true, features = ["alloc"] }
bytes = { workspace = true }
tower = { workspace = true, features = ["util", "timeout", "limit", "load-shed", "steer", "filter", "make"] }
tokio = { workspace = true, features = ["full"] }
axum = { workspace = true, features = ["json", "multipart", "http1", "http2", "tokio"] }
reqwest = { workspace = true, features = ["json", "multipart"] }
futures-util = { workspace = true }
http = { workspace = true }
tempfile = { workspace = true }
tracing-subscriber = { workspace = true, features = ["fmt", "env-filter", "registry"] }
openssl = { workspace = true, features = ["vendored"] }
tokio-stream = { workspace = true }
tonic = { workspace = true, features = ["codegen", "prost", "transport"] }
tokio-rustls = { workspace = true }
rustls = { workspace = true }
rustls-pemfile = { workspace = true }
rcgen = { workspace = true }
hyper-rustls = { workspace = true }

[build-dependencies]
tonic-build = { workspace = true, features = ["prost", "transport"] }
protobuf-src = { workspace = true }

[features]
default = ["std", "tracing"]
std = ["blueprint-std/std", "crc32fast/std", "k256/std", "schnorrkel/std", "base64/std", "prost/std", "blueprint-crypto/std"]
standalone = ["tempfile", "axum/http1", "axum/http2", "axum/tokio"]
tracing = []

[[bin]]
name = "auth-server"
path = "src/main.rs"
required-features = ["standalone"]

[lints]
workspace = true
