# 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 = "2021"
rust-version = "1.89"
name = "cedar-policy"
version = "4.8.2"
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Cedar is a language for defining permissions as policies, which describe who should have access to what."
homepage = "https://cedarpolicy.com"
readme = "README.md"
keywords = [
    "cedar",
    "authorization",
    "policy",
    "security",
]
categories = [
    "compilers",
    "config",
]
license = "Apache-2.0"
repository = "https://github.com/cedar-policy/cedar"

[package.metadata.docs.rs]
features = ["experimental"]
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
corpus-timing = []
datetime = ["cedar-policy-core/datetime"]
decimal = ["cedar-policy-core/decimal"]
default = [
    "ipaddr",
    "decimal",
    "datetime",
]
deprecated-schema-compat = []
entity-manifest = ["cedar-policy-core/entity-manifest"]
experimental = [
    "partial-eval",
    "permissive-validate",
    "partial-validate",
    "entity-manifest",
    "protobufs",
    "tolerant-ast",
    "extended-schema",
    "deprecated-schema-compat",
    "tpe",
    "variadic-is-in-range",
]
extended-schema = ["cedar-policy-core/extended-schema"]
heap-profiling = ["dep:dhat"]
ipaddr = ["cedar-policy-core/ipaddr"]
partial-eval = ["cedar-policy-core/partial-eval"]
partial-validate = ["cedar-policy-core/partial-validate"]
permissive-validate = []
protobufs = [
    "dep:nonempty",
    "dep:prost",
    "dep:prost-build",
]
tolerant-ast = [
    "cedar-policy-core/tolerant-ast",
    "cedar-policy-formatter/tolerant-ast",
]
tpe = ["cedar-policy-core/tpe"]
variadic-is-in-range = ["cedar-policy-core/variadic-is-in-range"]
wasm = [
    "tsify",
    "wasm-bindgen",
]

[lib]
name = "cedar_policy"
path = "src/lib.rs"

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

[[bench]]
name = "attr_errors"
path = "benches/attr_errors.rs"
harness = false

[[bench]]
name = "cedar_benchmarks"
path = "benches/cedar_benchmarks.rs"
harness = false

[[bench]]
name = "deeply_nested_est"
path = "benches/deeply_nested_est.rs"
harness = false

[[bench]]
name = "entity_attr_errors"
path = "benches/entity_attr_errors.rs"
harness = false

[[bench]]
name = "entity_parsing"
path = "benches/entity_parsing.rs"
harness = false

[[bench]]
name = "extension_fn_validation"
path = "benches/extension_fn_validation.rs"
harness = false

[dependencies.cedar-policy-core]
version = "=4.8.2"

[dependencies.cedar-policy-formatter]
version = "=4.8.2"

[dependencies.dhat]
version = "0.3.2"
optional = true

[dependencies.itertools]
version = "0.14"

[dependencies.linked-hash-map]
version = "0.5.6"
features = ["serde_impl"]

[dependencies.miette]
version = "7.6.0"

[dependencies.nonempty]
version = "0.12"
optional = true

[dependencies.prost]
version = "0.14"
optional = true

[dependencies.ref-cast]
version = "1.0"

[dependencies.semver]
version = "1.0.27"

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

[dependencies.serde_json]
version = "1.0"

[dependencies.serde_with]
version = "3.16.1"

[dependencies.smol_str]
version = "0.3"
features = ["serde"]

[dependencies.thiserror]
version = "2.0"

[dependencies.tsify]
version = "0.4.5"
optional = true

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

[dev-dependencies.cedar-policy-core]
version = "=4.8.2"
features = ["test-util"]

[dev-dependencies.cool_asserts]
version = "2.0"

[dev-dependencies.criterion]
version = "0.8"

[dev-dependencies.globset]
version = "0.4"

[dev-dependencies.miette]
version = "7.6.0"
features = ["fancy"]

[dev-dependencies.oorandom]
version = "11.1"

[dev-dependencies.proptest]
version = "1.9.0"

[dev-dependencies.similar-asserts]
version = "1.7.0"

[build-dependencies.prost-build]
version = "0.14"
optional = true

[lints.clippy]
cast_lossless = "warn"
cast_possible_truncation = "warn"
cloned_instead_of_copied = "warn"
expect_used = "deny"
fallible_impl_from = "deny"
format_collect = "warn"
format_push_string = "warn"
implicit_clone = "warn"
inconsistent_struct_constructor = "warn"
indexing_slicing = "deny"
inefficient_to_string = "warn"
large_enum_variant = "allow"
large_types_passed_by_value = "warn"
missing_const_for_fn = "allow"
needless_doctest_main = "allow"
needless_pass_by_value = "warn"
option_as_ref_cloned = "warn"
option_if_let_else = "allow"
option_option = "warn"
panic = "deny"
redundant_clone = "deny"
redundant_pub_crate = "allow"
ref_option = "warn"
ref_option_ref = "warn"
result_large_err = "allow"
todo = "deny"
too_long_first_doc_paragraph = "allow"
trivially_copy_pass_by_ref = "warn"
unimplemented = "deny"
unreachable = "deny"
unwrap_used = "deny"
use_self = "allow"

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

[lints.rust]
missing_debug_implementations = "deny"
rust-2018-idioms = "deny"
unsafe_code = "forbid"

[lints.rust.unexpected_cfgs]
level = "deny"
priority = 0
check-cfg = [
    "cfg(kani)",
    "cfg(fuzzing)",
]
