Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejuvinate the Stepup Middleware #416

Draft
wants to merge 89 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
593e7d3
Smoketest env: Set database name to be used in tests
quartje Dec 12, 2023
bc0c1d5
Update test-integration.yml
MKodde Jan 17, 2024
2a45242
Remove security checks from qa checks
MKodde Jan 17, 2024
20c1515
Reenable phpcpd
MKodde Feb 22, 2024
4f96b1a
Upgrade composer dependencies
MKodde Feb 22, 2024
8c92a6e
Repair unit tests after SF6 upgrade
MKodde Feb 26, 2024
7b23511
Refrain from using deprecated config options
MKodde Feb 26, 2024
ebee370
Upgrade Treebuilder creation
MKodde Feb 26, 2024
9f1c36c
Update *Repository classes
MKodde Feb 26, 2024
836d10c
Update *Controller, extend AbstractController
MKodde Feb 26, 2024
749685f
Update Session framework settings
MKodde Feb 26, 2024
5a64ad2
Convert Annotations to Attributes
MKodde Feb 27, 2024
7a2bc4c
Improve type safety of Middleware
MKodde Feb 27, 2024
c256522
Improve code quality
MKodde Feb 27, 2024
aec34cc
Apply Symfony 6 code changes
MKodde Feb 27, 2024
ce33d58
Implement PHP 8 conde constructs
MKodde Feb 27, 2024
c3aa947
Repair the ManagerRegistry reference
MKodde Feb 27, 2024
30b5c70
Enable autoc onfigure/wire/public:false defaults
MKodde Feb 27, 2024
2094154
Add doctrine/annotations for jms translations
MKodde Feb 27, 2024
849b832
Change renamed contracts
MKodde Feb 27, 2024
8554c4e
Upgrade Doctrine Types
MKodde Feb 27, 2024
552da21
Adhere to the vetting type loa determination
MKodde Feb 27, 2024
b8873c7
Set $possessedSelfAssertedToken with correct type
MKodde Feb 27, 2024
6012715
Improve tyep definitions for deserialize methods
MKodde Feb 27, 2024
73a50f2
Repair AuthorizationServiceTest and typehint entities
MKodde Feb 27, 2024
cc2fe6e
Update test-integration to use the php82 container
MKodde Feb 28, 2024
95f0706
Repair IdentityCommandHandlerTest.php
MKodde Feb 28, 2024
b05b471
Configure the Mockery TestListener
MKodde Feb 29, 2024
73c95f0
Work on MW authorizations
MKodde Feb 29, 2024
4d5c91e
Remove .env from Middleware
MKodde Feb 29, 2024
86cea19
Rename namespace of Kernel
MKodde Mar 14, 2024
316f0b9
Install PHPStan with SF support
MKodde Mar 14, 2024
a438e3b
Update EventDisplatcher interface contracts
MKodde Mar 14, 2024
39f4cd9
Annotate event replay might throw an exception
MKodde Mar 14, 2024
6b9b0e7
Stop using AnonymousToken
MKodde Mar 14, 2024
60b2d0d
Address PHPStan level 1 issues
MKodde Mar 14, 2024
f4fb72c
Improve PHPStan Mockery integration
MKodde Mar 18, 2024
04b156a
Remove dead method from VettingTypeHintController
MKodde Mar 18, 2024
6305abc
Address remaining PHPStan level 2 issues
MKodde Mar 19, 2024
3dc4490
Address level 3 PHPStan issues
MKodde Mar 20, 2024
6e97aad
Address level 4 PHPStan issues
MKodde Mar 20, 2024
d146101
Address level 5 PHPStan issues
MKodde Mar 21, 2024
807ca93
Address PHPStan 6 findings
MKodde Mar 25, 2024
efa0cdc
Configure level 9, addding warnings to baseline
MKodde Apr 2, 2024
a6adafc
Address PHP MD issues that were introduced
MKodde Apr 2, 2024
4798367
Address PHP CS issues that were introduced
MKodde Apr 2, 2024
357a694
Install and repair document headers
MKodde Apr 2, 2024
df0ccca
Track ci/qa/phpstan.neon
MKodde Apr 2, 2024
8651776
Also the /internal/{info,health} paths must be publically available
thijskh Apr 17, 2024
8c21259
Make expiration date in mail match the one displayed in selfservice.
thijskh Mar 4, 2024
7a61750
Sync new monolog docker logging setup
pablothedude Nov 7, 2024
62f3042
Sync framework config setup
pablothedude Nov 7, 2024
02989b0
Force phpunit in test mode by setting env
pablothedude Nov 7, 2024
7a9725f
Fix update configuration command
pablothedude Nov 7, 2024
f434df0
Fix NameId VO
pablothedude Nov 7, 2024
358394a
Fix routes extension
pablothedude Nov 7, 2024
082b0bd
Remove duplicate composer dependencies
pablothedude Nov 7, 2024
c840078
Add missing migration doc headers
pablothedude Nov 11, 2024
185f34d
Fix broken tests
pablothedude Nov 11, 2024
cacf2a8
Fix deprecations while fixing broken tests
pablothedude Nov 11, 2024
42abdef
Fix role authentication deprecated or logic
pablothedude Nov 11, 2024
b9ff9de
Fix remaining configuration tests
pablothedude Nov 11, 2024
01e7842
Refactor all ParamConverters to ValueResolvers
pablothedude Nov 12, 2024
b989615
Fix the event replay
pablothedude Nov 15, 2024
9206181
Update config
pablothedude Nov 15, 2024
626ac37
Update Twig
pablothedude Nov 15, 2024
641281f
Fix the entitymanager state while replaying
pablothedude Nov 19, 2024
d4b8d6c
Fix route controllers
pablothedude Nov 19, 2024
563c627
Fix mail date format
pablothedude Nov 20, 2024
6954f7d
Fix deprecations
pablothedude Nov 20, 2024
b5071f9
Refactor remaining Symfony config to when@env
pablothedude Nov 21, 2024
ec393ad
Fix translations and extract script
pablothedude Nov 21, 2024
8a0f7c0
Update Doctrine migration scripts
pablothedude Nov 21, 2024
f5d08f7
Fix deprecated container injection in migrations
pablothedude Nov 26, 2024
29bc0bb
Fix replay errors test2 replay
pablothedude Nov 26, 2024
911f385
Lower dev log level
pablothedude Nov 26, 2024
9d834af
Fix production database diff
pablothedude Nov 28, 2024
d10ad3c
Bump saml2, xmlseclibs
thijskh Dec 6, 2024
f0a1b14
Add BC localizeddate twig filter
pablothedude Dec 9, 2024
83ef80e
Fix typo in doc block
pablothedude Dec 9, 2024
a274cc5
Support deprecated u2f support in projection
pablothedude Dec 9, 2024
756032a
Fixes after manual testing
pablothedude Dec 10, 2024
894632a
Bump test image
pablothedude Dec 10, 2024
9ad9861
Remove `php` from bash scripts
pablothedude Dec 11, 2024
50a1111
Split nameid VO exception
pablothedude Dec 11, 2024
c97543d
Change the mail date format back so timezone is used
pablothedude Dec 11, 2024
28d61a2
Remove pagerfanta orm adapter as separate dependency
pablothedude Dec 12, 2024
c118697
Minor changes after review
pablothedude Dec 17, 2024
b404242
Use php8 for docker builds
phavekes Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 1 addition & 8 deletions ...r/Fixtures/invalid_configuration/null.php → .docheader
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

