Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
53880c1
Install Symfony 6 dependencies
MKodde Oct 16, 2023
7c31233
Remove unused Dockerfile.ci
MKodde Oct 16, 2023
0fcd7c3
Move linting tools to ci/qa
MKodde Oct 16, 2023
56166dd
Move composer validate to ci/qa
MKodde Oct 16, 2023
97bd957
Move docheader check to ci/qa
MKodde Oct 16, 2023
bbbaf51
Move PHP CodeStyle to ci/qa
MKodde Oct 16, 2023
983281c
Move PHP Mess Detection to ci/qa
MKodde Oct 16, 2023
109629f
Move PHP copy paste detector to ci/qa
MKodde Oct 16, 2023
fd33f70
Move PHPStan to ci/qa
MKodde Oct 16, 2023
fa88d7a
Remove PHPUnit from the project
MKodde Oct 16, 2023
e729946
Move Behat tests to ci/qa
MKodde Oct 16, 2023
d28ee43
Run behat tests in seperate test workflow
MKodde Oct 16, 2023
6f4dc19
Adhere to configured PHP coding style
MKodde Oct 16, 2023
6cf2bfc
Adhere to PHPStan level 1..3
MKodde Oct 16, 2023
9212b6c
Adhere to PHPStan level 4..7
MKodde Oct 16, 2023
43d1009
Adhere to PHPStan level 8..9
MKodde Oct 16, 2023
fe9296e
Address SF6 incompatibilities
MKodde Oct 18, 2023
c3b7f8c
Repair application to render in browser
MKodde Oct 19, 2023
7829263
Use PHP 82 with Node 16 in dev image
MKodde Oct 26, 2023
e202357
Upgrade dev container to Node20
MKodde Oct 30, 2023
edab9a7
Remove Homestead
MKodde Oct 30, 2023
027d95a
Improve Demo GSSP styling
MKodde Oct 30, 2023
c0610da
Install gssp bundle from packagist
MKodde Oct 30, 2023
b7a69d7
Install new SAML bundle
MKodde Oct 30, 2023
1f635d5
Update a demo sp translation that mentions app_dev
MKodde Oct 30, 2023
d2fbea6
Update CHANGELOG
MKodde Oct 30, 2023
8f4de17
Update test dependencies
MKodde Oct 30, 2023
9b00fa1
Update PHPStan Baseline and import FQN
MKodde Oct 30, 2023
c756772
Write reports in var folder not in /build
MKodde Oct 30, 2023
effadf5
GHA acceptance: Add gssp.stepup.example.com as hostname to the contai…
quartje Oct 31, 2023
dda1827
Run QA tests on latest Node 20 image
MKodde Oct 31, 2023
f324bd6
Build frontent assets in production mode
MKodde Oct 31, 2023
11d3a21
Install yarn packages on GHA
MKodde Oct 31, 2023
0261d09
Disable SSL peer verification for tests
MKodde Oct 31, 2023
0779ef0
Override Application environment
MKodde Oct 31, 2023
497968e
Load dev services in test
MKodde Oct 31, 2023
0b33c85
GHA acceptance: Rename gssp.stepup.example.com
MKodde Nov 6, 2023
597d3da
Update Behat tests to utilize containerized setup
MKodde Nov 6, 2023
767be83
Simplify the config
MKodde Nov 27, 2023
0b378ae
Move frontend assets to /assets folder
MKodde Nov 27, 2023
db31dc0
Run Behat tests locally on devconf container
MKodde Nov 27, 2023
596e8a7
Do not run acceptance tests on GHA
MKodde Nov 27, 2023
cb40098
Upgrade to Symfony 6.4
MKodde Nov 29, 2023
411e64c
Update Composer dependencies
MKodde Dec 13, 2023
337478d
Replace .env with parameters
MKodde Dec 13, 2023
63f9c72
Add the missing favicon.ico and reroute it
MKodde Dec 14, 2023
191bd08
Remove deprecated security setting
MKodde Dec 14, 2023
ed0682d
Improve specificity: SPController::toFormattedXml
MKodde Dec 14, 2023
845a4fe
Import the SamlResponse aliassed
MKodde Dec 14, 2023
c7ed8b0
Add dev classes to php stans sniffing neighborhood
MKodde Dec 14, 2023
ebe36bc
Add trailing commas to parameter lists
MKodde Dec 14, 2023
8f49d04
Apply property promotion to WebContext
MKodde Dec 14, 2023
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
21 changes: 0 additions & 21 deletions .env.ci

