Skip to content

Shaswot/cloudlfare native#736

Open
shaswot16 wants to merge 4 commits into
apache:mainfrom
storyvis:shaswot/cloudlfare-native
Open

Shaswot/cloudlfare native#736
shaswot16 wants to merge 4 commits into
apache:mainfrom
storyvis:shaswot/cloudlfare-native

Conversation

@shaswot16
Copy link
Copy Markdown

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:

cloudflare = ["cloud"]
cloudflare-workers = ["worker"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant