[API] Bump APIP to 3.1 and configure admin authentication

This commit is contained in:
Grzegorz Sadowski 2023-09-28 15:10:20 +02:00
parent 3ac8972c4f
commit 9d5a1b3604
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
7 changed files with 17 additions and 26 deletions

View file

@ -5,7 +5,7 @@
{
"php": "8.2",
"symfony": "~6.3.0",
"api-platform": "^2.7.10"
"api-platform": "^3.1"
}
]
},
@ -23,7 +23,7 @@
{
"php": "8.2",
"symfony": "~6.3.0",
"api-platform": "^2.7.10",
"api-platform": "^3.1",
"mysql": "8.0",
"twig": "^3.3"
}
@ -51,7 +51,7 @@
"static-checks": {
"php": [ "8.2" ],
"symfony": [ "~6.3.0" ],
"api-platform": [ "^2.7.10" ]
"api-platform": [ "^3.1" ]
},
"e2e-mariadb": {
"php": [ "8.2" ],
@ -61,7 +61,7 @@
"e2e-mysql": {
"php": [ "8.2" ],
"symfony": [ "~6.3.0" ],
"api-platform": [ "^2.7.10" ],
"api-platform": [ "^3.1" ],
"mysql": [ "5.7", "8.0" ],
"twig": [ "^3.3" ]
},

View file

@ -3,11 +3,6 @@
This document explains why certain conflicts were added to `composer.json` and
references related issues.
- `lexik/jwt-authentication-bundle: ^2.18`
After bumping to this version ApiBundle starts failing due to requesting a non-existing `api_platform.openapi.factory.legacy` service.
As we are not using this service across the ApiBundle we added this conflict to unlock the builds, until we investigate the problem.
- `symfony/framework-bundle:6.2.8`:
This version is missing the service alias `validator.expression`

View file

@ -30,7 +30,7 @@
"ext-intl": "*",
"ext-json": "*",
"ext-simplexml": "*",
"api-platform/core": "^2.7.10",
"api-platform/core": "^3.1",
"babdev/pagerfanta-bundle": "^3.0",
"behat/transliterator": "^1.3",
"doctrine/collections": "^1.6",
@ -94,7 +94,7 @@
"symfony/config": "^6.3.2",
"symfony/console": "^6.3.4",
"symfony/dependency-injection": "^6.3.4",
"symfony/deprecation-contracts": "^2.5.2",
"symfony/deprecation-contracts": "^3.1",
"symfony/doctrine-bridge": "^6.3.4",
"symfony/doctrine-messenger": "^6.3.1",
"symfony/event-dispatcher": "^6.3.2",
@ -187,7 +187,6 @@
},
"conflict": {
"doctrine/orm": ">= 2.16.0",
"lexik/jwt-authentication-bundle": "^2.18",
"stof/doctrine-extensions-bundle": "1.8.0"
},
"require-dev": {

View file

@ -46,7 +46,7 @@ return [
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],

View file

@ -36,7 +36,7 @@ api_platform:
swagger:
versions: [3]
api_keys:
apiKey:
JWT:
name: "%sylius.api.authorization_header%"
type: header
exception_to_status:
@ -64,13 +64,11 @@ api_platform:
Symfony\Component\Serializer\Exception\UnexpectedValueException: 400
Symfony\Component\Serializer\Exception\MissingConstructorArgumentsException: 400
Sylius\Bundle\ApiBundle\CommandHandler\Checkout\Exception\OrderTotalHasChangedException: 409
collection:
pagination:
client_items_per_page: true
defaults:
pagination_client_items_per_page: true
lexik_jwt_authentication:
token_extractors:
authorization_header:
enabled: true
prefix: Bearer
name: "%sylius.api.authorization_header%"
api_platform:
check_path: "%sylius.security.new_api_route%/admin/authentication-token"
username_path: email
password_path: password

View file

@ -52,7 +52,7 @@ return [
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true, 'test_with_swiftmailer' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true, 'test_with_swiftmailer' => true],

View file

@ -25,7 +25,7 @@
"require": {
"php": "^8.2",
"doctrine/dbal": "^3.0",
"api-platform/core": "^2.7.10",
"api-platform/core": "^3.1",
"enshrined/svg-sanitize": "^0.16",
"lexik/jwt-authentication-bundle": "^2.11",
"sylius/core-bundle": "^2.0",
@ -47,8 +47,7 @@
"theofidry/alice-data-fixtures": "^1.4"
},
"conflict": {
"doctrine/doctrine-bundle": "2.3.0",
"lexik/jwt-authentication-bundle": "^2.18"
"doctrine/doctrine-bundle": "2.3.0"
},
"config": {
"allow-plugins": {