/**
* Copyright 2014 SURFnet bv
* Copyright %regexp:\d{4}% SURFnet %regexp:(B.V.|bv)%
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +13,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

return [
'expectedPropertyPath' => '(root)',
'configuration' => null
];
40 changes: 0 additions & 40 deletions .env

This file was deleted.

4 changes: 0 additions & 4 deletions .env.test

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-push-test-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v3

- name: Build the app
uses: openconext/build-and-publish-test-container/php72-node14@main
uses: openconext/build-and-publish-test-container/php82-node20@main
with:
use_yarn: false

Expand Down
42 changes: 16 additions & 26 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,22 @@ on:
push:
branches: [ main, feature/*, bugfix/*, release/* ]
jobs:
build:
run-qa-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: /var/www/html/
container:
image: ghcr.io/openconext/openconext-basecontainers/php82-apache2-node20-composer2:latest
volumes:
- .:/var/www/html

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Init environment
run: |
cd ci/docker
docker compose up -d
- name: Install dependencies
run: |
cd ci/docker && docker compose exec -T stepup-middleware bash -lc '
composer install
'
- name: Run test scripts
run: cd ci/docker && docker compose exec -T stepup-middleware bash -lc ' composer test '
- name: Output log files on failure
if: failure()
run: |
tail -2000 /var/log/syslog
uses: actions/checkout@v2

- name: Composer install
run: composer install

- name: Run QA tests
run: composer check
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/web/app_dev.php
/web/app_test.php
/web/app_dev.php.dist
/config/legacy/parameters.yaml
/config/openconext/parameters.yaml
/var/cache/*
/var/logs/*
!var/cache/.gitkeep
Expand Down Expand Up @@ -36,3 +36,7 @@ config/services.yml
###> symfony/phpunit-bridge ###
.phpunit
###< symfony/phpunit-bridge ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
43 changes: 9 additions & 34 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Surfnet\StepupMiddleware\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__).'/config/bootstrap.php';

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
4 changes: 2 additions & 2 deletions bin/doctrine-migrations-diff.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

php72 ./bin/console do:mi:di --em=middleware --filter-expression='~^(?!event_stream).*$~'
bin/console doctrine:migrations:diff --em=middleware --env=dev --filter-expression='~^(?!event_stream).*$~'
sleep 1
php72 ./bin/console do:mi:di --em=gateway
bin/console doctrine:migrations:diff --em=gateway --env=dev
2 changes: 1 addition & 1 deletion bin/doctrine-migrations-migrate.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

php72 ./bin/console doctrine:migrations:migrate --env=prod --em=deploy
bin/console doctrine:migrations:migrate --env=prod --em=deploy
3 changes: 2 additions & 1 deletion bin/extract-translations.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
php72 bin/console translation:extract --config=default --env=dev
bin/console translation:extract --env=dev nl_NL --format=xliff --force
bin/console translation:extract --env=dev en_GB --format=xliff --force
8 changes: 0 additions & 8 deletions ci/qa/create-test-db

This file was deleted.

5 changes: 5 additions & 0 deletions ci/qa/docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

./vendor/bin/docheader --no-ansi check src/ tests/
6 changes: 6 additions & 0 deletions ci/qa/phpcbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

# https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically
./vendor/bin/phpcbf --standard=ci/qa/phpcs.xml --extensions=php src $1
9 changes: 3 additions & 6 deletions ci/qa/phpcpd
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env bash

#cd $(dirname $0)/../../
cd $(dirname $0)/../../
#
## https://github.com/sebastianbergmann/phpcpd
#./vendor/bin/phpcpd --exclude src/*/Tests/* src

# PHPCS is currently disabled due to Xdebug throwing a fatal error.
echo "Skipping PHPCPD due to Xdebug fatal error"
exit 0
./vendor/bin/phpcpd --exclude */Tests/* src
exit 0;
5 changes: 5 additions & 0 deletions ci/qa/phpstan
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

vendor/bin/phpstan analyse --memory-limit=-1 --no-ansi -c ./ci/qa/phpstan.neon
Loading
Loading