diff --git a/.env b/.env index 61dd506..77e9740 100644 --- a/.env +++ b/.env @@ -21,6 +21,7 @@ ITKDEV_TEMPLATE=symfony-6 ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET= +APP_SHARE_DIR=var/share ###< symfony/framework-bundle ### ###> app ### @@ -53,3 +54,9 @@ INDEX_ORGANIZATION_ALIAS=organization ###> nelmio/cors-bundle ### CORS_ALLOW_ORIGIN='*' ###< nelmio/cors-bundle ### + +###> symfony/routing ### +# Configure how to generate URLs in non-HTTP contexts, such as CLI commands. +# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands +DEFAULT_URI=https://${COMPOSE_DOMAIN} +###< symfony/routing ### diff --git a/.gitignore b/.gitignore index 82d4029..fcb71d2 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ ###< symfony/phpunit-bridge ### ###> vincentlanglet/twig-cs-fixer ### +/.twig-cs-fixer.php /.twig-cs-fixer.cache ###< vincentlanglet/twig-cs-fixer ### diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c6d6b7..4a4c7ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log. ## [Unreleased] +- [PR-77](https://github.com/itk-dev/event-database-api/pull/77) + Update Symfony Flex recipes - [PR-76](https://github.com/itk-dev/event-database-api/pull/76) Update API Platform to 4.4 (OpenAPI 3.2.0, no `charset` in the `application/ld+json` content type) - [PR-75](https://github.com/itk-dev/event-database-api/pull/75) diff --git a/bin/phpunit b/bin/phpunit index 692bacc..ac5eef1 100755 --- a/bin/phpunit +++ b/bin/phpunit @@ -1,23 +1,4 @@ #!/usr/bin/env php = 80000) { - require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; - } else { - define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php'); - require PHPUNIT_COMPOSER_INSTALL; - PHPUnit\TextUI\Command::main(); - } -} else { - if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) { - echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; - exit(1); - } - - require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php'; -} +require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml index 8166181..0f34f87 100644 --- a/config/packages/routing.yaml +++ b/config/packages/routing.yaml @@ -2,7 +2,7 @@ framework: router: # Configure how to generate URLs in non-HTTP contexts, such as CLI commands. # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands - #default_uri: http://localhost + default_uri: '%env(DEFAULT_URI)%' when@prod: framework: diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 0d1e5f5..282cc70 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -2,6 +2,7 @@ security: # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' + # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider providers: users_in_memory: { memory: null } @@ -9,7 +10,8 @@ security: id: App\Security\ApiUserProvider firewalls: dev: - pattern: ^/(_(profiler|wdt)|css|images|js)/ + # Ensure dev tools and static assets are always allowed + pattern: ^/(_profiler(/|$)|(_wdt|assets|build)/) security: false main: stateless: true @@ -17,14 +19,13 @@ security: - App\Security\ApiKeyAuthenticator provider: api_user_provider - # activate different ways to authenticate + # Activate different ways to authenticate: # https://symfony.com/doc/current/security.html#the-firewall # https://symfony.com/doc/current/security/impersonating_user.html # switch_user: true - # Easy way to control access for large sections of your site - # Note: Only the *first* access control that matches will be used + # Note: Only the *first* matching rule is applied access_control: - { path: ^/api/v2/docs, roles: PUBLIC_ACCESS } - { path: ^/api, roles: IS_AUTHENTICATED_FULLY } @@ -33,10 +34,8 @@ security: when@test: security: password_hashers: - # By default, password hashers are resource intensive and take time. This is - # important to generate secure password hashes. In tests however, secure hashes - # are not important, waste resources and increase test times. The following - # reduces the work factor to the lowest possible values. + # Password hashers are resource-intensive by design to ensure security. + # In tests, it's safe to reduce their cost to improve performance. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: algorithm: auto cost: 4 # Lowest possible value for bcrypt diff --git a/config/preload.php b/config/preload.php index 5ebcdb2..bb358ef 100644 --- a/config/preload.php +++ b/config/preload.php @@ -1,5 +1,6 @@