Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ca4989f
Initial upgrade to Symfony 5.4
Jong-Vincent Mar 26, 2024
6c07408
Remove obsolete bundles and switch to Symfony Mailer
Jong-Vincent Apr 30, 2024
250d313
Temporarily enable actions
Jong-Vincent May 1, 2024
5a4f904
Fix provided mail service
Jong-Vincent May 2, 2024
8f51363
Restore unit tests
Jong-Vincent May 2, 2024
c1d8ff2
Fix generating functional_testing.yml
Jong-Vincent May 2, 2024
04de4cf
Fix generating functional_testing.yml
Jong-Vincent May 2, 2024
bc46b8e
Update to PHP 7.2
Jong-Vincent May 3, 2024
bf94d1a
Fix build
Jong-Vincent May 3, 2024
c2d91ad
Fix tests
Jong-Vincent May 3, 2024
491fa47
Fix integration tests
Jong-Vincent May 7, 2024
b029d60
Fix unit tests
Jong-Vincent May 15, 2024
806fe24
Fix acceptance and integration tests
Jong-Vincent May 15, 2024
9d633a6
Fix behat tests
Jong-Vincent May 15, 2024
92ef831
Fix behat tests
Jong-Vincent May 15, 2024
1237e1e
Fix behat tests
Jong-Vincent May 15, 2024
7ae9b84
Fix behat tests
Jong-Vincent May 15, 2024
9c0b68f
Fix unit tests
Jong-Vincent May 16, 2024
fe9c357
Fix unit tests
Jong-Vincent May 16, 2024
7d80456
Fix behat tests
Jong-Vincent May 21, 2024
95b97eb
Fix behat tests
Jong-Vincent May 21, 2024
d4d6180
Fix behat tests
Jong-Vincent May 21, 2024
6056760
Fix behat tests
Jong-Vincent May 22, 2024
024a63f
Fix behat tests
Jong-Vincent May 22, 2024
5e006bc
Load the session from the RequestStack
MKodde Jul 11, 2024
859daf5
WIP
MKodde Jul 11, 2024
e1ec25e
Merge latest from main
Jong-Vincent Sep 5, 2024
731079e
Initital PHP 8.2 support tasks
MKodde Sep 5, 2024
140123d
Repair the routing configuration
MKodde Sep 19, 2024
345a68f
Use php82 for the integration tests. First try
quartje Sep 19, 2024
a65e779
Behat test workflow: chown the cache dir
quartje Sep 19, 2024
79fa09e
Behat tests: The apache config needs a listen directive
quartje Sep 19, 2024
4bbfb4c
Behat workflow: Let curl work
quartje Sep 19, 2024
5eefda3
Behat workflow: Chown the logs dir
quartje Sep 19, 2024
5207581
Implement custom serializable to exclude DOMDocuments
Dec 13, 2024
6873c46
Fix unintentional permission change on file
Dec 13, 2024
8d4b0a0
Merge latest from main
Jong-Vincent Feb 18, 2025
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
33 changes: 33 additions & 0 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run QA tests (static analysis, lint and unit tests)
on: [pull_request]

jobs:
run-qa-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: chown some dirs
run: |
mkdir tmp vendor && sudo chown -R 33 app/ theme/ web/ tmp/ vendor/

- name: Start the containers
run: cd docker && docker compose up -d

- name: Run composer and yarn install
run: |
cd docker &&
docker compose exec -T web.vm.openconext.org bash -c '
SYMFONY_ENV=ci composer install --prefer-dist -n -o --ignore-platform-reqs && \
./app/console cache:clear --env=ci && \
chown -R www-data /var/www/html/app/cache && \
chown -R www-data /var/www/html/app/logs && \
cd theme && CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile && EB_THEME=skeune yarn build
'

- name: Run test curl
run: |
cd docker &&
docker compose exec web.vm.openconext.org bash -c 'curl -k https://engine.vm.openconext.org/info'
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,23 @@ local-php-security-checker
/theme/**/visual-regression/screenshots/*
!/theme/**/visual-regression/screenshots/.gitkeep
/theme/**/__image_snapshots__

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
18 changes: 7 additions & 11 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@

class AppKernel extends Kernel
{
public function registerBundles()
public function registerBundles(): iterable
{
$bundles = [
// Core Symfony
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),

// Sensio helpers
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(),

// Doctrine integration
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
Expand All @@ -36,14 +31,15 @@ public function registerBundles()

// own bundles
$bundles[] = new OpenConext\EngineBlockFunctionalTestingBundle\OpenConextEngineBlockFunctionalTestingBundle();
$bundles[] = new FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle();
}

return $bundles;
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
$configurationDirectory = $this->getRootDir() . '/config/';
$configurationDirectory = $this->getProjectDir() . '/app/config/';
$loader->load($configurationDirectory . 'config_' . $this->getEnvironment() . '.yml');

$localConfiguration = $configurationDirectory . 'config_local.yml';
Expand All @@ -58,14 +54,14 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load(($localConfiguration));
}

