Skip to content

Enhance storage-cli webdav config#634

Merged
jochenehret merged 10 commits into
developfrom
storage-cli-webdav-support
Jun 16, 2026
Merged

Enhance storage-cli webdav config#634
jochenehret merged 10 commits into
developfrom
storage-cli-webdav-support

Conversation

@kathap

@kathap kathap commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Needs new storage-cli release with cloudfoundry/storage-cli#105 to be merged first, and #650 and cloudfoundry/cloud_controller_ng#4974 to be deployed together.

  • A short explanation of the proposed change:
    Fix and complete the WebDAV/DAV storage-cli config templates across all Cloud Controller jobs so that storage-cli's signed URL generation works correctly. This includes constructing the endpoint with the resource directory key, passing through the optional public_endpoint for dual-endpoint lazy signing, and fixing the TLS cert structure to match storage-cli's expected format.

  • An explanation of the use cases your change solves

    • Signed URL generation (HMAC-SHA256): Storage-cli extracts the directory key from the endpoint path (e.g. /admin/cc-droplets) and embeds it in signed URLs
      (/signed/cc-droplets/). Without the correct endpoint, signed URLs would be malformed and nginx would reject them with 403.
    • Dual-endpoint lazy signing: When public_endpoint is configured, sign-public generates user-facing URLs with the external blobstore hostname for app clients, while sign-internal
      uses the private endpoint for Diego. Without this pass-through, both commands would use the same host.
    • Legacy fog name support: Both "webdav" (legacy fog name) and "dav" (native storage-cli name) are accepted and normalised to "dav" at render time, enabling zero-downtime
      migration without manifest changes.

    Changes Made:

    20 config template files updated across 5 Cloud Controller job types:

    • cloud_controller_ng
    • cloud_controller_worker
    • cloud_controller_clock
    • cc_deployment_updater
    • blobstore_benchmark

    3 key modifications to each WebDAV/DAV config section:

    a. Endpoint construction with directory key — built from private_endpoint + "/admin/" + <resource_directory_key> (e.g. https://blobstore.internal:4443/admin/cc-droplets) instead
    of incorrectly using public_endpoint with no path

    b. Optional public_endpoint pass-through — passed to storage-cli when set, enabling sign-public to generate URLs with the external blobstore hostname

    c. Fixed TLS cert structure — corrected from {"cert": ca_cert} to {"cert": {"ca": ca_cert}} to match storage-cli's config format; added nil guard for environments without a CA
    cert

    Example Manifest Usage:

 cc:
   droplets:
     blobstore_type: storage-cli
     blobstore_provider: dav
     connection_config:
       username: blobstore-user
       password: ((blobstore_admin_users_password))
       private_endpoint: https://blobstore.service.cf.internal:4443
       public_endpoint: https://blobstore.cf.example.com  # optional, for sign-public
       secret: ((blobstore_secure_link_secret))

@kathap kathap marked this pull request as draft March 25, 2026 08:16
@kathap kathap marked this pull request as ready for review March 27, 2026 11:54
@kathap kathap marked this pull request as draft April 24, 2026 15:18
@kathap kathap marked this pull request as ready for review April 25, 2026 07:18
@kathap kathap force-pushed the storage-cli-webdav-support branch 3 times, most recently from 3f028cf to 8482b4e Compare May 11, 2026 12:35
kathap added 6 commits May 11, 2026 14:44
  Configure storage-cli WebDAV endpoints to include resource-specific
  directory keys (cc-droplets, cc-packages, cc-buildpacks, cc-resources)
  for backward compatibility with fog/webdav client.

  When using basic auth, endpoints are: /admin/{directory_key}
  When using signed URLs, endpoints are: /{directory_key}

  This ensures both storage-cli and fog/webdav store blobs at identical
  physical paths, enabling zero-downtime rollback between the two clients.

  Updated all job templates and RSpec tests to expect directory keys in
  endpoint paths.
Refactors WebDAV configuration in storage-cli templates to support
  dual-endpoint lazy signing:

  - Always use /admin/{resource_dir} for endpoint (internal)
  - Add public_endpoint configuration (external users)
  - Replace signing_method with signed_url_format
  - Simplify endpoint logic (remove secret-based conditional)
  - Fix TLS ca_cert nil check

  Required for storage-cli sign-internal and sign-public commands
  to generate URLs with correct endpoints for Diego (internal) vs
  external users (public).
@kathap kathap force-pushed the storage-cli-webdav-support branch from 8482b4e to 7633e15 Compare May 11, 2026 12:45
@kathap kathap marked this pull request as draft May 28, 2026 12:29
@kathap kathap force-pushed the storage-cli-webdav-support branch from ddb3038 to d9b3fef Compare June 5, 2026 13:27
@kathap kathap force-pushed the storage-cli-webdav-support branch from d9b3fef to 350052d Compare June 8, 2026 06:46
@kathap kathap marked this pull request as ready for review June 15, 2026 12:50
@jochenehret jochenehret self-requested a review June 16, 2026 07:08

@jochenehret jochenehret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've tested this PR together with the related PRs on a bbl environment:
cloudfoundry/cloud_controller_ng#4974
cloudfoundry/storage-cli#105
#650

Works! We just need to update the relevant configuration documentation:

  1. In the spec files, the parameter cc.<bucket>.blobstore_provider should mention the new type dav.
  2. The parameter cc.<bucket>.connection_config is documented with Azure Storage Cli connection hash, should be changed to Storage CLI connection configuration (that's not related to this specific PR ;-)).
  3. In the "Example Manifest Usage" section, we should align the credential names with the cf-deployment base manifest:
    blobstore_password -> blobstore_admin_users_password
    blobstore_secret -> blobstore_secure_link_secret
  4. The paramter retry_attempts should be documented.

@jochenehret jochenehret merged commit 51a37a0 into develop Jun 16, 2026
2 checks passed
@moleske moleske deleted the storage-cli-webdav-support branch June 16, 2026 16:23
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.

2 participants