Skip to content

feat: implement R2 storage foundation #103

Closed
@nullcoder

Description

@nullcoder

Overview

Implement the foundational R2 storage client wrapper for GhostPaste, providing type-safe operations for storing and retrieving encrypted gists in Cloudflare R2.

Tasks

  • Create R2 client wrapper using Cloudflare Workers R2 bindings
  • Configure R2 bucket binding in wrangler.toml
  • Create type-safe wrapper for R2 operations
  • Handle R2 errors (R2Error, R2ObjectNotFound)
  • Write unit tests for R2 client wrapper
  • Document R2 configuration requirements

Technical Requirements

  • Must work with Cloudflare Workers R2 bindings
  • Type-safe operations for put, get, delete, list
  • Proper error handling with custom error types
  • Edge runtime compatible
  • Support for both JSON metadata and binary blobs

Acceptance Criteria

  • R2 client can be imported and used in API routes
  • Type-safe operations for all R2 methods
  • Comprehensive error handling
  • Configuration works in both dev and production
  • Unit tests pass with 100% coverage

Dependencies

  • None (foundational component)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI endpoints and backend logicenhancementNew feature or requestpriority: criticalMust be done immediately

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions