diff --git a/.github/workflows/object_store.yml b/.github/workflows/object_store.yml index 3b9b1e31d5c3..c28f8037a307 100644 --- a/.github/workflows/object_store.yml +++ b/.github/workflows/object_store.yml @@ -60,6 +60,8 @@ jobs: run: cargo clippy --features gcp -- -D warnings - name: Run clippy with azure feature run: cargo clippy --features azure -- -D warnings + - name: Run clippy with http feature + run: cargo clippy --features http -- -D warnings - name: Run clippy with all features run: cargo clippy --all-features -- -D warnings - name: Run clippy with all features and all targets diff --git a/object_store/README.md b/object_store/README.md index 5b47a65c124f..fd09ec7205af 100644 --- a/object_store/README.md +++ b/object_store/README.md @@ -39,7 +39,7 @@ See [docs.rs](https://docs.rs/object_store) for usage instructions ## Support for `wasm32-unknown-unknown` target -It's possible to build `object_store` for the `wasm32-unknown-unknown` target, however the cloud storage features `aws`, `azure`, and `gcp` are not supported. +It's possible to build `object_store` for the `wasm32-unknown-unknown` target, however the cloud storage features `aws`, `azure`, `gcp`, and `http` are not supported. ``` cargo build -p object_store --target wasm32-unknown-unknown diff --git a/object_store/src/client/mod.rs b/object_store/src/client/mod.rs index d4995a5b143f..77b14a7587d7 100644 --- a/object_store/src/client/mod.rs +++ b/object_store/src/client/mod.rs @@ -18,6 +18,7 @@ //! Generic utilities reqwest based ObjectStore implementations pub mod backoff; + #[cfg(test)] pub mod mock_server; @@ -35,7 +36,6 @@ pub mod list; #[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))] pub mod token; -#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))] pub mod header; #[cfg(any(feature = "aws", feature = "gcp"))] @@ -575,6 +575,7 @@ pub struct StaticCredentialProvider { } impl StaticCredentialProvider { + /// A [`CredentialProvider`] for a static credential of type `T` pub fn new(credential: T) -> Self { Self { credential: Arc::new(credential), diff --git a/object_store/src/lib.rs b/object_store/src/lib.rs index 413b40039553..8d96ccf1dfc3 100644 --- a/object_store/src/lib.rs +++ b/object_store/src/lib.rs @@ -240,9 +240,9 @@ #[cfg(all( target_arch = "wasm32", - any(feature = "gcp", feature = "aws", feature = "azure",) + any(feature = "gcp", feature = "aws", feature = "azure", feature = "http") ))] -compile_error!("Features 'gcp', 'aws', 'azure' are not supported on wasm."); +compile_error!("Features 'gcp', 'aws', 'azure', 'http' are not supported on wasm."); #[cfg(feature = "aws")] pub mod aws; @@ -263,13 +263,16 @@ pub mod path; pub mod prefix; pub mod throttle; -#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = "http"))] +#[cfg(feature = "cloud")] mod client; -#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = "http"))] -pub use client::{backoff::BackoffConfig, retry::RetryConfig, CredentialProvider}; +#[cfg(feature = "cloud")] +pub use client::{ + backoff::BackoffConfig, retry::RetryConfig, ClientConfigKey, ClientOptions, + CredentialProvider, StaticCredentialProvider, +}; -#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = "http"))] +#[cfg(feature = "cloud")] mod config; #[cfg(feature = "cloud")] @@ -295,9 +298,6 @@ use std::ops::Range; use std::sync::Arc; use tokio::io::AsyncWrite; -#[cfg(any(feature = "azure", feature = "aws", feature = "gcp", feature = "http"))] -pub use client::{ClientConfigKey, ClientOptions}; - /// An alias for a dynamically dispatched object store implementation. pub type DynObjectStore = dyn ObjectStore; diff --git a/object_store/src/parse.rs b/object_store/src/parse.rs index 7b89e58e10e7..1159e9a1af17 100644 --- a/object_store/src/parse.rs +++ b/object_store/src/parse.rs @@ -104,7 +104,7 @@ impl ObjectStoreScheme { } } -#[cfg(any(feature = "aws", feature = "gcp", feature = "azure", feature = "http"))] +#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))] macro_rules! builder_opts { ($builder:ty, $url:expr, $options:expr) => {{ let builder = $options.into_iter().fold(