Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down Expand Up @@ -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 ###
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
###< symfony/phpunit-bridge ###

###> vincentlanglet/twig-cs-fixer ###
/.twig-cs-fixer.php
/.twig-cs-fixer.cache
###< vincentlanglet/twig-cs-fixer ###

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 1 addition & 20 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 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';
2 changes: 1 addition & 1 deletion config/packages/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 7 additions & 8 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ 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 }
api_user_provider:
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
custom_authenticators:
- 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 }
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions config/preload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
$files = glob(dirname(__DIR__).'/var/cache/prod/*.preload.php');
foreach (false !== $files ? $files : [] as $file) {
require $file;
}
14 changes: 10 additions & 4 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# yaml-language-server: $schema=../vendor/symfony/routing/Loader/schema/routing.schema.json

# This file is the entry point to configure the routes of your app.
# Methods with the #[Route] attribute are automatically imported.
# See also https://symfony.com/doc/current/routing.html

# To list all registered routes, run the following command:
# bin/console debug:router

controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute
resource: routing.controllers
3 changes: 3 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# yaml-language-server: $schema=../vendor/symfony/dependency-injection/Loader/schema/services.schema.json

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# See also https://symfony.com/doc/current/service_container/import.html

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
return static function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
42 changes: 21 additions & 21 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.0",
"ref": "87424683adc81d7dc305eefec1fced883084aab9"
"ref": "fdd756167454623e21f1d769c5b814b243782a67"
}
},
"friendsofphp/php-cs-fixer": {
"version": "3.40",
"version": "3.95",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "3.0",
"ref": "be2103eb4a20942e28a6dd87736669b757132435"
"version": "3.39",
"ref": "97aaf9026490db73b86c23d49e5774bc89d2b232"
},
"files": [
".php-cs-fixer.dist.php"
Expand Down Expand Up @@ -71,18 +71,18 @@
]
},
"phpunit/phpunit": {
"version": "12.3",
"version": "13.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "11.1",
"ref": "c6658a60fc9d594805370eacdf542c3d6b5c0869"
"ref": "ca0bc067abfb40a8de1b2561b96cbfc2b833c314"
},
"files": [
".env.test",
"bin/phpunit",
"phpunit.dist.xml",
"tests/bootstrap.php",
"bin/phpunit"
"tests/bootstrap.php"
]
},
"symfony/console": {
Expand Down Expand Up @@ -111,12 +111,12 @@
]
},
"symfony/framework-bundle": {
"version": "7.3",
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "7.3",
"ref": "5a1497d539f691b96afd45ae397ce5fe30beb4b9"
"version": "7.4",
"ref": "5ea2ed9cd29ca8fc2cb9bca9cb7b7e0a8d2be1dc"
},
"files": [
".editorconfig",
Expand Down Expand Up @@ -152,38 +152,38 @@
]
},
"symfony/routing": {
"version": "7.3",
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "7.0",
"ref": "21b72649d5622d8f7da329ffb5afb232a023619d"
"version": "7.4",
"ref": "bc94c4fd86f393f3ab3947c18b830ea343e51ded"
},
"files": [
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/security-bundle": {
"version": "6.4",
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "2ae08430db28c8eb4476605894296c82a642028f"
"version": "7.4",
"ref": "02d47835088cd548c827e5d53b3c4b361bca3390"
},
"files": [
"config/packages/security.yaml",
"config/routes/security.yaml"
]
},
"symfony/twig-bundle": {
"version": "6.4",
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877"
"ref": "06dacf16872358cb1f2494e089070ff2d045233a"
},
"files": [
"config/packages/twig.yaml",
Expand Down Expand Up @@ -216,12 +216,12 @@
]
},
"vincentlanglet/twig-cs-fixer": {
"version": "3.7",
"version": "4.1",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "3.0",
"ref": "d42582ae1bce86fd43491d6264c738b0867f8ffe"
"ref": "0a2d420aa6554f632804a3f21624e16314fe8588"
}
}
}
Loading