[GH-ISSUE #1282] Delete object doesn't check conditions #185

Open
opened 2026-03-03 12:09:01 +03:00 by kerem · 1 comment
Owner

Originally created by @yvrhdn on GitHub (Aug 7, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1282

Hi, thanks for this project, it's been really helpful for us!

I noticed that conditions are not checked when you delete an object. When we create or update objects conditions work as expected.

I'm sending a request with an invalid version 123:

DELETE /storage/v1/b/tempo/o/overrides%2Fsingle-tenant%2Foverrides.json?alt=json&ifGenerationMatch=123&prettyPrint=false

This request should fail but it succeeds with a 200 and deletes the object.


Digging through the code it seems storageFS.DeleteObject does not pass in conditions:
github.com/fsouza/fake-gcs-server@4f6952135e/internal/backend/fs.go (L379-L391)

Would the solution be as simple as passing in the Conditions and checking them like you do in CreateObject?
github.com/fsouza/fake-gcs-server@4f6952135e/internal/backend/fs.go (L199)

Originally created by @yvrhdn on GitHub (Aug 7, 2023). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1282 Hi, thanks for this project, it's been really helpful for us! I noticed that conditions are not checked when you delete an object. When we create or update objects conditions work as expected. I'm sending a request with an invalid version `123`: ``` DELETE /storage/v1/b/tempo/o/overrides%2Fsingle-tenant%2Foverrides.json?alt=json&ifGenerationMatch=123&prettyPrint=false ``` This request should fail but it succeeds with a 200 and deletes the object. --- Digging through the code it seems `storageFS.DeleteObject` does not pass in conditions: https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L379-L391 Would the solution be as simple as passing in the `Conditions` and checking them like you do in `CreateObject`? https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L199
Author
Owner

@noamshvacher commented on GitHub (Jun 24, 2024):

@fsouza Hi, are there any updates on that?

<!-- gh-comment-id:2186387805 --> @noamshvacher commented on GitHub (Jun 24, 2024): @fsouza Hi, are there any updates on that?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#185
No description provided.