public function getCacheDir()
public function getCacheDir(): string
{
return $this->rootDir . '/cache/' . $this->environment;
return $this->getProjectDir() . '/app/cache/' . $this->environment;
}

public function getLogDir()
public function getLogDir(): string
{
return $this->rootDir . '/logs/' . $this->environment;
return $this->getProjectDir() . '/app/logs/' . $this->environment;
}

public function getProjectDir()
Expand Down
78 changes: 50 additions & 28 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,50 +31,50 @@ open_conext_engine_block:
eb.stepup.sfo.override_engine_entityid: "%feature_stepup_sfo_override_engine_entityid%"


swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
port: "%mailer_port%"
username: "%mailer_user%"
password: "%mailer_password%"

framework:
esi: false
translator:
fallbacks: ["%locale%"]
paths:
- '%kernel.root_dir%/../languages'
- '%kernel.root_dir%/../theme/base/translations'
- '%kernel.root_dir%/../theme/%theme.name%/translations'
- '%kernel.project_dir%/languages'
- '%kernel.project_dir%/theme/base/translations'
- '%kernel.project_dir%/theme/%theme.name%/translations'
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
resource: "%kernel.project_dir%/app/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
templating:
engines: ['php']
default_locale: "%locale%"
trusted_hosts: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: false
http_method_override: true
mailer:
transports:
smtp: "smtp://%mailer_user%:%mailer_password%@%mailer_host%:%mailer_port%"
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.adapter.array
doctrine.system_cache_pool:
adapter: cache.adapter.array

# Twig Configuration
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
paths:
"%kernel.root_dir%/../theme/%theme.name%/templates/modules": theme
"%kernel.root_dir%/../theme/%theme.name%/templates/layouts": themeLayouts
"%kernel.root_dir%/../theme/%theme.name%/images": images
"%kernel.root_dir%/../theme/base/templates/modules": theme
"%kernel.root_dir%/../theme/base/templates/layouts": themeLayouts
"%kernel.root_dir%/../theme/base/images": images
"%kernel.project_dir%/theme/%theme.name%/templates/modules": theme
"%kernel.project_dir%/theme/%theme.name%/templates/layouts": themeLayouts
"%kernel.project_dir%/theme/%theme.name%/images": images
"%kernel.project_dir%/theme/base/templates/modules": theme
"%kernel.project_dir%/theme/base/templates/layouts": themeLayouts
"%kernel.project_dir%/theme/base/images": images
globals:
assetsVersion: "%asset_version%"
defaultTitle: "%view_default_title%"
Expand Down Expand Up @@ -114,32 +114,54 @@ doctrine:
engineblock:
naming_strategy: doctrine.orm.naming_strategy.underscore
query_cache_driver:
type: apc
type: service
id: doctrine.system_cache_provider
metadata_cache_driver:
type: apc
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: apc
type: service
id: doctrine.result_cache_provider
connection: ~
mappings:
# An array of mappings, which may be a bundle name or something else
Authentication:
mapping: true
type: annotation
dir: "%kernel.root_dir%/../src/OpenConext/EngineBlockBundle/Authentication"
dir: "%kernel.project_dir%/src/OpenConext/EngineBlockBundle/Authentication"
prefix: OpenConext\EngineBlockBundle\Authentication
is_bundle: false
Metadata:
mapping: true
type: annotation
dir: "%kernel.root_dir%/../src/OpenConext/EngineBlock/Metadata"
dir: "%kernel.project_dir%/src/OpenConext/EngineBlock/Metadata"
prefix: OpenConext\EngineBlock\Metadata
is_bundle: false
dql:
string_functions:
md5: OpenConext\EngineBlockBundle\Doctrine\DqlFunction\Md5

doctrine_migrations:
dir_name: "%kernel.root_dir%/../database/DoctrineMigrations"
namespace: OpenConext\EngineBlock\Doctrine\Migrations
table_name: migration_versions
name: OpenConext EngineBlock Migrations
migrations_paths:
'OpenConext\EngineBlock\Doctrine\Migrations': '%kernel.project_dir%/database/DoctrineMigrations'
# dir_name: "%kernel.project_dir%/database/DoctrineMigrations"
# namespace: OpenConext\EngineBlock\Doctrine\Migrations
storage:
table_storage:
table_name: migration_versions
# name: OpenConext EngineBlock Migrations

