WebAssembly / wasi-blobstore

15 stars 11 forks source link

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

Open calvinrp opened 6 months ago

calvinrp commented 6 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 6 months 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 6 months ago

GCP Storage R2 and headers

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

thomastaylor312 commented 6 months ago

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