Skip to content

Refactor DAV client, add missing operations#70

Open
kathap wants to merge 19 commits intomainfrom
add-missing-operations-for-webdav
Open

Refactor DAV client, add missing operations#70
kathap wants to merge 19 commits intomainfrom
add-missing-operations-for-webdav

Conversation

@kathap
Copy link
Contributor

@kathap kathap commented Mar 13, 2026

Added Missing Operations:

  • COPY - Server-side blob copying via WebDAV COPY method
  • PROPERTIES - Retrieve blob metadata (ContentLength, ETag, LastModified)
  • ENSURE-STORAGE-EXISTS - Initialize WebDAV directory structure
  • SIGN - Generate pre-signed URLs with HMAC-SHA256
  • DELETE-RECURSIVE - Delete all blobs matching a prefix

Structural Changes:

  • Split into two-layer architecture like other providers (S3, Azure, etc.)
    • client.go: High-level DavBlobstore implementing storage.Storager interface
    • storage_client.go: Low-level StorageClient handling HTTP/WebDAV operations

 **Added Missing Operations:**
  - COPY - Server-side blob copying via WebDAV COPY method
  - PROPERTIES - Retrieve blob metadata (ContentLength, ETag, LastModified)
  - ENSURE-STORAGE-EXISTS - Initialize WebDAV directory structure
  - SIGN - Generate pre-signed URLs with HMAC-SHA256
  - DELETE-RECURSIVE - Delete all blobs matching a prefix

  **Structural Changes:**
  - Split into two-layer architecture like other providers (S3, Azure, etc.)
    - client.go: High-level DavBlobstore implementing storage.Storager interface
    - storage_client.go: Low-level StorageClient handling HTTP/WebDAV operations
@kathap kathap force-pushed the add-missing-operations-for-webdav branch 2 times, most recently from 19fa8b5 to a69e251 Compare March 13, 2026 15:54
@kathap kathap force-pushed the add-missing-operations-for-webdav branch from a69e251 to 93b80d1 Compare March 13, 2026 15:57
@github-project-automation github-project-automation bot moved this from Inbox to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Mar 13, 2026
@kathap kathap force-pushed the add-missing-operations-for-webdav branch 3 times, most recently from e6899c3 to 230cd5a Compare March 13, 2026 16:14
@kathap kathap force-pushed the add-missing-operations-for-webdav branch from 230cd5a to cc66878 Compare March 13, 2026 16:17
@kathap kathap force-pushed the add-missing-operations-for-webdav branch from 4e7c568 to 9a45943 Compare March 16, 2026 15:13
kathap added 5 commits March 25, 2026 10:47
Extend WebDAV signer to support both BOSH-compatible SHA256 HMAC
signing and CAPI-compatible MD5 signing via optional signing_method
config field.

  - Add SigningMethod field to config (default: "sha256")
  - Implement generateSHA256SignedURL() for BOSH (/signed/ paths)
  - Implement generateMD5SignedURL() for CAPI (/read/, /write/ paths)
  - Add HEAD verb support
  - Improve WebDAV compatibility with PROPFIND
  - Simplify blob path handling for CCNG pre-partitioned IDs
  - Add comprehensive tests for both signing methods
  1. Simple blob IDs (like my-blob) get stored with hash-prefix directory structure (8c/my-blob)
  2. Pre-partitioned blob IDs (like ru/by/ruby-buildpack from CCNG) are stored as-is
  3. Both PUT and COPY operations correctly create parent directories by using the built path (with hash prefix) when calling ensureObjectParentsExist
  Preserve endpoint base paths when constructing signed URLs to ensure
  directory keys (cc-droplets, cc-packages, etc.) are included in the
  final URL path. The signer now combines:
    - Path prefix (/signed/, /read/, or /write/)
    - Endpoint base path (directory key from config)
    - Blob ID with hash prefix

  This ensures storage-cli and fog/webdav clients store blobs at
  identical physical locations for backward compatibility.

  Also fixed DAV integration tests to validate signed URL generation
  without requiring nginx infrastructure in the test environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting for Changes | Open for Contribution

Development

Successfully merging this pull request may close these issues.

2 participants