content: [package]
  name = "opa-wasm"
  version = "0.1.7"
  description = "A crate to use OPA policies compiled to WASM."
  repository = "https://github.com/matrix-org/rust-opa-wasm"
  rust-version = "1.76"
  authors = ["Quentin Gliech <quenting@element.io>"]
  edition = "2021"
  license = "Apache-2.0"
  default-run = "opa-eval"
  
  [dependencies]
  anyhow = "1"
  serde = { version = "1", features = ["derive"] }
  serde_json = "1.0.18" # This is the earliest version which supports 128-bit integers
  thiserror = ">=1, <3"
  tokio = { version = "1.5", features = ["sync", "macros"] }
  tracing = "0.1.27"
  wasmtime = { version = ">=22, <36", default-features = false, features = [
      "async",
  ] }
  
  # Loader
  tokio-tar = { version = "0.3", optional = true }
  async-compression = { version = "0.4", optional = true, features = [
      "tokio",
      "gzip",
  ] }
  futures-util = { version = "0.3", optional = true }
  
  # CLI
  camino = { version = "1", optional = true }
  clap = { version = "4", features = ["derive"], optional = true }
  tracing-forest = { version = "0.1.4", optional = true }
  tracing-subscriber = { version = "0.3", features = [
      "env-filter",
  ], optional = true }
  
  # Builtins
  base64 = { version = "0.22", optional = true }
  digest = { version = "0.10", optional = true }
  hex = { version = "0.4", optional = true }
  hmac = { version = "0.12", optional = true }
  json-patch = { version = ">=0.2.3, <4.1.0", optional = true, default-features = false }
  md-5 = { version = "0.10", optional = true }
  rand = { version = "0.8", optional = true }
  semver = { version = "1", optional = true }
  sha1 = { version = "0.10", optional = true }
  sha2 = { version = "0.10", optional = true }
  sprintf = { version = ">=0.3, <0.5", optional = true }
  parse-size = { version = "1", features = ["std"], optional = true }
  serde_yaml = { version = "0.9.1", optional = true }
  form_urlencoded = { version = "1", optional = true }
  urlencoding = { version = "2", optional = true }
  chrono = { version = "0.4.31", optional = true, default-features = false, features = [
      "std",
      "clock",
  ] }
  chrono-tz = { version = ">=0.6, <0.11.0", optional = true }
  chronoutil = { version = "0.2", optional = true }
  duration-str = { version = ">=0.11, <0.16", optional = true, default-features = false }
  
  [dev-dependencies.tokio]
  version = "1.5"
  features = ["macros", "fs", "rt", "rt-multi-thread"]
  
  [dev-dependencies]
  wasmtime = { version = ">=22, <36", default-features = false, features = [
      "cranelift",
  ] }
  insta = { version = "1", features = ["yaml"] }
  
  [build-dependencies]
  # We would like at least this version of rayon, because older versions depend on old rand,
  # which depends on old log, which depends on old libc, which doesn't build with newer rustc
  rayon = "^1.6"
  
  # wasmtime fails to resolve to its minimal version without this
  version_check = "^0.9.4"
  
  [features]
  default = ["all-builtins", "fast"]
  
  loader = [
      "dep:tokio-tar",
      "dep:async-compression",
      "dep:futures-util",
      "tokio/fs",
      "tokio/io-util",
  ]
  
  cli = [
      "loader",
      "fast",
      "dep:camino",
      "dep:clap",
      "dep:tracing-forest",
      "dep:tracing-subscriber",
      "tokio/fs",
      "tokio/rt-multi-thread",
  ]
  fast = ["wasmtime/cranelift", "wasmtime/parallel-compilation"]
  
  rng = ["dep:rand"]
  time = ["dep:chrono"]
  
  base64url-builtins = ["dep:base64", "dep:hex"]
  crypto-digest-builtins = ["dep:digest", "dep:hex"]
  crypto-hmac-builtins = ["dep:hmac", "dep:hex"]
  crypto-md5-builtins = ["dep:md-5"]
  crypto-sha1-builtins = ["dep:sha1"]
  crypto-sha2-builtins = ["dep:sha2"]
  hex-builtins = ["dep:hex"]
  semver-builtins = ["dep:semver"]
  sprintf-builtins = ["dep:sprintf"]
  json-builtins = ["dep:json-patch"]
  units-builtins = ["dep:parse-size"]
  rand-builtins = ["rng"]
  yaml-builtins = ["dep:serde_yaml"]
  urlquery-builtins = ["dep:form_urlencoded", "dep:urlencoding"]
  time-builtins = ["time", "dep:chrono-tz", "dep:duration-str", "dep:chronoutil"]
  
  all-crypto-builtins = [
      "crypto-digest-builtins",
      "crypto-hmac-builtins",
      "crypto-md5-builtins",
      "crypto-sha1-builtins",
      "crypto-sha2-builtins",
  ]
  
  all-builtins = [
      "all-crypto-builtins",
      "base64url-builtins",
      "hex-builtins",
      "json-builtins",
      "rand-builtins",
      "semver-builtins",
      "sprintf-builtins",
      "units-builtins",
      "yaml-builtins",
      "urlquery-builtins",
      "time-builtins",
  ]
  
  [[test]]
  name = "smoke_test"
  required-features = ["loader"]
  
  [[bin]]
  name = "opa-eval"
  required-features = ["cli"]
  
  [[bin]]
  name = "simple"
  required-features = ["cli"]
  