Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Api][Cart] Fix for Cart access tests #11830

Merged
merged 7 commits into from Sep 23, 2020
Merged

Conversation

Tomanhez
Copy link
Contributor

Q A
Branch? 1.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

@Tomanhez Tomanhez requested a review from a team as a code owner September 10, 2020 08:11
@probot-autolabeler probot-autolabeler bot added the API APIs related issues and PRs. label Sep 10, 2020
@Tomanhez Tomanhez force-pushed the fix-for-authorization branch 9 times, most recently from b89007f to 19f0a19 Compare September 16, 2020 07:27
@Tomanhez Tomanhez changed the title [Api][Cart] Fix for ItemExtensions [Api][Cart] Fix for Cart access tests Sep 16, 2020
Copy link
Contributor

@AdamKasp AdamKasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/** @experimental */
should be added to all new classes.

src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CheckoutContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CheckoutContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
@Tomanhez Tomanhez force-pushed the fix-for-authorization branch 2 times, most recently from 365b8df to 0efc057 Compare September 23, 2020 07:54
@@ -11,7 +11,7 @@ Feature: Checking out as guest with a registered email
And the store allows paying offline
And there is a customer account "john@example.com"

@ui @api
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is temporarily disabled and will be fixed in next iteration, We have secured the customers cart against operating by unauthorized visitor. But now user that has account in shop and try to buy something without login can't do this. Blocked by query in OrderGetMethodItemExtension.php and OrderMethodsItemExtension.php , As a visitor the query allow to get or to set order for situation when: customer == null or customer.user == null, but in this specific case should allow to continue shops when customer.user == certainUser, Possibility solution: create context that will be store customer id after addressing step.

@GSadee GSadee merged commit 16eb902 into Sylius:1.8 Sep 23, 2020
@GSadee
Copy link
Member

GSadee commented Sep 23, 2020

Thanks, Tomasz! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants