Repository navigation
Description
Related context:
- #4846 adds the first official Tencent COS provider within the current
CloudStoragecontract. - #2229 highlights broader storage support needs for China-region and non-default provider setups.
While working on #4846, I noticed that the current shared CloudStorage abstraction covers the basic cross-provider workflow well:
- server-side CRUD
- public URLs
- direct upload descriptions
- upload verification
- basic upload options such as
contentLengthandpreventOverwrite
However, there are still several production-oriented capabilities that are not part of the shared abstraction today, especially for native / non-S3-compatible providers:
- temporary private download URLs / presigned GET
- custom
Content-Type, metadata, and cache-related headers - large-file multipart / streaming-oriented upload support
- object-management capabilities such as list / copy / move / rename
I am not proposing to expand #4846 itself with all of this. That PR intentionally stays within the current CloudStorage contract so the Tencent COS provider can remain reviewable and aligned with the existing official providers.
What I would like to discuss is what the preferred next step should be.
Option A: extend the shared Serverpod cloud storage abstractions / protocol
This would mean evolving the current shared CloudStorage API and, where needed, the direct-upload description protocol so these higher-level capabilities can become first-class optional features for official providers.
Potential direction:
- add a shared way to create temporary private download URLs
- introduce richer upload / object options for content type, metadata, and cache behavior
- define optional capabilities for larger-file multipart / streaming flows
- possibly introduce optional object-management APIs later
Pros:
- gives application developers a more consistent cross-provider API
- makes advanced providers feel more complete inside Serverpod itself
- could benefit not only COS, but also native GCP and future provider integrations
Cons:
- increases the surface area of the shared abstractions
- requires API design and backward-compatibility care
- may be too much to add all at once
Option B: keep the shared abstraction small and support these features separately
This would mean leaving the current CloudStorage contract unchanged, and letting providers expose additional capabilities through provider-specific helpers / extension APIs.
This is already close to what I have explored in my community packages:
tencent_cos_dartprovides the low-level COS signer for presigned URLs, including custom headers and query paramsserverpod_cosprovidessession.cosSigner()and an endpoint / helper-based way to generate presigned URLs, includingGET- my CloudStorage-compatible community package was previously named
serverpod_cloud_storage_cos, and has since been renamed totencent_cos_cloud_storage_serverpodto avoid confusion with the new official package from #4846
Pros:
- keeps the shared abstraction focused and minimal
- lets provider-specific features evolve faster
- lower risk for the core framework
Cons:
- application code becomes less portable across providers
- advanced features are discovered through provider-specific APIs rather than a shared Serverpod interface
- may feel fragmented over time if multiple official providers need similar capabilities
Questions
-
Which direction would you prefer for future work here:
- extending the shared
CloudStorageabstractions / protocol - or keeping the shared contract minimal and adding provider-specific extensions separately?
- extending the shared
-
If the shared direction is preferred, which capability would be the best first candidate?
- temporary private download URLs / presigned GET seems like the most generally useful one to me
-
If helpful, I can also share / adapt the approach used in my community packages and see whether that design is reusable here.
I would be happy to continue in whichever direction fits Serverpod best.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone 🚀
Activity
Metaildust commentedon Mar 13, 2026
@marcelomendoncasoares @nielsenko
How do you see?
Metaildust commentedon Mar 13, 2026
One additional note from my side: if this direction is worth pursuing, I would start with temporary private download URLs / presigned GET support first.
That feels like the most generally useful next capability, and it is also the part that is already implemented and widely used in production in my own packages / applications. So if there is interest, I can use that experience as a starting point and adapt it to whichever direction fits Serverpod best.
nielsenko commentedon Mar 16, 2026
I'd say Option A.
Presigned download URLs are a good first candidate. PR #4806's approach of adding abstract methods to
CloudStorageis the wrong mechanism, but aim to address the same need as I see it.We should use opt-in mixins on
CloudStoragefor extended capabilities. The reason being thatCloudStorageis intended to beextendedand adding new public members is a breaking change.Future capabilities (custom content-type/metadata, list objects, etc.) would each get their own mixin.
CloudStorageOptionscould also grow new fields since it'sfinal(non-breaking addition of named parameters with defaults).Consolidating
CloudStorageinterface class cannot happen until 4.0.