services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'
app.mailer:
alias: Symfony\Component\Mailer\MailerInterface
public: true
8 changes: 7 additions & 1 deletion app/config/config_ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
imports:
- { resource: functional_testing.yml }
- { resource: config_test.yml }

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.adapter.filesystem
doctrine.system_cache_pool:
adapter: cache.adapter.filesystem
doctrine:
dbal:
default_connection: engineblock_test
Expand Down
20 changes: 10 additions & 10 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ framework:
enabled: true
fallbacks: [ "%locale%" ]
paths:
- '%kernel.root_dir%/../languages'
- '%kernel.root_dir%/../theme/base/translations'
- '%kernel.root_dir%/../theme/%theme.name%/translations'
- '%kernel.project_dir%/languages'
- '%kernel.project_dir%/theme/base/translations'
- '%kernel.project_dir%/theme/%theme.name%/translations'
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
resource: '%kernel.project_dir%/app/config/routing_dev.yml'
strict_requirements: true
profiler: { only_exceptions: false }

Expand All @@ -30,9 +30,9 @@ twig:
debug: true
strict_variables: false
paths:
"%kernel.root_dir%/../theme/%theme.name%/templates/modules": theme
"%kernel.root_dir%/../theme/%theme.name%/templates/layouts": themeLayouts
"%kernel.root_dir%/../theme/%theme.name%/images": images
"%kernel.root_dir%/../theme/base/templates/modules": theme
"%kernel.root_dir%/../theme/base/templates/layouts": themeLayouts
"%kernel.root_dir%/../theme/base/images": images
"%kernel.project_dir%/theme/%theme.name%/templates/modules": theme
"%kernel.project_dir%/theme/%theme.name%/templates/layouts": themeLayouts
"%kernel.project_dir%/theme/%theme.name%/images": images
"%kernel.project_dir%/theme/base/templates/modules": theme
"%kernel.project_dir%/theme/base/templates/layouts": themeLayouts
"%kernel.project_dir%/theme/base/images": images
10 changes: 5 additions & 5 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ framework:
translator:
fallbacks: ["%locale%"]
paths:
- '%kernel.root_dir%/../languages'
- '%kernel.root_dir%/../theme/base/translations'
- '%kernel.root_dir%/../theme/%theme.name%/translations'
- '%kernel.root_dir%/../src/OpenConext/EngineBlockFunctionalTestingBundle/Resources/languages'
- '%kernel.project_dir%/languages'
- '%kernel.project_dir%/theme/base/translations'
- '%kernel.project_dir%/theme/%theme.name%/translations'
- '%kernel.project_dir%/src/OpenConext/EngineBlockFunctionalTestingBundle/Resources/languages'
session:
storage_id: session.storage.mock_file
name: MOCKSESSION
router:
resource: "%kernel.root_dir%/config/routing_test.yml"
resource: "%kernel.project_dir%/app/config/routing_test.yml"
strict_requirements: true
profiler:
collect: false
Expand Down
2 changes: 1 addition & 1 deletion app/config/functional_testing.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
router.request_context.host: "engine.%domain%"
router.request_context.scheme: "https"

# Where must we store the writable state of the Mock IdP and Mock SP?
## Where must we store the writable state of the Mock IdP and Mock SP
idp_fixture_file: '/tmp/eb-fixtures/db/idp.states.php.serialized'
sp_fixture_file: '/tmp/eb-fixtures/db/sp.states.php.serialized'
stepup.sfo.override_engine_entityid: 'https://engine.dev.openconext.local/new/stepup/metadata'
4 changes: 2 additions & 2 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ parameters:
## * How attributes are displayed in Profile and Consent
## * How attributes are Normalized and Denormalized
## * How attributes are validated
attribute_definition_file_path: %kernel.project_dir%/application/configs/attributes.json
attribute_definition_file_path: '%kernel.project_dir%/application/configs/attributes.json'

## The Signing / Encryption keys used for the SAML2 authentication and metadata
## When EngineBlock signs responses (when it acts as an Idp)
Expand Down Expand Up @@ -208,7 +208,7 @@ parameters:
name: 'OpenConext Admin'
subject: 'IdP debug info from %%1$s'

## Swiftmailer configuration
## Symfony Mailer configuration
mailer_transport: 'smtp'
mailer_host: 'localhost'
mailer_port: '25'
Expand Down
2 changes: 1 addition & 1 deletion app/config/routing_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _profiler:
prefix: /_profiler

_errors:
resource: "@TwigBundle/Resources/config/routing/errors.xml"
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

_main:
Expand Down
2 changes: 1 addition & 1 deletion app/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\ErrorHandler\Debug;

// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
Expand Down
Loading
Loading