# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.89"
name = "lastid-sdk"
version = "0.3.0"
authors = ["LastID Team <team@lastid.co>"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Rust SDK for LastID IDP integration - request and verify credentials with type-safe policy builders"
homepage = "https://lastid.co"
documentation = "https://docs.rs/lastid-sdk"
readme = "README.md"
keywords = [
    "did",
    "sdjwt",
    "dpop",
    "oid4vci",
    "credentials",
]
categories = [
    "authentication",
    "cryptography",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/GetTrustedApp/lastid-rust-sdk"

[features]
age-proof-policy = []
base-policy = []
default = ["base-policy"]
employment-policy = []
full = [
    "base-policy",
    "persona-policy",
    "verified-email-policy",
    "verified-phone-policy",
    "verified-persona-policy",
    "employment-policy",
    "trust-policy",
    "age-proof-policy",
    "tracing",
]
json-schema = ["dep:schemars"]
keypair-serialization = []
napi = [
    "dep:napi",
    "dep:napi-derive",
    "dep:napi-build",
    "base-policy",
    "persona-policy",
    "verified-email-policy",
    "verified-phone-policy",
    "verified-persona-policy",
    "employment-policy",
    "trust-policy",
    "age-proof-policy",
    "websocket",
]
persona-policy = []
test-utils = ["dep:wiremock"]
tracing = ["dep:tracing"]
trust-policy = []
verified-email-policy = []
verified-persona-policy = []
verified-phone-policy = []
wasm = [
    "dep:wasm-bindgen",
    "dep:wasm-bindgen-futures",
    "dep:web-sys",
    "dep:js-sys",
    "dep:gloo-storage",
    "dep:serde-wasm-bindgen",
    "dep:console_error_panic_hook",
]
websocket = [
    "dep:futures-util",
    "dep:tokio-tungstenite",
]

[lib]
name = "lastid_sdk"
crate-type = [
    "cdylib",
    "rlib",
]
path = "src/lib.rs"

[[example]]
name = "age_verification"
path = "examples/age_verification.rs"
required-features = ["age-proof-policy"]

[[example]]
name = "base_credential"
path = "examples/base_credential.rs"
required-features = ["base-policy"]

[[example]]
name = "config_loading"
path = "examples/config_loading.rs"
required-features = []

[[example]]
name = "employment_verification"
path = "examples/employment_verification.rs"
required-features = ["employment-policy"]

[[example]]
name = "enterprise_domain_filter"
path = "examples/enterprise_domain_filter.rs"
required-features = ["employment-policy"]

[[example]]
name = "multi_credential_chain"
path = "examples/multi_credential_chain.rs"
required-features = ["persona-policy"]

[[example]]
name = "persona_credential"
path = "examples/persona_credential.rs"
required-features = ["persona-policy"]

[[example]]
name = "poll_and_verify"
path = "examples/poll_and_verify.rs"
required-features = ["base-policy"]

[[example]]
name = "subject_binding"
path = "examples/subject_binding.rs"
required-features = ["persona-policy"]

[[example]]
name = "trust_credential"
path = "examples/trust_credential.rs"
required-features = ["trust-policy"]

[[example]]
name = "typed_response_parsing"
path = "examples/typed_response_parsing.rs"
required-features = ["persona-policy"]

[[example]]
name = "verified_email_credential"
path = "examples/verified_email_credential.rs"
required-features = ["verified-email-policy"]

[[test]]
name = "integration_tests"
path = "tests/integration_tests.rs"

[dependencies.async-trait]
version = "0.1"

[dependencies.base64]
version = "0.22"

[dependencies.chrono]
version = "0.4"
features = ["serde"]

[dependencies.console_error_panic_hook]
version = "0.1"
optional = true

[dependencies.dirs]
version = "5"

[dependencies.futures-util]
version = "0.3"
optional = true

[dependencies.gloo-storage]
version = "0.3"
optional = true

[dependencies.js-sys]
version = "0.3"
optional = true

[dependencies.mini-moka]
version = "0.10"
optional = true

[dependencies.napi]
version = "2"
features = [
    "async",
    "serde-json",
    "tokio_rt",
]
optional = true

[dependencies.napi-derive]
version = "2"
optional = true

[dependencies.p256]
version = "0.13"
features = [
    "ecdsa",
    "jwk",
    "pem",
]

[dependencies.rand]
version = "0.8"

[dependencies.regex]
version = "1.10"

[dependencies.schemars]
version = "0.8"
optional = true

[dependencies.secrecy]
version = "0.10"
features = ["serde"]

[dependencies.serde]
version = "1.0"
features = ["derive"]

[dependencies.serde-wasm-bindgen]
version = "0.6"
optional = true

[dependencies.serde_json]
version = "1.0"

[dependencies.sha2]
version = "0.10"

[dependencies.thiserror]
version = "1.0"

[dependencies.toml]
version = "0.8"

[dependencies.tracing]
version = "0.1"
optional = true

[dependencies.urlencoding]
version = "2.1"

[dependencies.uuid]
version = "1"
features = [
    "v4",
    "js",
]

[dependencies.wasm-bindgen]
version = "0.2"
optional = true

[dependencies.wasm-bindgen-futures]
version = "0.4"
optional = true

[dependencies.web-sys]
version = "0.3"
features = [
    "Window",
    "Storage",
    "WebSocket",
    "MessageEvent",
    "CloseEvent",
    "ErrorEvent",
    "BinaryType",
]
optional = true

[dependencies.wiremock]
version = "0.5"
optional = true

[dependencies.zeroize]
version = "1.8"
features = ["derive"]

[dev-dependencies.ts-rs]
version = "11"
features = [
    "serde-compat",
    "serde-json-impl",
]

[dev-dependencies.wasm-bindgen-test]
version = "0.3"

[build-dependencies.napi-build]
version = "2"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.mini-moka]
version = "0.10"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.parking_lot]
version = "0.12"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "rustls-tls",
]
default-features = false

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
version = "1"
features = [
    "rt",
    "sync",
    "time",
    "macros",
]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio-tungstenite]
version = "0.24"
features = ["rustls-tls-webpki-roots"]
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.proptest]
version = "1"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tempfile]
version = "3"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tokio]
version = "1"
features = [
    "full",
    "test-util",
]

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tokio-test]
version = "0.4"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tracing-subscriber]
version = "0.3.22"
features = ["env-filter"]

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.wiremock]
version = "0.5"

[target.'cfg(target_arch = "wasm32")'.dependencies.futures-channel]
version = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2"
features = ["js"]

[target.'cfg(target_arch = "wasm32")'.dependencies.gloo-timers]
version = "0.3"
features = ["futures"]

[target.'cfg(target_arch = "wasm32")'.dependencies.micro-moka]
version = "0.1"

[target.'cfg(target_arch = "wasm32")'.dependencies.reqwest]
version = "0.12"
features = ["json"]
default-features = false

[lints.clippy]
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
multiple_crate_versions = "allow"
must_use_candidate = "allow"
too_many_lines = "allow"

[lints.clippy.all]
level = "warn"
priority = -1

[lints.clippy.cargo]
level = "warn"
priority = -1

[lints.clippy.nursery]
level = "warn"
priority = -1

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.rust]
unsafe_code = "forbid"

[profile.dev]
incremental = true

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"

[profile.wasm-release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
inherits = "release"