This file was deleted.

21 changes: 0 additions & 21 deletions .env.dist

This file was deleted.

2 changes: 0 additions & 2 deletions .env.docker

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
run:
working-directory: /var/www/html/
container:
image: ghcr.io/openconext/openconext-basecontainers/php82-apache2-node16-composer2:latest
image: ghcr.io/openconext/openconext-basecontainers/php82-apache2-node20-composer2:latest
volumes:
- .:/var/www/html

Expand Down
20 changes: 5 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
###########################

/.web-server-pid
/config/packages/parameters.yml
/config/packages/parameters.yaml
/config/openconext/parameters.yaml
/build/
/var/*
!/var/cache
Expand Down Expand Up @@ -58,23 +57,14 @@ homestead/vendor
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

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

###> squizlabs/php_codesniffer ###
/.phpcs-cache
/phpcs.xml
###< squizlabs/php_codesniffer ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> behat/symfony2-extension ###
behat.yml
###< behat/symfony2-extension ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.0.0
Make the project Symfony 6 and PHP 8.2 compatible.
Many changes were made to achieve this goal. Some highlights:
- The Homestead dev-env is removed you can now use OpenConext-devconf instead
- Acceptance tests now run on GitHub Actions (Travis is no longer used)
- Styling was brushed up

# 1.4.3
Make the project compatible with Stepup-build
- Added a composer archive section
Expand Down
58 changes: 22 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Locale user preference
----------------------

The default locale is based on the user agent. When the user switches its locale the selected preference is stored inside a
browser cookie (stepup_locale). The cookie is set on naked domain of the requested domain (for gssp.stepup.example.com this is example.com).
browser cookie (stepup_locale). The cookie is set on naked domain of the requested domain (for demogssp.dev.openconext.local this is example.com).

Authentication and registration flows
-------------------------------------

The application provides internal (SpBundle) and a remote service provider. Instructions for this are given
on the homepage of this example project [Homepage](https://gssp.stepup.example.com/app_dev.php/).
on the homepage of this example project [Homepage](https://demogssp.dev.openconext.local/).

![flow](docs/flow.png)
<!---
Expand Down Expand Up @@ -68,7 +68,7 @@ One of the benefits of using this repository is that it contains many pre-config
2) Change the project configuration variables:
* composer.json name and description
* this readme.md file
* Replace 'gssp.stepup.example.com' in all files with your own hostename
* Replace 'demogssp.dev.openconext.local' in all files with your own hostename
3) Install the copied project. (See [Development environment](#) section of this README.md file)
4) Implement your authentication & registration logic in DefaultController::registrationAction and DefaultController::authenticateAction.
5) Feel free to rename and change this example clone for your needs.
Expand All @@ -84,60 +84,46 @@ Development environment

The purpose of the development environment is only for running the different test and metric tools.

To get started, first setup the development environment. The dev. env. is a virtual machine. Every task described is run
from that machine.
To get started, first setup the development environment. The development environment is a docker container. That is
controlled via the [OpenConext-devconf](https://github.com/OpenConext/OpenConext-devconf/) project.

Every task described below should be run from that container.

Requirements
-------------------
- vagrant 2.2.x
- vagrant-hostsupdater (1.1.1.160, global)
- vagrant-vbguest (0.19.0, global)
- Virtualbox
- Composer
- Docker
- OpenConext-devconf

Install
-------------------
**Create a .env file**

1. `$ cp .env.ci .env`
1. Edit the `.env` file with the editor of your choice and update the `APP_SECRET` to a value of your liking. See [Symfony docs](https://symfony.com/doc/current/reference/configuration/framework.html#secret) for more details about this secret.


**Copy the parameters.yaml**

`$ cp config/packages/parameters.yaml.dist config/packages/parameters.yaml`

**Bring up Homestead**
`$ cp config/openconext/parameters.yaml.dist config/openconext/parameters.yaml`

```
$ cd homestead
$ composer install
$ cd ..
$ vagrant up
```

If everything goes as intended, you can develop in the virtual machine.
**Bring up the container in dev-mode**
From you dev-conf installation start the `stepup` dev-env with AzureMFA in dev mode

**Upgrade Homestead regularly**
For example:

Issues described in the previous section can be prevented if the base box is up to date.

For detailed instructions, please visit the excellent Homestead [documentation pages](https://laravel.com/docs/5.8/homestead#updating-homestead).
```bash
cd stepup
./start-dev-env.sh demogssp:../../OpenConext-stepup/Stepup-gssp-example
```

**Building frontend assets:**

`$ yarn encore dev`
`$ yarn encore dev`

or
or

`$ yarn encore prod`
`$ yarn encore prod`

for production
for production


If everything goes as planned you can go to:

[https://gssp.stepup.example.com](https://gssp.stepup.example.com/app_dev.php)
[https://demogssp.dev.openconext.local](https://demogssp.dev.openconext.local/)

Debugging
-------------------
Expand Down
50 changes: 0 additions & 50 deletions Vagrantfile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added assets/openconext/images/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions public/scss/application.scss → assets/scss/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ $fa-font-path: "../../fonts";
@import "base/mixins";
@import "utilities/media_queries";
@import "components/header";
@import "components/button";
@import "components/form";
@import "components/alerts";
@import "components/icon_legend";
@import "components/table";
@import "components/navigation";
@import "components/footer";
@import "pages/base";
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ div.alert {
padding-right: 0.25em;
}
}

pre {
font-family: "Roboto Mono", Sans-serif;
font-size: small;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 12 additions & 26 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,16 @@
<?php
use Surfnet\Gssp\Infrastructure\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
if (false === 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;

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}
set_time_limit(0);
require dirname(__DIR__).'/vendor/autoload.php';
if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
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();
}
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);

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

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
13 changes: 0 additions & 13 deletions bin/phpunit

This file was deleted.

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

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

./vendor/bin/behat --config ./ci/qa/behat.yml --tags '~@skip' $1
19 changes: 7 additions & 12 deletions behat.yml → ci/qa/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ default:
progress:
paths: false
extensions:
Behat\Symfony2Extension:
FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Functional/Features/bootstrap/bootstrap.php
kernel:
bootstrap: tests/Functional/Features/bootstrap/bootstrap.php
class: Surfnet\Gssp\Infrastructure\Kernel
environment: test
debug: false
Behat\MinkExtension:
base_url: https://gssp.stepup.example.com
default_session: 'symfony2'
goutte:
guzzle_parameters:
curl.CURLOPT_SSL_VERIFYPEER: false
curl.CURLOPT_CERTINFO: false
ssl.certificate_authority: false
verify: false
base_url: https://demogssp.dev.openconext.local/
sessions:
symfony2:
symfony2: ~
symfony:
symfony: ~
Behatch\Extension: ~
suites:
default:
Expand Down
6 changes: 6 additions & 0 deletions ci/qa/docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

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

./vendor/bin/docheader --no-ansi check src/ tests/

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

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

./bin/console lint:yaml config --no-ansi

# https://github.com/overtrue/phplint
./vendor/bin/phplint --no-ansi -n --no-progress --configuration=ci/qa/phplint.yaml $1
Loading