Skip to content

Commit

Permalink
Use Sylius 1.8 as the default version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Nov 24, 2020
1 parent 5394c61 commit 44d7d65
Show file tree
Hide file tree
Showing 21 changed files with 77 additions and 83 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,20 @@ jobs:
name: Prepare migrations for Sylius 1.7
if: matrix.sylius == '1.7.*'
run: |
cp etc/sylius17/migrations/* tests/Application/src/Migrations/
cp src/Migrations/* tests/Application/src/Migrations/
cd tests/Application/src/Migrations
sed -i -- 's/Sylius\\RefundPlugin\\Migrations/DoctrineMigrations/g' *
cd ../../../../
cp etc/sylius17/bundles.php tests/Application/config/
cp etc/sylius17/doctrine_migrations.yaml tests/Application/config/packages/
cp etc/sylius17/security.yaml tests/Application/config/packages/
rm tests/Application/config/packages//lexik_jwt_authentication.yaml
rm tests/Application/config/routes/sylius_api.yaml
- name: Prepare migrations for Sylius 1.8
if: matrix.sylius == '1.8.*'
run: |
composer require sylius-labs/doctrine-migrations-extra-bundle --no-interaction --no-update
cp etc/travis/sylius18/bundles.php tests/Application/config/
cp etc/travis/sylius18/doctrine_migrations.yaml tests/Application/config/packages/
cp etc/travis/sylius18/lexik_jwt_authentication.yaml tests/Application/config/packages/
cp etc/travis/sylius18/security.yaml tests/Application/config/packages/
cp etc/travis/sylius18/sylius_api.yaml tests/Application/config/routes/
rm tests/Application/src/Migrations/Version*
cat tests/Application/config/packages/doctrine_migrations.yaml
-
name: Install Sylius version
Expand Down
4 changes: 0 additions & 4 deletions etc/travis/sylius18/bundles.php → etc/sylius17/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,4 @@
Sylius\RefundPlugin\SyliusRefundPlugin::class => ['all' => true],
Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true],
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
];
3 changes: 3 additions & 0 deletions etc/sylius17/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
doctrine_migrations:
dir_name: "%kernel.project_dir%/src/Migrations"
namespace: DoctrineMigrations
63 changes: 3 additions & 60 deletions etc/travis/sylius18/security.yaml → etc/sylius17/security.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
parameters:
sylius.security.admin_regex: "^/%sylius_admin.path_name%"
sylius.security.admin_regex: "^/admin"
sylius.security.api_regex: "^/api"
sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++"
sylius.security.new_api_route: "/new-api"
sylius.security.new_api_regex: "^%sylius.security.new_api_route%"
sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin"
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.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++"

security:
always_authenticate_before_granting: true
providers:
sylius_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
sylius_api_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
sylius_shop_user_provider:
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:
Sylius\Component\User\Model\UserInterface: argon2i
firewalls:
Expand All @@ -45,7 +30,7 @@ security:
csrf_token_id: admin_authenticate
remember_me:
secret: "%env(APP_SECRET)%"
path: "/%sylius_admin.path_name%"
path: /admin
name: APP_ADMIN_REMEMBER_ME
lifetime: 31536000
remember_me_parameter: _remember_me
Expand All @@ -58,45 +43,6 @@ security:
pattern: "%sylius.security.api_regex%/oauth/v2/token"
security: false

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

api:
pattern: "%sylius.security.api_regex%/.*"
provider: sylius_admin_user_provider
Expand Down Expand Up @@ -154,6 +100,3 @@ security:
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }

- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }
6 changes: 0 additions & 6 deletions etc/travis/sylius18/doctrine_migrations.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions tests/Application/config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
doctrine_migrations:
dir_name: "%kernel.project_dir%/src/Migrations"
namespace: DoctrineMigrations
storage:
table_storage:
table_name: sylius_migrations
migrations_paths:
'App\Migrations': '%kernel.project_dir%/src/Migrations/'
63 changes: 60 additions & 3 deletions tests/Application/config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
parameters:
sylius.security.admin_regex: "^/admin"
sylius.security.admin_regex: "^/%sylius_admin.path_name%"
sylius.security.api_regex: "^/api"
sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++"
sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++"
sylius.security.new_api_route: "/new-api"
sylius.security.new_api_regex: "^%sylius.security.new_api_route%"
sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin"
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%"

security:
always_authenticate_before_granting: true
providers:
sylius_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
sylius_api_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
sylius_shop_user_provider:
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:
Sylius\Component\User\Model\UserInterface: argon2i
firewalls:
Expand All @@ -30,7 +45,7 @@ security:
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
Expand All @@ -43,6 +58,45 @@ security:
pattern: "%sylius.security.api_regex%/oauth/v2/token"
security: false

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

api:
pattern: "%sylius.security.api_regex%/.*"
provider: sylius_admin_user_provider
Expand Down Expand Up @@ -100,3 +154,6 @@ security:
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }

- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }
File renamed without changes.
Empty file.

0 comments on commit 44d7d65

Please sign in to comment.