Skip to content

Commit

Permalink
[API][AddressBook] protect addressbook with new firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamKasp committed Oct 27, 2020
1 parent fcd69c0 commit 146244f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ parameters:
sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%"
sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop"
sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%"
sylius.security.new_api_user_account_route: "%sylius.security.new_api_shop_route%/account"
sylius.security.new_api_user_account_regex: "^%sylius.security.new_api_user_account_route%"

security:
always_authenticate_before_granting: true
Expand Down Expand Up @@ -147,3 +149,4 @@ security:
- { path: "%sylius.security.new_api_route%/admin/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.new_api_route%/shop/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Resources/config/services/api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<service id="sylius.behat.api_platform_client.shop.address" class="Sylius\Behat\Client\ApiPlatformClient" parent="sylius.behat.api_platform_client">
<argument>addresses</argument>
<argument>shop</argument>
<argument>shop/account</argument>
</service>

<service id="sylius.behat.api_platform_client.administrator" class="Sylius\Behat\Client\ApiPlatformClient" parent="sylius.behat.api_platform_client">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
>
<resource class="%sylius.model.address.class%" shortName="Address">
<attribute name="route_prefix">shop</attribute>
<attribute name="route_prefix">shop/account</attribute>

<attribute name="normalization_context">
<attribute name="groups">
Expand Down

0 comments on commit 146244f

Please sign in to comment.