WebAssembly / wasi-blobstore

10 stars 10 forks source link

Add conditional requirements (e.g. `If-Match`) #22

Open calvinrp opened 2 months ago

calvinrp commented 2 months ago

It is common to use conditional headers in blob store API calls to achieve transactional consistency. Operations fail if the condition is not met.

Common ones:

For example, see Azure Blob Storage docs.

GET requests would return an Etag value that could be used as If-Match condition.

Any objections to a PR?

thomastaylor312 commented 1 month ago

Are there similar headers for other blobstore providers? I'm good with a PR, especially if you can include the links to multiple providers using this (which I think they do)

calvinrp commented 1 month ago

GCP Storage R2 and headers

S3 has on GET but doesn't appear on the PUT?

thomastaylor312 commented 1 month ago

Yep, that looks good to me. Feel free to open a PR