Skip to content

Conversation

@Jacke
Copy link
Contributor

@Jacke Jacke commented Jan 15, 2026

Fixes #17831

Summary

  • Include the protocol context path (e.g., /storage/v1/s3 for Supabase) in presigned URLs
  • Override getVirtualPath() in the anonymous RestS3Service instance used for URL signing
  • This mirrors the existing behavior in RequestEntityRestStorageService for regular S3 requests

Problem

When using Cyberduck with the official Supabase Storage S3 profile (which sets Context=/storage/v1/s3), "Copy URL → Signed URL" generates a presigned URL that omits the context path prefix. The generated URL points to https://<host>/<bucket>/<key> instead of https://<host>/storage/v1/s3/<bucket>/<key>, causing Supabase to return {"error":"requested path is invalid"}.

Solution

The fix adds a getVirtualPath() override in S3PresignedUrlProvider that returns the context path from the protocol configuration. This ensures the context path is included in both:

  1. The URL path of the presigned URL
  2. The canonical request used for SigV4 signature calculation

Backward Compatibility

This change is backward compatible:

  • For standard S3 providers (AWS, Wasabi, MinIO, etc.) where getContext() returns empty/null, getVirtualPath() returns an empty string — behavior unchanged
  • Only profiles with an explicit Context setting (like Supabase) are affected

Test plan

  • Added unit test testContextPath() verifying presigned URLs include the context path when configured

When generating presigned URLs, include the protocol context path
(e.g., /storage/v1/s3 for Supabase) in both the URL path and the
signature calculation. This fixes presigned URLs for S3-compatible
providers that require a path prefix in the endpoint.

The fix overrides getVirtualPath() in the anonymous RestS3Service
instance used for URL signing, mirroring the existing behavior in
RequestEntityRestStorageService for regular S3 requests.
@Jacke Jacke requested a review from a team as a code owner January 15, 2026 10:17
@cla-assistant
Copy link

cla-assistant bot commented Jan 15, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link

cla-assistant bot commented Jan 15, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dkocher dkocher added this to the 9.4 milestone Jan 16, 2026
@dkocher dkocher merged commit 78e0b63 into iterate-ch:master Jan 16, 2026
4 checks passed
@Jacke
Copy link
Contributor Author

Jacke commented Jan 16, 2026

Thanks for a review @dkocher 👍

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.

S3 Signed URL ignores profile Context (path prefix) for custom endpoints (e.g. Supabase /storage/v1/s3)

2 participants