Skip to content

Support S3 conditional writes (If-Match / If-None-Match) #289

Description

@Robothy

Summary

local-s3 currently does not support S3 conditional writes. A repo-wide search for If-Match / if-match returns zero hits — neither PutObject, CopyObject nor CompleteMultipartUpload evaluate conditional headers.

Why

AWS GA'd conditional writes in Nov 2024. SDKs may send If-None-Match: * by default in some flows, so clients can silently hit unexpected behaviour against local-s3.

Reference: how competitors handle it

adobe/S3Mock has shipped this and hit multiple follow-up bugs — a signal that the feature is in real demand and that the edge cases are non-trivial:

Source: adobe/S3Mock two-year issue backfill (see state/findings.json, entry backfill-s3mock-2y).

Scope

  • Operations: PutObject, CopyObject, CompleteMultipartUpload (and consider DeleteObject)
  • Expected status codes: 412 PreconditionFailed, 409 ConditionalRequestConflict
  • Watch out for ETag quoting semantics — S3 returns quoted ETags, comparisons must account for that (see S3Mock#2665)

Acceptance

  • Conditional headers evaluated on the operations above
  • Correct error codes returned on failed preconditions
  • Integration tests covering match / no-match for each operation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions