[package]
name = "cipherstash-client"
description = "The official CipherStash SDK"
documentation = "https://docs.rs/cipherstash-client"
version = "0.39.0"
license-file = "LICENSE"
edition.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true

[dependencies]
cipherstash-core = { workspace = true }
# `postgres-types` is server-only and pulls a `rand 0.9` chain that doesn't
# build on wasm32. cipherstash-client doesn't use the postgres impls directly.
cllw-ore = { workspace = true, default-features = false, features = ["chrono", "decimal"] }
cts-common = { workspace = true, default-features = false }
recipher = { workspace = true }
zerokms-protocol = { workspace = true }
cipherstash-config = { workspace = true }
stack-auth = { workspace = true }

vitaminc = { workspace = true }
vitaminc-protected = { workspace = true }

anyhow = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
blake3 = { workspace = true }
chrono = { workspace = true }
derive_more = { version = "1.0.0", features = ["display"] }
hex = { workspace = true, features = ["serde"] }
hmac = { workspace = true, features = ["reset"] }
itertools = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
miette = { workspace = true }
percent-encoding = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }
zeroize = { workspace = true }

aes-gcm-siv = "0.11.1"
async-mutex = "1.4.0"
futures = "0.3.25"
opaque-debug = "0.3.1"
orderable-bytes = { version = "0.1.1", features = ["chrono", "decimal"] }
ore-rs = { version = "0.8.3", features = ["chrono", "decimal"]}
winnow = "0.6.26"
rand = "0.8.5"
rust_decimal = "1.28.1"
rust-stemmers = "=1.2.0"
serde_cbor = "0.11.2"
sha2 = "0.10.6"
static_assertions = "1.1.0"
uuid = "1.7.0"
serde_bytes = "0.11.15"
rmp-serde = "1.3.0"
base85 = "2.0.0"
toml = "0.8.19"
serdect = { version = "0.3.0", features = ["zeroize"] }
base16ct = { version = "0.2.0", features = ["alloc"] }
base64ct = { version = "1.7", features = ["alloc"] }

# Native-only:
# - `stack-profile` is the filesystem-backed profile/config layer
# - `dirs` resolves `~/.cipherstash` (wasm has no home dir)
# - Workspace `tokio` carries `features = ["full"]` which pulls `mio` (no wasm32 build)
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
stack-profile = { workspace = true }
dirs = "4.0.0"
tokio = { workspace = true, optional = true }

# Wasm32: strip the workspace `tokio = "full"` inheritance — the `tokio` feature
# of this crate only marks "EQL surface is async" and doesn't itself use any
# tokio runtime / net APIs.
[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { version = "1.47.1", default-features = false, features = ["sync"], optional = true }

[dev-dependencies]
clap = { workspace = true }
cts-common = { workspace = true, features = ["test_utils"] }
lazy_static = { workspace = true }
tokio = { workspace = true }
mock-auth-server = { workspace = true }
stack-auth = { workspace = true, features = ["test-utils"] }

bytes = "1.2.1"
fake = { version = "2.10.0", features = ["derive", "uuid"] }
paste = "1.0.15"
quickcheck = "1.0.3"
rust_decimal_macros = "1.28"
tempfile = "3.21.0"
axum = "0.8"

[features]
default = []
tokio = ["dep:tokio"]
test-utils = ["cts-common/test_utils"]
# Enables HTTP/2 in the reqwest client. ZeroKMS endpoints negotiate h2 via
# ALPN; without it reqwest is HTTP/1.1-only and opens a connection per
# concurrent request, which can exhaust client-side ephemeral ports under
# load. Off by default while we validate it; intended to default-on later.
http2 = ["reqwest/http2"]

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