# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

[package]
categories = ["filesystem"]
description = "Apache OpenDAL™: One Layer, All Storage."
exclude = ["/tests/"]
keywords = ["storage", "fs", "s3", "azblob", "gcs"]
name = "opendal-core"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

[lints.clippy]
unused_async = "warn"

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

[features]
default = ["reqwest-rustls-tls", "executors-tokio"]

# Enable reqwest rustls tls support.
reqwest-rustls-tls = ["reqwest/rustls"]

# Enable reqwest rustls tls support without selecting a crypto provider.
# The downstream binary is responsible for installing a `rustls`
# `CryptoProvider` (e.g. `ring` or `aws-lc-rs`) before issuing requests.
reqwest-rustls-no-provider-tls = ["reqwest/rustls-no-provider"]

# Enable opendal's blocking support.
blocking = ["internal-tokio-rt"]

# Enable path cache.
# This is an internal feature, and should not be used by users.
internal-path-cache = ["dep:moka"]
# Enable tokio runtime.
internal-tokio-rt = ["tokio/rt-multi-thread"]

# Enable tokio executors support.
executors-tokio = ["tokio/rt"]

# Deprecated: memory service is always enabled.
services-memory = []

[lib]
bench = false
doctest = false

[dependencies]
# Required dependencies
anyhow = { version = "1.0.100", features = ["std"] }
base64 = { workspace = true }
bytes = { workspace = true }
futures = { workspace = true, features = ["std", "async-await"] }
http = { workspace = true }
http-body = "1"
jiff = { version = "0.2.17", features = ["serde"] }
log = { workspace = true }
md-5 = "0.11.0"
mea = { workspace = true }
percent-encoding = "2"
quick-xml = { workspace = true, features = ["serialize", "overlapped-lists"] }
reqsign-core = { version = "3.0.0", default-features = false }
reqwest = { version = "0.13.2", features = [
  "stream",
], default-features = false }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["macros", "io-util"] }
url = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4"] }

# Optional dependencies
moka = { version = "0.12", optional = true, features = ["sync"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
jiff = { version = "0.2.15", features = ["serde", "js"] }
tokio = { workspace = true, features = ["time"] }
uuid = { workspace = true, features = ["serde", "v4", "js"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
web-time = { version = "1.1.0" }

[dev-dependencies]
logforth = { workspace = true }
pretty_assertions = "1"
rand = { workspace = true }
sha2 = { workspace = true }
tokio = { workspace = true, features = ["fs", "macros", "rt-multi-thread"] }
