4.3 KiB
UPGRADE FROM v1.7.X TO v1.8.0
-
Add new bundles to your list of used bundles in
config/bundles.phpif you are not using it apart from Sylius:+ ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], + Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], -
Add configuration of ApiBundle in your
config/packages/_sylius.yamlfile:imports: + - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } -
Add configuration of new ApiBundle in your
config/packages/security.yamlfile:parameters: + sylius.security.new_api_route: "/new-api" + sylius.security.new_api_regex: "^%sylius.security.new_api_route%" security: providers: + sylius_api_admin_user_provider: + id: sylius.admin_user_provider.email_or_name_based + sylius_api_shop_user_provider: + id: sylius.shop_user_provider.email_or_name_based + sylius_api_chain_provider: + chain: + providers: [sylius_api_shop_user_provider, sylius_api_admin_user_provider] firewalls: + new_api_admin_user: + pattern: "%sylius.security.new_api_route%/admin-user-authentication-token" + provider: sylius_admin_user_provider + stateless: true + anonymous: true + json_login: + check_path: "%sylius.security.new_api_route%/admin-user-authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + guard: + authenticators: + - lexik_jwt_authentication.jwt_token_authenticator + + new_api_shop_user: + pattern: "%sylius.security.new_api_route%/shop-user-authentication-token" + provider: sylius_shop_user_provider + stateless: true + anonymous: true + json_login: + check_path: "%sylius.security.new_api_route%/shop-user-authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + guard: + authenticators: + - lexik_jwt_authentication.jwt_token_authenticator + + new_api: + pattern: "%sylius.security.new_api_regex%/*" + provider: sylius_api_chain_provider + stateless: true + anonymous: lazy + guard: + authenticators: + - lexik_jwt_authentication.jwt_token_authenticator -
Add
sylius_api.yamlfile toconfig/routes/directory:sylius_api: resource: "@SyliusApiBundle/Resources/config/routing.yml" prefix: "%sylius.security.new_api_route%" -
All consts classes has been changed from final classes to interfaces. As a result initialization of
\Sylius\Bundle\UserBundle\UserEventsis not longer possible. The whole list of changed classes can be found here. -
Service alias
Sylius\Component\Channel\Context\ChannelContextInterfacewas changed fromsylius.context.channel.compositetosylius.context.channel. The later is being decorated bysylius.context.channel.cachedwhich caches the channel per request and reduces the amount of database queries. -
A serialization group has been added to the route
sylius_admin_ajax_product_indexto avoid an infinite loop, or a time out during this ajax request (previously no serialization group was defined on this route).