From 52e0998bef35189f1ea93132b2bce746cef32276 Mon Sep 17 00:00:00 2001 From: christopherheroo Date: Sun, 11 Jun 2023 21:35:56 +0200 Subject: [PATCH] upgrade 1.12 --- .github/workflows/build.yaml | 2 +- composer.json | 24 +++--- tests/Application/config/bundles.php | 1 - .../config/packages/swiftmailer.yaml | 2 - .../config/routes/sylius_shop.yaml | 2 +- .../config/sylius/1.11/bundles.php | 1 + .../sylius/1.11/packages/swiftmailer.yaml | 7 ++ .../config/sylius/{1.10 => 1.12}/bundles.php | 1 + .../packages/dev/jms_serializer.yaml | 0 .../packages/jms_serializer.yaml | 0 .../packages/prod/jms_serializer.yaml | 0 .../{1.10 => 1.12}/packages/security.yaml | 82 ++++++++----------- tests/Application/package.json.~1.11.dist | 41 ++++++++++ tests/Application/package.json.~1.12.dist | 41 ++++++++++ 14 files changed, 140 insertions(+), 64 deletions(-) delete mode 100644 tests/Application/config/packages/swiftmailer.yaml create mode 100644 tests/Application/config/sylius/1.11/packages/swiftmailer.yaml rename tests/Application/config/sylius/{1.10 => 1.12}/bundles.php (77%) rename tests/Application/config/sylius/{1.10 => 1.12}/packages/dev/jms_serializer.yaml (100%) rename tests/Application/config/sylius/{1.10 => 1.12}/packages/jms_serializer.yaml (100%) rename tests/Application/config/sylius/{1.10 => 1.12}/packages/prod/jms_serializer.yaml (100%) rename tests/Application/config/sylius/{1.10 => 1.12}/packages/security.yaml (62%) create mode 100644 tests/Application/package.json.~1.11.dist create mode 100644 tests/Application/package.json.~1.12.dist diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8656fc5..cc74237 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['7.4', '8.0'] + php-versions: ['8.0'] steps: - name: Start MySQL run: sudo /etc/init.d/mysql start diff --git a/composer.json b/composer.json index 680f1a3..792d8cc 100644 --- a/composer.json +++ b/composer.json @@ -11,20 +11,22 @@ ], "license": "MIT", "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0 || ^8.1", "beberlei/doctrineextensions": "^1.2", + "sylius/sylius": "~1.11 || ~1.12", "sylius/resource-bundle": "^1.6", - "symfony/config": "^4.4 || ^5.0", - "symfony/lock": "^4.4 || ^5.0", + "symfony/config": "^5.4 || ^6.0", + "symfony/lock": "^5.4 || ^6.0", "thecodingmachine/safe": "^1.1" }, "require-dev": { "roave/security-advisories": "dev-master", "setono/code-quality-pack": "^2.1.2", "setono/sylius-behat-pack": "^0.2.1", - "sylius/sylius": "^1.10", + "sylius/sylius": "~1.11 || ~1.12", "behat/behat": "^3.7", "behat/mink-selenium2-driver": "^1.4", + "behat/mink": "^1.8", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", "friends-of-behat/mink": "^1.8", @@ -34,7 +36,7 @@ "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.1", "friends-of-behat/variadic-extension": "^1.3", - "lakion/mink-debug-extension": "^2.0.0", + "lakion/mink-debug-extension": "^2.0", "phpspec/phpspec": "^7.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "0.12.88", @@ -44,17 +46,17 @@ "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "sylius-labs/coding-standard": "^4.0", - "symfony/browser-kit": "^4.4 || ^5.2", - "symfony/debug-bundle": "^4.4 || ^5.2", - "symfony/dotenv": "^4.4 || ^5.2", - "symfony/intl": "^4.4 || ^5.2", - "symfony/web-profiler-bundle": "^4.4 || ^5.2", - "vimeo/psalm": "^4.7" + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/debug-bundle": "^5.4 || ^6.0", + "symfony/dotenv": "^5.4 || ^6.0", + "symfony/intl": "^5.4 || ^6.0", + "symfony/web-profiler-bundle": "^5.4 || ^6.0" }, "config": { "sort-packages": true, "allow-plugins": { "symfony/thanks": false, + "symfony/flex": false, "dealerdirect/phpcodesniffer-composer-installer": false, "phpstan/extension-installer": false, "ergebnis/composer-normalize": false diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 2bed671..4715744 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -6,7 +6,6 @@ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], diff --git a/tests/Application/config/packages/swiftmailer.yaml b/tests/Application/config/packages/swiftmailer.yaml deleted file mode 100644 index 3bab0d3..0000000 --- a/tests/Application/config/packages/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -swiftmailer: - url: '%env(MAILER_URL)%' diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 8818568..9116420 100644 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -11,4 +11,4 @@ sylius_shop_default_locale: path: / methods: [GET] defaults: - _controller: sylius.controller.shop.locale_switch:switchAction + _controller: sylius.controller.shop.locale_switch::switchAction diff --git a/tests/Application/config/sylius/1.11/bundles.php b/tests/Application/config/sylius/1.11/bundles.php index 400b877..732aa21 100644 --- a/tests/Application/config/sylius/1.11/bundles.php +++ b/tests/Application/config/sylius/1.11/bundles.php @@ -4,6 +4,7 @@ return [ BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], + Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true], SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml new file mode 100644 index 0000000..79957d3 --- /dev/null +++ b/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml @@ -0,0 +1,7 @@ +swiftmailer: + url: '%env(MAILER_URL)%' + disable_delivery: true + logging: true + spool: + type: file + path: "%kernel.cache_dir%/spool" diff --git a/tests/Application/config/sylius/1.10/bundles.php b/tests/Application/config/sylius/1.12/bundles.php similarity index 77% rename from tests/Application/config/sylius/1.10/bundles.php rename to tests/Application/config/sylius/1.12/bundles.php index d50639f..400b877 100644 --- a/tests/Application/config/sylius/1.10/bundles.php +++ b/tests/Application/config/sylius/1.12/bundles.php @@ -5,4 +5,5 @@ return [ BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], + Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/sylius/1.10/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/dev/jms_serializer.yaml similarity index 100% rename from tests/Application/config/sylius/1.10/packages/dev/jms_serializer.yaml rename to tests/Application/config/sylius/1.12/packages/dev/jms_serializer.yaml diff --git a/tests/Application/config/sylius/1.10/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/jms_serializer.yaml similarity index 100% rename from tests/Application/config/sylius/1.10/packages/jms_serializer.yaml rename to tests/Application/config/sylius/1.12/packages/jms_serializer.yaml diff --git a/tests/Application/config/sylius/1.10/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/prod/jms_serializer.yaml similarity index 100% rename from tests/Application/config/sylius/1.10/packages/prod/jms_serializer.yaml rename to tests/Application/config/sylius/1.12/packages/prod/jms_serializer.yaml diff --git a/tests/Application/config/sylius/1.10/packages/security.yaml b/tests/Application/config/sylius/1.12/packages/security.yaml similarity index 62% rename from tests/Application/config/sylius/1.10/packages/security.yaml rename to tests/Application/config/sylius/1.12/packages/security.yaml index ef43c09..4ed342f 100644 --- a/tests/Application/config/sylius/1.10/packages/security.yaml +++ b/tests/Application/config/sylius/1.12/packages/security.yaml @@ -1,11 +1,5 @@ -parameters: - sylius.security.admin_regex: "^/admin" - sylius.security.shop_regex: "^/(?!admin|new-api|api/.*|api$|media/.*)[^/]++" - sylius.security.new_api_route: "/new-api" - sylius.security.new_api_regex: "^%sylius.security.new_api_route%" - security: - always_authenticate_before_granting: true + enable_authenticator_manager: true providers: sylius_admin_user_provider: id: sylius.admin_user_provider.email_or_name_based @@ -15,11 +9,8 @@ security: id: sylius.shop_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] - encoders: + password_hashers: Sylius\Component\User\Model\UserInterface: argon2i firewalls: admin: @@ -35,58 +26,44 @@ security: default_target_path: sylius_admin_dashboard use_forward: false use_referer: true - csrf_token_generator: security.csrf.token_manager + enable_csrf: true csrf_parameter: _csrf_admin_security_token csrf_token_id: admin_authenticate remember_me: secret: "%env(APP_SECRET)%" - path: /admin + path: "/%sylius_admin.path_name%" name: APP_ADMIN_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me logout: path: sylius_admin_logout target: sylius_admin_login - anonymous: true new_api_admin_user: - pattern: "%sylius.security.new_api_route%/admin-user-authentication-token" - provider: sylius_admin_user_provider + pattern: "%sylius.security.new_api_admin_regex%/.*" + provider: sylius_api_admin_user_provider stateless: true - anonymous: true + entry_point: jwt json_login: - check_path: "%sylius.security.new_api_route%/admin-user-authentication-token" + check_path: "%sylius.security.new_api_admin_route%/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 + jwt: true new_api_shop_user: - pattern: "%sylius.security.new_api_route%/shop-user-authentication-token" - provider: sylius_shop_user_provider + pattern: "%sylius.security.new_api_shop_regex%/.*" + provider: sylius_api_shop_user_provider stateless: true - anonymous: true + entry_point: jwt json_login: - check_path: "%sylius.security.new_api_route%/shop-user-authentication-token" + check_path: "%sylius.security.new_api_shop_route%/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 + jwt: true shop: switch_user: { role: ROLE_ALLOWED_TO_SWITCH } @@ -103,7 +80,7 @@ security: default_target_path: sylius_shop_homepage use_forward: false use_referer: true - csrf_token_generator: security.csrf.token_manager + enable_csrf: true csrf_parameter: _csrf_shop_security_token csrf_token_id: shop_authenticate remember_me: @@ -113,26 +90,35 @@ security: remember_me_parameter: _remember_me logout: path: sylius_shop_logout - target: sylius_shop_login + target: sylius_shop_homepage invalidate_session: false - success_handler: sylius.handler.shop_user_logout - anonymous: true dev: - pattern: ^/(_(profiler|wdt)|css|images|js)/ + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + + image_resolver: + pattern: ^/media/cache/resolve security: false access_control: - - { path: "%sylius.security.admin_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] } + - { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } - { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS } - - { path: "%sylius.security.shop_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] } + - { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } - { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS } - - { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: "%sylius.security.shop_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS } + - { path: "%sylius.security.shop_regex%/login", role: PUBLIC_ACCESS } - - { path: "%sylius.security.shop_regex%/register", role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: "%sylius.security.shop_regex%/verify", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.shop_regex%/register", role: PUBLIC_ACCESS } + - { path: "%sylius.security.shop_regex%/verify", role: PUBLIC_ACCESS } - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } + + - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } + - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Application/package.json.~1.11.dist b/tests/Application/package.json.~1.11.dist new file mode 100644 index 0000000..36e6c1f --- /dev/null +++ b/tests/Application/package.json.~1.11.dist @@ -0,0 +1,41 @@ +{ + "dependencies": { + "@babel/polyfill": "^7.0.0", + "chart.js": "^3.7.1", + "jquery": "^3.5.0", + "jquery.dirtyforms": "^2.0.0", + "lightbox2": "^2.9.0", + "semantic-ui-css": "^2.2.0", + "slick-carousel": "^1.8.1" + }, + "devDependencies": { + "@symfony/webpack-encore": "^1.6.1", + "babel-core": "^6.26.3", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-module-resolver": "^3.1.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-register": "^6.26.0", + "dedent": "^0.7.0", + "eslint": "^4.19.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-import-resolver-babel-module": "^4.0.0", + "eslint-plugin-import": "^2.11.0", + "merge-stream": "^1.0.0", + "sass": "^1.39.2", + "sass-loader": "^12.1.0" + }, + "scripts": { + "dev": "yarn encore dev", + "watch": "yarn encore dev --watch", + "prod": "yarn encore prod", + "lint": "yarn lint:js", + "lint:js": "eslint gulpfile.babel.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sylius/Sylius.git" + }, + "author": "Paweł Jędrzejewski", + "license": "MIT" +} diff --git a/tests/Application/package.json.~1.12.dist b/tests/Application/package.json.~1.12.dist new file mode 100644 index 0000000..36e6c1f --- /dev/null +++ b/tests/Application/package.json.~1.12.dist @@ -0,0 +1,41 @@ +{ + "dependencies": { + "@babel/polyfill": "^7.0.0", + "chart.js": "^3.7.1", + "jquery": "^3.5.0", + "jquery.dirtyforms": "^2.0.0", + "lightbox2": "^2.9.0", + "semantic-ui-css": "^2.2.0", + "slick-carousel": "^1.8.1" + }, + "devDependencies": { + "@symfony/webpack-encore": "^1.6.1", + "babel-core": "^6.26.3", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-module-resolver": "^3.1.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-register": "^6.26.0", + "dedent": "^0.7.0", + "eslint": "^4.19.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-import-resolver-babel-module": "^4.0.0", + "eslint-plugin-import": "^2.11.0", + "merge-stream": "^1.0.0", + "sass": "^1.39.2", + "sass-loader": "^12.1.0" + }, + "scripts": { + "dev": "yarn encore dev", + "watch": "yarn encore dev --watch", + "prod": "yarn encore prod", + "lint": "yarn lint:js", + "lint:js": "eslint gulpfile.babel.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sylius/Sylius.git" + }, + "author": "Paweł Jędrzejewski", + "license": "MIT" +}