Skip to content

Refactor DAV client, add missing operations#70

Draft
kathap wants to merge 4 commits intomainfrom
add-missing-operations-for-webdav
Draft

Refactor DAV client, add missing operations#70
kathap wants to merge 4 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
req, err := c.createReq("GET", path, nil)
// Put uploads a file to the WebDAV server
func (d *DavBlobstore) Put(sourceFilePath string, dest string) error {
slog.Debug("Uploading file to WebDAV", "source", sourceFilePath, "dest", dest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slog.Debug should be converted to slog.Info, same applies for the other slog.Debug usages

var httpClientBase httpclient.Client
var certPool, err = getCertPool(config)
if err != nil {
return nil, bosherr.WrapErrorf(err, "Failed to create certificate pool")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of bosherr , better to use fmt.Errorf to be compatible in code base.


resp, err := c.httpClient.Do(req)
if err != nil {
return nil, bosherr.WrapErrorf(err, "Getting dav blob %s", path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above , use fmt.Errorf, change all the occurrences blow too, please

@@ -0,0 +1,277 @@
# Testing storage-cli DAV Implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this testing details can go into readme, not sure even needed, this needed only for local testing, eventually we would running against some server or something right?

@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
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