[package]
name = "oracledb-protocol"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/oracledb-protocol"
description = "Sans-I/O Oracle TNS/TTC protocol core for the oracledb crate."
keywords = ["oracle", "database", "protocol", "tns", "ttc"]
categories = ["database", "network-programming"]
# Internal protocol crate; the user-facing docs live on the `oracledb` crate.
readme = false
# Keep the published tarball lean. The golden/ wire-trace corpus and the fuzz
# sub-crate are sizable dev-time assets not needed to build or use the crate.
exclude = [
    "tests/",
    "fuzz/",
    "proptest-regressions/",
]

[features]
default = []
# Enables the cwallet.sso (SSO auto-login wallet) reader. Off by default: the
# format is a proprietary Oracle container and only the AES/PBES2 branch is
# implemented; ewallet.pem is fully supported without this feature.
experimental = ["dep:cbc", "dep:der", "dep:hmac"]
# Enables the `.tns-cassette` record/replay wire format (net::cassette). Pure,
# sans-I/O framing; off by default so the standard build is byte-identical.
cassette = []
# Routes the borrowed VARCHAR/CHAR UTF-8 validation in the hot fetch decode path
# (parse_column_slot) through the SIMD-accelerated `simdutf8` crate instead of
# `core::str::from_utf8`. IDENTICAL accept/reject semantics (the TextRaw fallback
# on invalid UTF-8 is unchanged); `simdutf8`'s unsafe lives entirely inside that
# dependency, so this crate stays `#![forbid(unsafe_code)]`-clean. Off by default:
# the microbench (benches/utf8_validate.rs) shows the win is meaningful only for
# wide text (VARCHAR2(2000)+); short VARCHAR2(40) cells see little to no gain.
simd-decode = ["dep:simdutf8"]

[dependencies]
aes.workspace = true
hex.workspace = true
md-5.workspace = true
pbkdf2.workspace = true
rand.workspace = true
rustls-pemfile.workspace = true
serde.workspace = true
sha1.workspace = true
sha2.workspace = true
thiserror.workspace = true
# Experimental cwallet.sso reader deps (gated by the `experimental` feature).
cbc = { workspace = true, optional = true }
der = { workspace = true, optional = true }
hmac = { workspace = true, optional = true }
# SIMD-accelerated UTF-8 validation for the borrowed fetch text path (gated by
# the `simd-decode` feature). Its `unsafe` SIMD intrinsics are encapsulated
# inside the crate; we only call its safe `basic::from_utf8` API, so this crate
# stays `#![forbid(unsafe_code)]`-clean.
simdutf8 = { version = "0.1.5", optional = true }

[dev-dependencies]
proptest.workspace = true
serde_json.workspace = true
x509-cert.workspace = true
pkcs8 = "0.10"
# Allocation counting for the borrowed-fetch perf test. Including it installs a
# tracking global allocator (its unsafe lives inside that crate, so our code and
# the whole workspace stay `#![forbid(unsafe_code)]`-clean). dev-dependency only:
# it never affects the shipped library or any dependent crate.
allocation-counter = "0.8"
# Microbenchmark harness for the UTF-8 validation decode-path bench
# (benches/utf8_validate.rs). Dev-only; never ships in the library.
criterion = { version = "0.5", default-features = false, features = ["cargo_bench_support"] }

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

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

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

[lints]
workspace = true
