shaswot16 opened a new pull request, #736:
URL: https://github.com/apache/arrow-rs-object-store/pull/736
# Which issue does this PR close?
Closes #XXX
(Create an issue first if one does not already exist.)
# Rationale for this change
Cloudflare R2 is a widely used object storage service that exposes both an
S3-compatible API and a native Cloudflare REST API. While R2 can already be
accessed through the existing `AmazonS3` backend, a dedicated Cloudflare R2
implementation provides several advantages:
- Simplified authentication using Cloudflare API tokens instead of AWS-style
HMAC credentials
- Native integration with Cloudflare's API ecosystem
- A foundation for Cloudflare Workers R2 bindings and `wasm32` support
- A more intuitive user experience for developers already using Cloudflare
services
This follows the existing pattern of providing dedicated backends for major
cloud providers such as AWS, Azure, and GCP.
# What changes are included in this PR?
### Core Implementation
- Added `CloudflareR2` object store implementation
- Implements `ObjectStore`
- Implements `MultipartStore`
- Implements `PaginatedListStore`
### Builder and Configuration
- Added `CloudflareR2Builder`
- Added `CloudflareConfigKey`
- Added support for:
- Environment-based configuration (`from_env`)
- URL-based configuration
- `r2://` URL scheme parsing
### Authentication
- Added `CloudflareCredential`
- Added static credential provider implementation based on Cloudflare API
tokens
### HTTP Client
- Added Cloudflare REST API v4 client supporting:
- Object upload
- Object download
- Object deletion
- Object copy
- Object listing
- Multipart uploads
### Cloudflare Workers Support
- Added `CloudflareR2Workers`
- Added support for Cloudflare Workers runtimes (`wasm32`)
- Feature-gated behind `cloudflare-workers`
### Library Integration
- Added `ObjectStoreScheme::CloudflareR2`
- Added `r2://` scheme support in URL parsing
- Exported Cloudflare modules behind feature flags
### Cargo Features
Added two new optional features:
```toml
cloudflare = ["cloud"]
cloudflare-workers = ["worker"]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]