# SPDX-FileCopyrightText: 2026 OpenBasil Contributors
#
# SPDX-License-Identifier: Apache-2.0

[package]
name = "basil-core"
description = "Basil daemon core, broker services, transport, and offline admin command implementations."
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
documentation = "https://docs.rs/basil-core"
keywords = ["basil", "vault", "broker", "cryptography", "kms"]
categories = ["cryptography", "network-programming", "authentication"]
rust-version = "1.88"
publish = true

[features]
default = ["http", "unlock-age-yubikey", "unlock-bip39"]
http = ["dep:axum"]

# TEST ONLY: enables integration tests that boot live OpenBao/Vault dev servers.
live-e2e = []
keystore-backend = ["dep:basil-keystore-backend"]
db-keystore = ["keystore-backend", "basil-keystore-backend/db-keystore"]
onepassword = ["keystore-backend", "basil-keystore-backend/onepassword"]
# In-place cloud KMS transit backends. AWS and GCP have large SDKs;
aws-kms = ["dep:aws-config", "dep:aws-sdk-kms"]
gcp-kms = ["dep:google-cloud-kms", "dep:google-cloud-gax"]
unlock-age-yubikey = []
unlock-bip39 = ["dep:bip39"]
unlock-tpm = ["dep:tpm2-protocol"]
tpm2 = ["dep:hex"]
otlp = [
  "dep:opentelemetry_sdk",
  "dep:opentelemetry-otlp",
  "dep:opentelemetry-appender-tracing",
]
http-tls = ["http", "dep:hyper", "dep:hyper-util", "dep:tokio-rustls"]

[dependencies]
basil-proto = { workspace = true }
basil-cose = { workspace = true }
basil-nats = { workspace = true }
basil-keystore-backend = { workspace = true, optional = true }

# Direct dep only to enable `aes/zeroize` (round-key scrubbing) for aes-gcm.
aes = { workspace = true }
aes-gcm = { workspace = true }
aes-kw = { workspace = true }
age = { workspace = true }
anyhow = { workspace = true }
arc-swap = "1.9.2"
argon2 = { workspace = true }
async-trait = { workspace = true }
aws-config = { workspace = true, optional = true }
aws-sdk-kms = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
base64 = { workspace = true, features = ["std"] }
bip39 = { workspace = true, optional = true }
chacha20poly1305 = { workspace = true }
clap = { workspace = true }
ed25519-dalek = { workspace = true }
futures = { workspace = true }
getrandom = { workspace = true }
google-cloud-gax = { workspace = true, optional = true }
google-cloud-kms = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
hkdf = { workspace = true }
hyper = { workspace = true, optional = true }
hyper-util = { workspace = true, optional = true }
jsonwebtoken = { workspace = true }
ml-dsa = { workspace = true }
ml-kem = { workspace = true }
opentelemetry-appender-tracing = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
p256 = { workspace = true, features = ["pem", "pkcs8", "std"] }
p384 = { workspace = true }
p521 = { workspace = true }
percent-encoding = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
rand = { workspace = true }
rand_core = { workspace = true }
reqwest = { workspace = true }
rsa = { workspace = true }
rustix = { workspace = true }
# Not optional: `reqwest` (rustls-no-provider) always pulls rustls, and we must
# install its `ring` crypto provider before building any client (see
# `ensure_crypto_provider`). `http-tls` gates only the server-side tokio-rustls.
rustls = { workspace = true }
serde = { workspace = true, features = ["std"] }
serde_json = { workspace = true, features = ["std"] }
serde_yaml = { workspace = true }
sha2 = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-rustls = { workspace = true, optional = true }
tokio-stream = { workspace = true }
toml = { workspace = true }
tonic = { workspace = true }
tpm2-protocol = { workspace = true, optional = true }
tracing = { workspace = true }
tracing-appender = { workspace = true }
tracing-journald = { workspace = true }
tracing-subscriber = { workspace = true }
url = { workspace = true }
uuid = { workspace = true }
x25519-dalek = { workspace = true }
zero-secrets = { workspace = true }
zeroize = { workspace = true }

[dev-dependencies]
basil = { workspace = true }
basil-cose = { workspace = true, features = ["fixtures"] }
hyper-util = { workspace = true }
minicbor = { workspace = true }
nkeys = { workspace = true }
tower = { workspace = true }

[lints]
workspace = true
