Skip to content

Commit

Permalink
Merge pull request #162 from OpenConext/feature/symfony-34-upgrade
Browse files Browse the repository at this point in the history
Symfony 3.4 upgrade
  • Loading branch information
MKodde authored Sep 10, 2018
2 parents b9b24cf + c6d9cb0 commit 1466e6a
Show file tree
Hide file tree
Showing 48 changed files with 1,815 additions and 1,109 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ php:
- 5.6
- 7.0

matrix:
allow_failures:
- php: 7.0

env:
global:
- SYMFONY_ENV=test
Expand All @@ -27,7 +31,6 @@ before_script:
script:
- ant


branches:
only:
- master
Expand Down
7 changes: 7 additions & 0 deletions app/AppCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;

class AppCache extends HttpCache
{
}
3 changes: 0 additions & 3 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public function registerBundles()
new Surfnet\SamlBundle\SurfnetSamlBundle(),
new Surfnet\StepupBundle\SurfnetStepupBundle(),
new JMS\TranslationBundle\JMSTranslationBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\AopBundle\JMSAopBundle(),
// Replace with Pagerfanta https://www.pivotaltracker.com/story/show/89688680
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Surfnet\StepupU2fBundle\SurfnetStepupU2fBundle(),
Expand All @@ -50,7 +48,6 @@ public function registerBundles()
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}

return $bundles;
Expand Down
59 changes: 29 additions & 30 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ framework:
templating:
engines: ['twig', 'php']
assets:
version: %asset_version%
version: "%asset_version%"
default_locale: "%default_locale%"
trusted_hosts: ~
trusted_proxies: %trusted_proxies%
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
Expand Down Expand Up @@ -74,9 +73,9 @@ services:
tags: [{ name: twig.extension }]

surfnet_stepup_ra_ra:
required_loa: %loa_required_for_login%
enabled_second_factors: %enabled_second_factors%
enabled_generic_second_factors: %enabled_generic_second_factors%
required_loa: "%loa_required_for_login%"
enabled_second_factors: "%enabled_second_factors%"
enabled_generic_second_factors: "%enabled_generic_second_factors%"
session_lifetimes:
max_absolute_lifetime: "%session_max_absolute_lifetime%"
max_relative_lifetime: "%session_max_relative_lifetime%"
Expand All @@ -92,11 +91,11 @@ mopa_bootstrap:

surfnet_stepup_middleware_client:
authorisation:
username: %middleware_credentials_username%
password: %middleware_credentials_password%
username: "%middleware_credentials_username%"
password: "%middleware_credentials_password%"
url:
command_api: %middleware_url_command_api%
api: %middleware_url_api%
command_api: "%middleware_url_command_api%"
api: "%middleware_url_api%"

surfnet_saml:
hosted:
Expand All @@ -105,48 +104,48 @@ surfnet_saml:
service_provider:
enabled: true
assertion_consumer_route: ra_serviceprovider_consume_assertion
public_key: %saml_sp_publickey%
private_key: %saml_sp_privatekey%
public_key: "%saml_sp_publickey%"
private_key: "%saml_sp_privatekey%"
metadata:
entity_id_route: ra_saml_metadata
public_key: %saml_metadata_publickey%
private_key: %saml_metadata_privatekey%
public_key: "%saml_metadata_publickey%"
private_key: "%saml_metadata_privatekey%"
remote:
identity_provider:
enabled: true
entity_id: %saml_remote_idp_entity_id%
sso_url: %saml_remote_idp_sso_url%
certificate: %saml_remote_idp_certificate%
entity_id: "%saml_remote_idp_entity_id%"
sso_url: "%saml_remote_idp_sso_url%"
certificate: "%saml_remote_idp_certificate%"

surfnet_stepup:
logging:
application_name: registration-authority
loa_definition:
loa1: %stepup_loa_loa1%
loa2: %stepup_loa_loa2%
loa3: %stepup_loa_loa3%
loa1: "%stepup_loa_loa1%"
loa2: "%stepup_loa_loa2%"
loa3: "%stepup_loa_loa3%"
sms:
originator: %sms_originator%
otp_expiry_interval: %sms_otp_expiry_interval%
maximum_otp_requests: %sms_maximum_otp_requests%
originator: "%sms_originator%"
otp_expiry_interval: "%sms_otp_expiry_interval%"
maximum_otp_requests: "%sms_maximum_otp_requests%"
gateway_api:
url: %gateway_api_url%
url: "%gateway_api_url%"
credentials:
username: %gateway_api_username%
password: %gateway_api_password%
username: "%gateway_api_username%"
password: "%gateway_api_password%"
attach_request_id_injector_to:
- surfnet_stepup.guzzle.gateway_api
- surfnet_stepup_middleware_client.guzzle.api
- surfnet_stepup_middleware_client.guzzle.commands
locale_cookie:
domain: %locale_cookie_domain%
domain: "%locale_cookie_domain%"

