From b737968ca65006085bc8a12a98d465acd074431f Mon Sep 17 00:00:00 2001 From: Pieter van der Meulen Date: Thu, 26 Jan 2017 15:06:52 +0100 Subject: [PATCH 1/4] Update because of move to OpenConext --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a785ffb05..665da979d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ Step-up Self-Service ==================== -[![Build Status](https://travis-ci.org/SURFnet/Stepup-SelfService.svg)](https://travis-ci.org/SURFnet/Stepup-SelfService) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SURFnet/Stepup-SelfService/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/SURFnet/Stepup-SelfService/?branch=develop) [![SensioLabs Insight](https://insight.sensiolabs.com/projects/d3edfdf9-2619-49d2-8f6f-cacc5492ce83/mini.png)](https://insight.sensiolabs.com/projects/d3edfdf9-2619-49d2-8f6f-cacc5492ce83) +[![Build Status](https://travis-ci.org/OpenConext/Stepup-SelfService.svg)](https://travis-ci.org/OpenConext/Stepup-SelfService) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/OpenConext/Stepup-SelfService/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/OpenConext/Stepup-SelfService/?branch=develop) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/d3edfdf9-2619-49d2-8f6f-cacc5492ce83/mini.png)](https://insight.sensiolabs.com/projects/d3edfdf9-2619-49d2-8f6f-cacc5492ce83) -This component is part of "Step-up Authentication as-a Service" and requires other supporting components to function. See [Stepup-Deploy](https://github.com/SURFnet/Stepup-Deploy) for an overview. +This component is part of "Step-up Authentication as-a Service" and requires other supporting components to function. See [Stepup-Deploy](https://github.com/OpenConext/Stepup-Deploy) for an overview. ## Requirements @@ -11,8 +11,8 @@ This component is part of "Step-up Authentication as-a Service" and requires oth * [Composer](https://getcomposer.org/) * A web server (Apache, Nginx) * Graylog2 (or disable this Monolog handler) - * A working [Gateway](https://github.com/SURFnet/Stepup-Gateway) - * Working [Middleware](https://github.com/SURFnet/Stepup-Middleware) + * A working [Gateway](https://github.com/OpenConext/Stepup-Gateway) + * Working [Middleware](https://github.com/OpenConext/Stepup-Middleware) ## Installation From 88dc7002f5aead95ad6bd615b540c9052adf64b4 Mon Sep 17 00:00:00 2001 From: Alex Rothuis Date: Mon, 13 Feb 2017 18:13:32 +0100 Subject: [PATCH 2/4] Apply Allowed Second Factors in SS --- .../Controller/RegistrationController.php | 10 ++++++++-- .../Registration/displaySecondFactorTypes.html.twig | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php index 201133f38..49d94ab57 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php @@ -31,11 +31,17 @@ class RegistrationController extends Controller */ public function displaySecondFactorTypesAction() { - $enabledSecondFactors = $this->getParameter('ss.enabled_second_factors'); + $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') + ->getInstitutionConfigurationOptionsFor($this->getIdentity()->institution); + + $allowedSecondFactors = array_intersect( + $institutionConfigurationOptions->allowedSecondFactors, + $this->getParameter('ss.enabled_second_factors') + ); return [ 'commonName' => $this->getIdentity()->commonName, - 'enabledSecondFactors' => array_combine($enabledSecondFactors, $enabledSecondFactors), + 'allowedSecondFactors' => array_combine($allowedSecondFactors, $allowedSecondFactors), 'tiqrAppAndroidUrl' => $this->getParameter('tiqr_app_android_url'), 'tiqrAppIosUrl' => $this->getParameter('tiqr_app_ios_url'), ]; diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig index 81de62695..a2497e1f7 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig @@ -12,7 +12,7 @@

{{ block('page_title') }}

- {% if enabledSecondFactors.sms is defined %} + {% if allowedSecondFactors.sms is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'sms', 'security': 2, @@ -21,7 +21,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if enabledSecondFactors.tiqr is defined %} + {% if allowedSecondFactors.tiqr is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'tiqr', 'security': 2, @@ -30,7 +30,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if enabledSecondFactors.yubikey is defined %} + {% if allowedSecondFactors.yubikey is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'yubikey', 'security': 3, @@ -39,7 +39,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if enabledSecondFactors.u2f is defined %} + {% if allowedSecondFactors.u2f is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'u2f', 'security': 3, @@ -48,7 +48,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if enabledSecondFactors.biometric is defined %} + {% if allowedSecondFactors.biometric is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'biometric', 'security': 3, From e6713ae7c28bcdbce199299df925d325eee6ee89 Mon Sep 17 00:00:00 2001 From: Alex Rothuis Date: Tue, 14 Feb 2017 13:43:53 +0100 Subject: [PATCH 3/4] Rename to availableSecondFactors, correct intersect --- .../Controller/RegistrationController.php | 13 ++++++++----- .../Registration/displaySecondFactorTypes.html.twig | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php index 49d94ab57..a96e708db 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php @@ -34,14 +34,17 @@ public function displaySecondFactorTypesAction() $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') ->getInstitutionConfigurationOptionsFor($this->getIdentity()->institution); - $allowedSecondFactors = array_intersect( - $institutionConfigurationOptions->allowedSecondFactors, - $this->getParameter('ss.enabled_second_factors') - ); + $availableSecondFactors = $this->getParameter('ss.enabled_second_factors'); + if (!empty($institutionConfigurationOptions->allowedSecondFactors)) { + $availableSecondFactors = array_intersect( + $availableSecondFactors, + $institutionConfigurationOptions->allowedSecondFactors + ); + } return [ 'commonName' => $this->getIdentity()->commonName, - 'allowedSecondFactors' => array_combine($allowedSecondFactors, $allowedSecondFactors), + 'availableSecondFactors' => array_combine($availableSecondFactors, $availableSecondFactors), 'tiqrAppAndroidUrl' => $this->getParameter('tiqr_app_android_url'), 'tiqrAppIosUrl' => $this->getParameter('tiqr_app_ios_url'), ]; diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig index a2497e1f7..62952eefd 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/displaySecondFactorTypes.html.twig @@ -12,7 +12,7 @@

{{ block('page_title') }}

- {% if allowedSecondFactors.sms is defined %} + {% if availableSecondFactors.sms is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'sms', 'security': 2, @@ -21,7 +21,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if allowedSecondFactors.tiqr is defined %} + {% if availableSecondFactors.tiqr is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'tiqr', 'security': 2, @@ -30,7 +30,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if allowedSecondFactors.yubikey is defined %} + {% if availableSecondFactors.yubikey is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'yubikey', 'security': 3, @@ -39,7 +39,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if allowedSecondFactors.u2f is defined %} + {% if availableSecondFactors.u2f is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'u2f', 'security': 3, @@ -48,7 +48,7 @@ 'tiqrAppIosUrl': tiqrAppIosUrl, } only %} {% endif %} - {% if allowedSecondFactors.biometric is defined %} + {% if availableSecondFactors.biometric is defined %} {% include 'SurfnetStepupSelfServiceSelfServiceBundle::Registration/partial/secondFactor.html.twig' with { 'type': 'biometric', 'security': 3, From 9487f5e07a17f3b1918f2021e3bb8f617bcf2dcd Mon Sep 17 00:00:00 2001 From: Alex Rothuis Date: Tue, 14 Feb 2017 17:36:30 +0100 Subject: [PATCH 4/4] Update stepup-middle-client-bundle --- composer.json | 2 +- composer.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index d4800c6f5..1fffa1d2e 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "fortawesome/font-awesome": "~4.2.0", "jms/translation-bundle": "~1.1.0", "jms/di-extra-bundle": "~1.4.0", - "surfnet/stepup-middleware-client-bundle": "^1.3", + "surfnet/stepup-middleware-client-bundle": "^1.5", "guzzlehttp/guzzle": "~4", "surfnet/stepup-saml-bundle": "^2.5", "surfnet/stepup-bundle": "^1.5", diff --git a/composer.lock b/composer.lock index 1fc6b4e56..7783a27ef 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "3939dd4d4dda140bc1d12134bf80962f", - "content-hash": "60b8aa1373bccb0093766bcef11e2319", + "hash": "30b097cad2369e8b1f692132b053a06a", + "content-hash": "4bf70b2ffbffe5ac5d3155bd776c5ac8", "packages": [ { "name": "beberlei/assert", @@ -1857,12 +1857,12 @@ "version": "1.5.0", "source": { "type": "git", - "url": "https://github.com/SURFnet/Stepup-bundle.git", + "url": "https://github.com/OpenConext/Stepup-bundle.git", "reference": "4ad7ebe9f9075ec39c5d1fc8449fe8fef33e60d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SURFnet/Stepup-bundle/zipball/4ad7ebe9f9075ec39c5d1fc8449fe8fef33e60d2", + "url": "https://api.github.com/repos/OpenConext/Stepup-bundle/zipball/4ad7ebe9f9075ec39c5d1fc8449fe8fef33e60d2", "reference": "4ad7ebe9f9075ec39c5d1fc8449fe8fef33e60d2", "shasum": "" }, @@ -1907,16 +1907,16 @@ }, { "name": "surfnet/stepup-middleware-client-bundle", - "version": "1.3.0", + "version": "1.5.0", "source": { "type": "git", - "url": "https://github.com/SURFnet/Stepup-Middleware-clientbundle.git", - "reference": "ee1dbf1664ca959500609793ec8c185a367cb9ca" + "url": "https://github.com/OpenConext/Stepup-Middleware-clientbundle.git", + "reference": "33db2b063ffcf5e2a3b0da2f2d5cd59072877c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SURFnet/Stepup-Middleware-clientbundle/zipball/ee1dbf1664ca959500609793ec8c185a367cb9ca", - "reference": "ee1dbf1664ca959500609793ec8c185a367cb9ca", + "url": "https://api.github.com/repos/OpenConext/Stepup-Middleware-clientbundle/zipball/33db2b063ffcf5e2a3b0da2f2d5cd59072877c66", + "reference": "33db2b063ffcf5e2a3b0da2f2d5cd59072877c66", "shasum": "" }, "require": { @@ -1952,19 +1952,19 @@ "Apache-2.0" ], "description": "Symfony2 bundle for consuming the Step-up Middleware API.", - "time": "2016-08-03 08:56:12" + "time": "2017-02-14 16:07:55" }, { "name": "surfnet/stepup-saml-bundle", "version": "2.5.0", "source": { "type": "git", - "url": "https://github.com/SURFnet/Stepup-saml-bundle.git", + "url": "https://github.com/OpenConext/Stepup-saml-bundle.git", "reference": "3ee050d16f76bf63b48fa01af3e75e1b42668d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SURFnet/Stepup-saml-bundle/zipball/3ee050d16f76bf63b48fa01af3e75e1b42668d72", + "url": "https://api.github.com/repos/OpenConext/Stepup-saml-bundle/zipball/3ee050d16f76bf63b48fa01af3e75e1b42668d72", "reference": "3ee050d16f76bf63b48fa01af3e75e1b42668d72", "shasum": "" }, @@ -2007,12 +2007,12 @@ "version": "dev-develop", "source": { "type": "git", - "url": "https://github.com/SURFnet/Stepup-u2f-bundle.git", + "url": "https://github.com/OpenConext/Stepup-u2f-bundle.git", "reference": "b28737d7b8df5ecbdf7a1e952ecfb530a2951c05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/zipball/b28737d7b8df5ecbdf7a1e952ecfb530a2951c05", + "url": "https://api.github.com/repos/OpenConext/Stepup-u2f-bundle/zipball/b28737d7b8df5ecbdf7a1e952ecfb530a2951c05", "reference": "b28737d7b8df5ecbdf7a1e952ecfb530a2951c05", "shasum": "" },