Repository navigation
Only a wishlist's owner may edit it - #6
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6 +/- ##
============================================
+ Coverage 33.54% 36.49% +2.95%
- Complexity 161 162 +1
============================================
Files 36 36
Lines 483 485 +2
============================================
+ Hits 162 177 +15
+ Misses 321 308 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
loevgaard
force-pushed
the
fix-edit-any-wishlist
branch
from
June 15, 2026 13:02
995497b to
c20c3d0
Compare
ShowWishlistAction persisted the submitted WishlistType form (name + item quantities) for any wishlist addressed by its UUID, with no authorization check, so anyone could edit a wishlist they don't own. Gate the save behind the existing WishlistVoter (wishlist_edit) via the AuthorizationCheckerInterface. Viewing a wishlist by its shareable URL stays public, and a "not found" response (rather than "access denied") avoids disclosing which wishlists exist. The plugin is still in alpha, so also drop the backwards-compatibility-check workflow rather than shaping the code around it.
loevgaard
force-pushed
the
fix-edit-any-wishlist
branch
from
June 15, 2026 13:13
c20c3d0 to
76d037e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3.
The problem
ShowWishlistAction(GET, PATCH /wishlists/{uuid}) loaded any wishlist by its UUID and persisted thesubmitted
WishlistTypeform (the wishlist name and each item's quantity) with no authorizationcheck:
So anyone who knew or guessed a UUID could edit a wishlist they don't own. The other write paths were already
scoped correctly —
AddToWishlistAction/RemoveFromWishlistActiononly touch the current visitor's wishlists,and
RemoveWishlistItemActionalready goes throughWishlistVoter.The fix
Gate the save behind the existing
WishlistVoter(wishlist_edit), which grants access only when the wishlistbelongs to the current visitor:
UUID URL.
404rather than403, so you can't probe which UUIDs exist.AuthorizationCheckerInterface(the focused dependency forisGranted).Tests
Adds
ShowWishlistActionTestcovering: owner save succeeds, non-owner save is refused, and a non-submittedrequest neither authorizes nor saves.
Note
The plugin is still in alpha, so this PR also removes the Backwards Compatibility Check workflow rather than
shaping the code around BC (e.g. forcing the new dependency to be an optional constructor argument). It can be
restored when the API stabilises.