jms_translation:
locales: %locales%
locales: "%locales%"
configs:
default:
dirs: [%kernel.root_dir%/../src, %kernel.root_dir%, %kernel.root_dir%/../vendor/surfnet/stepup-middleware-client-bundle, %kernel.root_dir%/../vendor/surfnet/stepup-bundle]
output_dir: %kernel.root_dir%/Resources/translations
dirs: ["%kernel.root_dir%/../src", "%kernel.root_dir%", "%kernel.root_dir%/../vendor/surfnet/stepup-middleware-client-bundle", "%kernel.root_dir%/../vendor/surfnet/stepup-bundle"]
output_dir: "%kernel.root_dir%/Resources/translations"
ignored_domains: []
excluded_names: ['*TestCase.php', '*Test.php']
excluded_dirs: [cache, data, logs, Tests]
Expand All @@ -163,4 +162,4 @@ knp_paginator:
sortable: SurfnetStepupRaRaBundle:Pagination:sortable_link.html.twig

surfnet_stepup_u2f:
app_id: %u2f_app_id%
app_id: "%u2f_app_id%"
2 changes: 1 addition & 1 deletion app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ monolog:
type: stream
handler: logfile
level: NOTICE
path: %kernel.logs_dir%/%kernel.environment%.log
path: "%kernel.logs_dir%/%kernel.environment%.log"

assetic:
use_controller: "%use_assetic_controller%"
Expand Down
4 changes: 0 additions & 4 deletions app/config/routing_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ _profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler

_configurator:
resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
prefix: /_configurator

JMSTranslationBundle_ui:
resource: "@JMSTranslationBundle/Controller/"
type: annotation
Expand Down
43 changes: 13 additions & 30 deletions app/config/samlstepupproviders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,23 @@ surfnet_stepup_ra_saml_stepup_provider:
routes:
consume_assertion: ra_vetting_gssf_verify
metadata: ra_vetting_gssf_metadata

providers:
tiqr:
hosted:
service_provider:
public_key: %gssp_tiqr_sp_publickey%
private_key: %gssp_tiqr_sp_privatekey%
metadata:
public_key: %gssp_tiqr_metadata_publickey%
private_key: %gssp_tiqr_metadata_privatekey%
remote:
entity_id: %gssp_tiqr_remote_entity_id%
sso_url: %gssp_tiqr_remote_sso_url%
certificate: %gssp_tiqr_remote_certificate%
view_config:
title: %gssp_tiqr_title%
page_title: %gssp_tiqr_page_title%
explanation: %gssp_tiqr_explanation%
initiate: %gssp_tiqr_initiate%
gssf_id_mismatch: %gssp_tiqr_gssf_id_mismatch%
biometric:
hosted:
service_provider:
public_key: %gssp_biometric_sp_publickey%
private_key: %gssp_biometric_sp_privatekey%
public_key: "%gssp_tiqr_sp_publickey%"
private_key: "%gssp_tiqr_sp_privatekey%"
metadata:
public_key: %gssp_biometric_metadata_publickey%
private_key: %gssp_biometric_metadata_privatekey%
public_key: "%gssp_tiqr_metadata_publickey%"
private_key: "%gssp_tiqr_metadata_privatekey%"
remote:
entity_id: %gssp_biometric_remote_entity_id%
sso_url: %gssp_biometric_remote_sso_url%
certificate: %gssp_biometric_remote_certificate%
entity_id: "%gssp_tiqr_remote_entity_id%"
sso_url: "%gssp_tiqr_remote_sso_url%"
certificate: "%gssp_tiqr_remote_certificate%"
view_config:
title: %gssp_biometric_title%
page_title: %gssp_biometric_page_title%
explanation: %gssp_biometric_explanation%
initiate: %gssp_biometric_initiate%
gssf_id_mismatch: %gssp_biometric_gssf_id_mismatch%
title: "%gssp_tiqr_title%"
page_title: "%gssp_tiqr_page_title%"
explanation: "%gssp_tiqr_explanation%"
initiate: "%gssp_tiqr_initiate%"
gssf_id_mismatch: "%gssp_tiqr_gssf_id_mismatch%"
6 changes: 4 additions & 2 deletions app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ security:

default:
pattern: ^/authentication/(metadata|session-expired)$
logout_on_user_change: true
anonymous: ~

monitor:
Expand All @@ -22,11 +23,12 @@ security:

saml_based:
saml: true
logout_on_user_change: true
logout:
path: /logout
target: %logout_redirect_url%
target: "%logout_redirect_url%"
invalidate_session: true
csrf_token_generator: form.csrf_provider
csrf_token_generator: security.csrf.token_manager
csrf_parameter: 't'
csrf_token_id: 'registration_authority_logout_token'

Expand Down
23 changes: 13 additions & 10 deletions app/console
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#!/usr/bin/env php
<?php

set_time_limit(0);

require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\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
// for more information
//umask(0000);

set_time_limit(0);

/** @var Composer\Autoload\ClassLoader $loader */
$loader = require __DIR__.'/../app/autoload.php';

$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', ''))
&& $env !== 'prod'
&& $env !== 'build';
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';

if ($debug) {
Debug::enable(~E_USER_DEPRECATED);
Debug::enable();
}

$kernel = new AppKernel($env, $debug);
Expand Down
9 changes: 9 additions & 0 deletions app/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
<directory>../src/Surfnet/StepupRa/SamlStepupProviderBundle/Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory>../src</directory>
<exclude>
<directory>../src/Surfnet/StepupRa/RaBundle/Tests</directory>
<directory>../src/Surfnet/StepupRa/SamlStepupProviderBundle/Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
Loading

0 comments on commit 1466e6a

Please sign in to comment.