diff --git a/.travis.yml b/.travis.yml index a6a260df2..db68dd9f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,3 +32,4 @@ branches: only: - master - develop + - feature/fine-grained-authorization diff --git a/CHANGELOG.md b/CHANGELOG.md index c410a49c5..a8c9368af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 3.0.0 FGA (fine grained authorization) + +The new fine grained authorization logic will allow Ra's from other institutions to accredidate RA's on behalf of another organisation. This is determined based on the institution configuration. https://github.com/OpenConext/Stepup-Deploy/wiki/rfc-fine-grained-authorization/b6852587baee698cccae7ebc922f29552420a296 + +**Features & Bugfixes** +The changes to SelfService in regards to the FGA changes only where to remain compatible with API changes made for Stepup-RA. No new features have been added. + +## 2.10.5 +**Bugfix** +* Create a pdf base template to support local url's #168 + ## 2.10.4 **Improvement** * Optimized the PSR-4 autoload configuration diff --git a/app/Resources/views/pdf.html.twig b/app/Resources/views/pdf.html.twig new file mode 100644 index 000000000..9926a090f --- /dev/null +++ b/app/Resources/views/pdf.html.twig @@ -0,0 +1,58 @@ +{% extends 'MopaBootstrapBundle::base.html.twig' %} + +{% block title %} + {% if block('page_title') is not empty %}{{ block('page_title') }} — {% endif %} + {{ 'app.name'|trans }} +{% endblock title %} + +{% block head_style %} + + + +{% endblock head_style %} +{% block head_bottom %} +{% endblock head_bottom %} + +{% block navbar %} +{% endblock navbar %} + + {% block header %} + {% endblock header %} + + {% block page_header %} + + {% endblock page_header %} + + {% block content_row %} + {% block content %} + {% endblock content %} + {% endblock content_row %} + + {% block footer %} + {% endblock footer %} + +{% block foot_script %} + +{% endblock foot_script %} diff --git a/app/config/config.yml b/app/config/config.yml index 4d28fa1f7..992901f55 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -37,6 +37,7 @@ twig: exception_controller: SurfnetStepupSelfServiceSelfServiceBundle:Exception:show globals: global_view_parameters: "@self_service.service.global_view_parameters" + root_path: "%kernel.root_dir%" # Assetic Configuration assetic: diff --git a/build.xml b/build.xml index 56ca8a8a6..a3261eff5 100644 --- a/build.xml +++ b/build.xml @@ -2,7 +2,7 @@ + depends="php-lint-ci,phpmd-ci,phpcs-ci,phpcpd-ci,phpunit-ci,security-tests"/> @@ -82,4 +82,9 @@ + + + + + diff --git a/composer.json b/composer.json index ba340ab5f..2e723bd53 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "jms/translation-bundle": "~1.3.0", "guzzlehttp/guzzle": "^6", "surfnet/stepup-bundle": "~4.0", - "surfnet/stepup-middleware-client-bundle": "^2.4", + "surfnet/stepup-middleware-client-bundle": "^3.0", "surfnet/stepup-saml-bundle": "^4.1", "surfnet/stepup-u2f-bundle": "dev-develop", "mopa/composer-bridge": "~1.5", @@ -42,9 +42,8 @@ "phpmd/phpmd": "^2.6", "phpunit/phpunit": "^5.7", "sebastian/exporter": "~2.0", - "sensiolabs/security-checker": "^3.0", "sebastian/phpcpd": "^2.0", - "squizlabs/php_codesniffer": "^1.0", + "squizlabs/php_codesniffer": "^3.4", "symfony/phpunit-bridge": "^3.0" }, "scripts": { diff --git a/composer.lock b/composer.lock index 6db454360..c45bac6b0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "110fd2e0a66b37370aaf7ad10df0e32c", + "content-hash": "2bb70d27e1f4aa52aa09d6d53fd6ac05", "packages": [ { "name": "beberlei/assert", @@ -61,6 +61,62 @@ ], "time": "2018-06-11T17:15:25+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2018-10-18T06:09:13+00:00" + }, { "name": "doctrine/annotations", "version": "v1.4.0", @@ -680,32 +736,33 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -735,13 +792,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "incenteev/composer-parameter-handler", @@ -940,16 +998,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1014,7 +1072,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "moontoast/math", @@ -1192,16 +1250,16 @@ }, { "name": "mpdf/mpdf", - "version": "v7.1.4", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/mpdf/mpdf.git", - "reference": "349a1ffae7d04f0d976f619d6f00d8569a4a74c7" + "reference": "5a124ed382cf9241597c7ba12f98a756daa7f8df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/349a1ffae7d04f0d976f619d6f00d8569a4a74c7", - "reference": "349a1ffae7d04f0d976f619d6f00d8569a4a74c7", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/5a124ed382cf9241597c7ba12f98a756daa7f8df", + "reference": "5a124ed382cf9241597c7ba12f98a756daa7f8df", "shasum": "" }, "require": { @@ -1209,7 +1267,7 @@ "ext-mbstring": "*", "myclabs/deep-copy": "^1.7", "paragonie/random_compat": "^1.4|^2.0|9.99.99", - "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0", + "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0", "psr/log": "^1.0", "setasign/fpdi": "1.6.*" }, @@ -1227,7 +1285,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-development": "7.0-dev" + "dev-development": "7.x-dev" } }, "autoload": { @@ -1249,14 +1307,14 @@ "role": "Developer (retired)" } ], - "description": "A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support", + "description": "PHP library generating PDF files from UTF-8 encoded HTML", "homepage": "https://mpdf.github.io", "keywords": [ "pdf", "php", "utf-8" ], - "time": "2018-08-10T11:00:53+00:00" + "time": "2019-01-08T11:38:17+00:00" }, { "name": "myclabs/deep-copy", @@ -1460,16 +1518,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.17", + "version": "v2.0.18", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", "shasum": "" }, "require": { @@ -1505,7 +1563,7 @@ "pseudorandom", "random" ], - "time": "2018-07-04T16:31:37+00:00" + "time": "2019-01-03T20:59:08+00:00" }, { "name": "psr/cache", @@ -1703,16 +1761,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1746,7 +1804,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "psr/simple-cache", @@ -1796,6 +1854,46 @@ ], "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "ramsey/uuid", "version": "3.8.0", @@ -1880,24 +1978,22 @@ }, { "name": "robrichards/xmlseclibs", - "version": "3.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/robrichards/xmlseclibs.git", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781" + "reference": "406c68ac9124db033d079284b719958b829cb830" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/d937712f70f93a584eb0299ccd87dc6374003781", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781", + "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/406c68ac9124db033d079284b719958b829cb830", + "reference": "406c68ac9124db033d079284b719958b829cb830", "shasum": "" }, "require": { + "ext-openssl": "*", "php": ">= 5.4" }, - "suggest": { - "ext-openssl": "OpenSSL extension" - }, "type": "library", "autoload": { "psr-4": { @@ -1916,25 +2012,25 @@ "xml", "xmldsig" ], - "time": "2017-08-31T09:27:07+00:00" + "time": "2018-11-15T11:59:02+00:00" }, { "name": "sensio/distribution-bundle", - "version": "v5.0.22", + "version": "v5.0.24", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "209b11f8cee5bf71986dd703e45e27d3ed7a6d15" + "reference": "59eac70f15f97ee945924948a6f5e2f6f86b7a4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/209b11f8cee5bf71986dd703e45e27d3ed7a6d15", - "reference": "209b11f8cee5bf71986dd703e45e27d3ed7a6d15", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/59eac70f15f97ee945924948a6f5e2f6f86b7a4b", + "reference": "59eac70f15f97ee945924948a6f5e2f6f86b7a4b", "shasum": "" }, "require": { "php": ">=5.3.9", - "sensiolabs/security-checker": "~3.0|~4.0", + "sensiolabs/security-checker": "~5.0", "symfony/class-loader": "~2.3|~3.0", "symfony/config": "~2.3|~3.0", "symfony/dependency-injection": "~2.3|~3.0", @@ -1968,7 +2064,7 @@ "configuration", "distribution" ], - "time": "2018-06-07T06:22:12+00:00" + "time": "2018-12-14T17:36:15+00:00" }, { "name": "sensio/framework-extra-bundle", @@ -2042,20 +2138,22 @@ }, { "name": "sensiolabs/security-checker", - "version": "v3.0.7", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "59a6a299e2f5612dc8692d40e84373703a5df1b5" + "reference": "46be3f58adac13084497961e10eed9a7fb4d44d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/59a6a299e2f5612dc8692d40e84373703a5df1b5", - "reference": "59a6a299e2f5612dc8692d40e84373703a5df1b5", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/46be3f58adac13084497961e10eed9a7fb4d44d1", + "reference": "46be3f58adac13084497961e10eed9a7fb4d44d1", "shasum": "" }, "require": { - "symfony/console": "~2.0|~3.0" + "composer/ca-bundle": "^1.0", + "php": ">=5.5.9", + "symfony/console": "~2.7|~3.0|~4.0" }, "bin": [ "security-checker" @@ -2063,12 +2161,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "psr-0": { - "SensioLabs\\Security": "" + "psr-4": { + "SensioLabs\\Security\\": "SensioLabs/Security" } }, "notification-url": "https://packagist.org/downloads/", @@ -2082,7 +2180,7 @@ } ], "description": "A security checker for your composer.lock", - "time": "2017-03-29T09:29:53+00:00" + "time": "2018-12-19T17:14:59+00:00" }, { "name": "setasign/fpdi", @@ -2135,16 +2233,16 @@ }, { "name": "simplesamlphp/saml2", - "version": "v3.2", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/simplesamlphp/saml2.git", - "reference": "43590bc9614c1df5bd7b1639088f7d904842892b" + "reference": "513970e78c527d87a3358829d7c0f417267a582b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/43590bc9614c1df5bd7b1639088f7d904842892b", - "reference": "43590bc9614c1df5bd7b1639088f7d904842892b", + "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/513970e78c527d87a3358829d7c0f417267a582b", + "reference": "513970e78c527d87a3358829d7c0f417267a582b", "shasum": "" }, "require": { @@ -2157,11 +2255,11 @@ }, "require-dev": { "mockery/mockery": "~0.9", - "phpmd/phpmd": "~1.5", + "phpmd/phpmd": "~2.6", "phpunit/phpunit": "~4", - "sebastian/phpcpd": "~1.4", - "sensiolabs/security-checker": "~1.1", - "squizlabs/php_codesniffer": "~1.4" + "sebastian/phpcpd": "~2.0", + "sensiolabs/security-checker": "~4.1", + "squizlabs/php_codesniffer": "~3.2" }, "type": "library", "extra": { @@ -2188,20 +2286,20 @@ } ], "description": "SAML2 PHP library from SimpleSAMLphp", - "time": "2018-07-12T09:56:19+00:00" + "time": "2019-01-04T13:42:36+00:00" }, { "name": "surfnet/stepup-bundle", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/OpenConext/Stepup-bundle.git", - "reference": "5946dde19d5e095a5836d602b7abfa64cb71d6f1" + "reference": "3329ca027f57208d7a20882707ef4a01dd2a4fb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OpenConext/Stepup-bundle/zipball/5946dde19d5e095a5836d602b7abfa64cb71d6f1", - "reference": "5946dde19d5e095a5836d602b7abfa64cb71d6f1", + "url": "https://api.github.com/repos/OpenConext/Stepup-bundle/zipball/3329ca027f57208d7a20882707ef4a01dd2a4fb6", + "reference": "3329ca027f57208d7a20882707ef4a01dd2a4fb6", "shasum": "" }, "require": { @@ -2244,20 +2342,20 @@ "suaas", "surfnet" ], - "time": "2018-09-06T12:43:15+00:00" + "time": "2018-09-13T14:13:26+00:00" }, { "name": "surfnet/stepup-middleware-client-bundle", - "version": "2.4.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/OpenConext/Stepup-Middleware-clientbundle.git", - "reference": "d2aa7f06f9f56456d1b852b7ebca396686d0c51e" + "reference": "78f4d4d0d9875ca17f3c3087c2153db3e690f3e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OpenConext/Stepup-Middleware-clientbundle/zipball/d2aa7f06f9f56456d1b852b7ebca396686d0c51e", - "reference": "d2aa7f06f9f56456d1b852b7ebca396686d0c51e", + "url": "https://api.github.com/repos/OpenConext/Stepup-Middleware-clientbundle/zipball/78f4d4d0d9875ca17f3c3087c2153db3e690f3e0", + "reference": "78f4d4d0d9875ca17f3c3087c2153db3e690f3e0", "shasum": "" }, "require": { @@ -2278,12 +2376,12 @@ }, "require-dev": { "matthiasnoback/symfony-config-test": "0.*", - "mockery/mockery": "0.9.*", + "mockery/mockery": "^1.2", "phpmd/phpmd": "^2.0", - "phpunit/phpunit": "^4.0", + "phpunit/phpunit": "^4.0|^5.0|^6.0", "sebastian/phpcpd": "^2.0", - "sensiolabs/security-checker": "^2.0", - "squizlabs/php_codesniffer": "^1.0" + "sensiolabs/security-checker": "^5.0", + "squizlabs/php_codesniffer": "^3.0" }, "type": "library", "autoload": { @@ -2297,7 +2395,7 @@ "Apache-2.0" ], "description": "Symfony2 bundle for consuming the Step-up Middleware API.", - "time": "2018-09-04T10:01:29+00:00" + "time": "2019-01-21T10:46:44+00:00" }, { "name": "surfnet/stepup-saml-bundle", @@ -2465,16 +2563,16 @@ }, { "name": "symfony/monolog-bundle", - "version": "v3.3.0", + "version": "v3.3.1", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "8204f3cd7c1bd6a6e2955c0a34475243a7bd9802" + "reference": "572e143afc03419a75ab002c80a2fd99299195ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/8204f3cd7c1bd6a6e2955c0a34475243a7bd9802", - "reference": "8204f3cd7c1bd6a6e2955c0a34475243a7bd9802", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/572e143afc03419a75ab002c80a2fd99299195ff", + "reference": "572e143afc03419a75ab002c80a2fd99299195ff", "shasum": "" }, "require": { @@ -2524,11 +2622,11 @@ "log", "logging" ], - "time": "2018-06-04T05:55:43+00:00" + "time": "2018-11-04T09:58:13+00:00" }, { "name": "symfony/polyfill-apcu", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-apcu.git", @@ -2584,7 +2682,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2627,7 +2725,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -2642,7 +2740,7 @@ }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", @@ -2700,16 +2798,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2755,20 +2853,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/polyfill-php56", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "7b4fc009172cc0196535b0328bd1226284a28000" + "reference": "ff208829fe1aa48ab9af356992bb7199fed551af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/7b4fc009172cc0196535b0328bd1226284a28000", - "reference": "7b4fc009172cc0196535b0328bd1226284a28000", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ff208829fe1aa48ab9af356992bb7199fed551af", + "reference": "ff208829fe1aa48ab9af356992bb7199fed551af", "shasum": "" }, "require": { @@ -2811,20 +2909,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T06:26:08+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", "shasum": "" }, "require": { @@ -2870,20 +2968,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T06:26:08+00:00" }, { "name": "symfony/polyfill-util", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581" + "reference": "3b58903eae668d348a7126f999b0da0f2f93611c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8e15d04ba3440984d23e7964b2ee1d25c8de1581", - "reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/3b58903eae668d348a7126f999b0da0f2f93611c", + "reference": "3b58903eae668d348a7126f999b0da0f2f93611c", "shasum": "" }, "require": { @@ -2922,20 +3020,20 @@ "polyfill", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-30T16:36:12+00:00" }, { "name": "symfony/symfony", - "version": "v3.4.15", + "version": "v3.4.21", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "5bb5c2d4b0d5cf10672015b68519a199e6ac27c1" + "reference": "c7a57e0bcc3c57ae697f072b3e862487b6fd0030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/5bb5c2d4b0d5cf10672015b68519a199e6ac27c1", - "reference": "5bb5c2d4b0d5cf10672015b68519a199e6ac27c1", + "url": "https://api.github.com/repos/symfony/symfony/zipball/c7a57e0bcc3c57ae697f072b3e862487b6fd0030", + "reference": "c7a57e0bcc3c57ae697f072b3e862487b6fd0030", "shasum": "" }, "require": { @@ -3077,20 +3175,20 @@ "keywords": [ "framework" ], - "time": "2018-08-28T06:06:28+00:00" + "time": "2019-01-06T15:54:26+00:00" }, { "name": "twbs/bootstrap", - "version": "v3.3.7", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/twbs/bootstrap.git", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" + "reference": "4c547f2175b9a05aa43551f6927da83fe249ce42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/4c547f2175b9a05aa43551f6927da83fe249ce42", + "reference": "4c547f2175b9a05aa43551f6927da83fe249ce42", "shasum": "" }, "replace": { @@ -3099,7 +3197,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.4.x-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -3117,7 +3215,7 @@ } ], "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", - "homepage": "http://getbootstrap.com", + "homepage": "https://getbootstrap.com/", "keywords": [ "JS", "css", @@ -3128,20 +3226,20 @@ "responsive", "web" ], - "time": "2016-07-25T15:51:55+00:00" + "time": "2018-12-13T23:45:51+00:00" }, { "name": "twig/extensions", - "version": "v1.5.2", + "version": "v1.5.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82" + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/2c1a86526d0044065220d1b51ac08348bea5ca82", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", "shasum": "" }, "require": { @@ -3183,35 +3281,35 @@ "i18n", "text" ], - "time": "2018-05-22T13:26:07+00:00" + "time": "2018-12-05T18:34:18+00:00" }, { "name": "twig/twig", - "version": "v1.35.4", + "version": "v1.37.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a" + "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a", - "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62", + "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62", "shasum": "" }, "require": { - "php": ">=5.3.3", + "php": ">=5.4.0", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.3" + "symfony/phpunit-bridge": "^3.4.19|^4.1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.35-dev" + "dev-master": "1.37-dev" } }, "autoload": { @@ -3249,24 +3347,25 @@ "keywords": [ "templating" ], - "time": "2018-07-13T07:12:17+00:00" + "time": "2019-01-14T14:59:29+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -3299,7 +3398,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "yubico/u2flib-server", @@ -3486,16 +3585,16 @@ }, { "name": "mockery/mockery", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "99e29d3596b16dabe4982548527d5ddf90232e99" + "reference": "100633629bf76d57430b86b7098cd6beb996a35a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/99e29d3596b16dabe4982548527d5ddf90232e99", - "reference": "99e29d3596b16dabe4982548527d5ddf90232e99", + "url": "https://api.github.com/repos/mockery/mockery/zipball/100633629bf76d57430b86b7098cd6beb996a35a", + "reference": "100633629bf76d57430b86b7098cd6beb996a35a", "shasum": "" }, "require": { @@ -3504,8 +3603,7 @@ "php": ">=5.6.0" }, "require-dev": { - "phpdocumentor/phpdocumentor": "^2.9", - "phpunit/phpunit": "~5.7.10|~6.5" + "phpunit/phpunit": "~5.7.10|~6.5|~7.0" }, "type": "library", "extra": { @@ -3548,7 +3646,7 @@ "test double", "testing" ], - "time": "2018-05-08T08:54:48+00:00" + "time": "2018-10-02T21:52:37+00:00" }, { "name": "pdepend/pdepend", @@ -4860,61 +4958,37 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "1.5.6", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" + "reference": "379deb987e26c7cd103a7b387aea178baec96e48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", + "reference": "379deb987e26c7cd103a7b387aea178baec96e48", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", - "php": ">=5.1.2" + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, - "suggest": { - "phpunit/php-timer": "dev-master" + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-phpcs-fixer": "2.0.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/CommentParser/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -4925,26 +4999,26 @@ "role": "lead" } ], - "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "http://www.squizlabs.com/php-codesniffer", "keywords": [ "phpcs", "standards" ], - "time": "2014-12-04T22:32:15+00:00" + "time": "2018-12-19T23:57:18+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v3.4.15", + "version": "v3.4.21", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "f4fde1ede82c7ca2a4f06cf48521a185b26c0fed" + "reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/f4fde1ede82c7ca2a4f06cf48521a185b26c0fed", - "reference": "f4fde1ede82c7ca2a4f06cf48521a185b26c0fed", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5", + "reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5", "shasum": "" }, "require": { @@ -4997,7 +5071,7 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2018-08-27T15:17:06+00:00" + "time": "2019-01-01T13:45:19+00:00" }, { "name": "theseer/fdomdocument", diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php index 665bfc4c0..cff87aeb9 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php @@ -25,11 +25,12 @@ class EntryPointController extends Controller public function decideSecondFactorFlowAction() { $identity = $this->getIdentity(); + $institution = $identity->institution; /** @var SecondFactorService $service */ $service = $this->get('surfnet_stepup_self_service_self_service.service.second_factor'); - if ($service->doSecondFactorsExistForIdentity($identity->id)) { + if ($service->doSecondFactorsExistForIdentity($identity->id, $institution)) { return $this->redirect($this->generateUrl('ss_second_factor_list')); } else { return $this->redirect( diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php index 07860b1b7..5617201a3 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RegistrationController.php @@ -36,8 +36,10 @@ class RegistrationController extends Controller */ public function displaySecondFactorTypesAction() { + $institution = $this->getIdentity()->institution; + $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') - ->getInstitutionConfigurationOptionsFor($this->getIdentity()->institution); + ->getInstitutionConfigurationOptionsFor($institution); $identity = $this->getIdentity(); @@ -49,6 +51,7 @@ public function displaySecondFactorTypesAction() $secondFactors = $service->getSecondFactorsForIdentity( $identity, + $institution, $allSecondFactors, $institutionConfigurationOptions->allowedSecondFactors, $institutionConfigurationOptions->numberOfTokensPerIdentity @@ -126,36 +129,7 @@ public function verifyEmailAction(Request $request) */ public function registrationEmailSentAction($secondFactorId) { - $identity = $this->getIdentity(); - - /** @var \Surfnet\StepupMiddlewareClientBundle\Identity\Dto\VerifiedSecondFactor $secondFactor */ - $secondFactor = $this->get('surfnet_stepup_self_service_self_service.service.second_factor') - ->findOneVerified($secondFactorId); - - $parameters = [ - 'email' => $identity->email, - 'secondFactorId' => $secondFactor->id, - 'registrationCode' => $secondFactor->registrationCode, - 'expirationDate' => $secondFactor->registrationRequestedAt->add( - new DateInterval('P14D') - ), - 'locale' => $identity->preferredLocale, - 'verifyEmail' => $this->emailVerificationIsRequired(), - ]; - - $raService = $this->get('self_service.service.ra'); - $raLocationService = $this->get('self_service.service.ra_location'); - - $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') - ->getInstitutionConfigurationOptionsFor($identity->institution); - - if ($institutionConfigurationOptions->useRaLocations) { - $parameters['raLocations'] = $raLocationService->listRaLocationsFor($identity->institution); - } elseif (!$institutionConfigurationOptions->showRaaContactInformation) { - $parameters['ras'] = $raService->listRasWithoutRaas($identity->institution); - } else { - $parameters['ras'] = $raService->listRas($identity->institution); - } + $parameters = $this->buildRegistrationActionParameters($secondFactorId); return $this->render( 'SurfnetStepupSelfServiceSelfServiceBundle:Registration:registrationEmailSent.html.twig', @@ -169,8 +143,14 @@ public function registrationEmailSentAction($secondFactorId) */ public function registrationPdfAction($secondFactorId) { - $content = $this->registrationEmailSentAction($secondFactorId) - ->getContent(); + $parameters = $this->buildRegistrationActionParameters($secondFactorId); + + $response = $this->render( + 'SurfnetStepupSelfServiceSelfServiceBundle:Registration:registrationEmailSentPdf.html.twig', + $parameters + ); + $content = $response->getContent(); + $mpdf = new Mpdf( array( @@ -199,4 +179,41 @@ public function registrationPdfAction($secondFactorId) return $response; } + + + private function buildRegistrationActionParameters($secondFactorId) + { + $identity = $this->getIdentity(); + + /** @var \Surfnet\StepupMiddlewareClientBundle\Identity\Dto\VerifiedSecondFactor $secondFactor */ + $secondFactor = $this->get('surfnet_stepup_self_service_self_service.service.second_factor') + ->findOneVerified($secondFactorId); + + $parameters = [ + 'email' => $identity->email, + 'secondFactorId' => $secondFactor->id, + 'registrationCode' => $secondFactor->registrationCode, + 'expirationDate' => $secondFactor->registrationRequestedAt->add( + new DateInterval('P14D') + ), + 'locale' => $identity->preferredLocale, + 'verifyEmail' => $this->emailVerificationIsRequired(), + ]; + + $raService = $this->get('self_service.service.ra'); + $raLocationService = $this->get('self_service.service.ra_location'); + + $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') + ->getInstitutionConfigurationOptionsFor($identity->institution); + + if ($institutionConfigurationOptions->useRaLocations) { + $parameters['raLocations'] = $raLocationService->listRaLocationsFor($identity->institution); + } elseif (!$institutionConfigurationOptions->showRaaContactInformation) { + $parameters['ras'] = $raService->listRasWithoutRaas($identity->institution); + } else { + $parameters['ras'] = $raService->listRas($identity->institution); + } + + return $parameters; + } } diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SecondFactorController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SecondFactorController.php index 721bc0412..432318013 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SecondFactorController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SecondFactorController.php @@ -35,8 +35,9 @@ class SecondFactorController extends Controller public function listAction() { $identity = $this->getIdentity(); + $institution = $this->getIdentity()->institution; $institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options') - ->getInstitutionConfigurationOptionsFor($this->getIdentity()->institution); + ->getInstitutionConfigurationOptionsFor($institution); /** @var SecondFactorService $service */ $service = $this->get('surfnet_stepup_self_service_self_service.service.second_factor'); // Get all available second factors from the config. @@ -46,6 +47,7 @@ public function listAction() $secondFactors = $service->getSecondFactorsForIdentity( $identity, + $institution, $allSecondFactors, $institutionConfigurationOptions->allowedSecondFactors, $institutionConfigurationOptions->numberOfTokensPerIdentity @@ -73,10 +75,11 @@ public function listAction() public function revokeAction(Request $request, $state, $secondFactorId) { $identity = $this->getIdentity(); + $institution = $identity->institution; /** @var SecondFactorService $service */ $service = $this->get('surfnet_stepup_self_service_self_service.service.second_factor'); - if (!$service->identityHasSecondFactorOfStateWithId($identity->id, $state, $secondFactorId)) { + if (!$service->identityHasSecondFactorOfStateWithId($identity->id, $state, $secondFactorId, $institution)) { $this->get('logger')->error(sprintf( 'Identity "%s" tried to revoke "%s" second factor "%s", but does not own that second factor', $identity->id, diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/partial/registrationEmailSent.html.twig b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/partial/registrationEmailSent.html.twig new file mode 100644 index 000000000..803896459 --- /dev/null +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/partial/registrationEmailSent.html.twig @@ -0,0 +1,90 @@ +

{{ 'ss.registration.registration_email_sent.text.thank_you_for_registration'|trans }}

+ +

{{ 'ss.registration.registration_email_sent.text.activation_instructions'|trans }}

+ + + +
+ +

+ {{ 'ss.registration.registration_email_sent.label.expiration_date' + |trans({'%expirationDate%': expirationDate|localizeddate('full', 'none', locale)}) }} +

+ +
+
+ + + + + + + +
{{ 'ss.registration.registration_email_sent.label.registration_code'|trans }}{{ registrationCode }}
+
+
+ +
+ +

{{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent'|trans({'%email%': email}) }}

+ +
+ {% if not verifyEmail %} +

{{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_no_email'|trans }}

+ {% endif %} + +
+ + + + {{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_print'|trans }} + + + + {{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_pdf'|trans }} + +
+ +
+ +{% if raLocations is defined %} +

{{ 'ss.registration.registration_email_sent.title.list_of_ra_locations'|trans }}

+ + {% if raLocations.elements is empty %} +

{{ 'ss.registration.registration_email_sent.text.no_ra_locations_for_your_institution'|trans }}

+ {% else %} + + {% endif %} +{% else %} +

{{ 'ss.registration.registration_email_sent.title.list_of_ras'|trans }}

+ + {% if ras.elements is empty %} +

{{ 'ss.registration.registration_email_sent.text.no_ras_for_your_institution'|trans }}

+ {% else %} + + {% endif %} +{% endif %} diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSent.html.twig b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSent.html.twig index 3f5a7ca4b..2a3931860 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSent.html.twig +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSent.html.twig @@ -14,97 +14,7 @@ {% block content %}

{{ block('page_title') }}

- -

{{ 'ss.registration.registration_email_sent.text.thank_you_for_registration'|trans }}

- -

{{ 'ss.registration.registration_email_sent.text.activation_instructions'|trans }}

- - - -
- -

- {{ 'ss.registration.registration_email_sent.label.expiration_date' - |trans({'%expirationDate%': expirationDate|localizeddate('full', 'none', locale)}) }} -

- -
-
- - - - - - - -
{{ 'ss.registration.registration_email_sent.label.registration_code'|trans }}{{ registrationCode }}
-
-
- -
- -

{{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent'|trans({'%email%': email}) }}

- -
- {% if not verifyEmail %} -

{{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_no_email'|trans }}

- {% endif %} - -
- - - - {{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_print'|trans }} - - - - {{ 'ss.registration.registration_email_sent.text.registration_code_has_been_sent_pdf'|trans }} - -
- -
- - {% if raLocations is defined %} -

{{ 'ss.registration.registration_email_sent.title.list_of_ra_locations'|trans }}

- - {% if raLocations.elements is empty %} -

{{ 'ss.registration.registration_email_sent.text.no_ra_locations_for_your_institution'|trans }}

- {% else %} - - {% endif %} - {% else %} -

{{ 'ss.registration.registration_email_sent.title.list_of_ras'|trans }}

- - {% if ras.elements is empty %} -

{{ 'ss.registration.registration_email_sent.text.no_ras_for_your_institution'|trans }}

- {% else %} - - {% endif %} - {% endif %} + {% include 'SurfnetStepupSelfServiceSelfServiceBundle:Registration/partial:registrationEmailSent.html.twig' %} {% endblock %} {% block body_end %} diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSentPdf.html.twig b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSentPdf.html.twig new file mode 100644 index 000000000..6235f1578 --- /dev/null +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/views/Registration/registrationEmailSentPdf.html.twig @@ -0,0 +1,8 @@ +{% extends "::pdf.html.twig" %} + +{% block page_title %}{{ 'ss.registration.registration_email_sent.title'|trans }}{% endblock %} + +{% block content %} +

{{ block('page_title') }}

+ {% include 'SurfnetStepupSelfServiceSelfServiceBundle:Registration/partial:registrationEmailSent.html.twig' %} +{% endblock %} diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/IdentityService.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/IdentityService.php index 99f65cf4d..fb98ecf80 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/IdentityService.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/IdentityService.php @@ -108,8 +108,9 @@ public function supportsClass($class) */ public function findByNameIdAndInstitution($nameId, $institution) { - $searchQuery = new IdentitySearchQuery($institution); + $searchQuery = new IdentitySearchQuery(); $searchQuery->setNameId($nameId); + $searchQuery->setInstitution($institution); try { $result = $this->apiIdentityService->search($searchQuery); diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php index 2315cca16..1433e7a13 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php @@ -116,12 +116,13 @@ public function revoke(RevokeCommand $command) * is irrelevant. * * @param string $identityId + * @param string $institution * @return bool */ - public function doSecondFactorsExistForIdentity($identityId) + public function doSecondFactorsExistForIdentity($identityId, $institution) { $unverifiedSecondFactors = $this->findUnverifiedByIdentity($identityId); - $verifiedSecondFactors = $this->findVerifiedByIdentity($identityId); + $verifiedSecondFactors = $this->findVerifiedByIdentity($identityId, $institution); $vettedSecondFactors = $this->findVettedByIdentity($identityId); return $unverifiedSecondFactors->getTotalItems() + @@ -129,14 +130,14 @@ public function doSecondFactorsExistForIdentity($identityId) $vettedSecondFactors->getTotalItems() > 0; } - public function identityHasSecondFactorOfStateWithId($identityId, $state, $secondFactorId) + public function identityHasSecondFactorOfStateWithId($identityId, $state, $secondFactorId, $institution) { switch ($state) { case 'unverified': $secondFactors = $this->findUnverifiedByIdentity($identityId); break; case 'verified': - $secondFactors = $this->findVerifiedByIdentity($identityId); + $secondFactors = $this->findVerifiedByIdentity($identityId, $institution); break; case 'vetted': $secondFactors = $this->findVettedByIdentity($identityId); @@ -175,13 +176,20 @@ public function findUnverifiedByIdentity($identityId) * Returns the given registrant's verified second factors. * * @param string $identityId + * @param string $actorInstitution * @return VerifiedSecondFactorCollection */ - public function findVerifiedByIdentity($identityId) + public function findVerifiedByIdentity($identityId, $actorInstitution) { - return $this->secondFactors->searchVerified( - (new VerifiedSecondFactorSearchQuery())->setIdentityId($identityId) - ); + $query = new VerifiedSecondFactorSearchQuery(); + $query->setIdentityId($identityId); + // In self service the actor equals the identity of the user. + $query->setActorId($identityId); + $query->setActorInstitution($actorInstitution); + $query->setInstitution($actorInstitution); + // Actor and identity are equal in SelfService. + $query->setActorId($identityId); + return $this->secondFactors->searchVerified($query); } /** @@ -249,30 +257,6 @@ public function findUnverifiedByVerificationNonce($identityId, $verificationNonc } } - /** - * @param string $secondFactorId - * @param string $identityId - * @return null|string - */ - public function getRegistrationCode($secondFactorId, $identityId) - { - $query = (new VerifiedSecondFactorSearchQuery()) - ->setIdentityId($identityId) - ->setSecondFactorId($secondFactorId); - - /** @var VerifiedSecondFactor[] $verifiedSecondFactors */ - $verifiedSecondFactors = $this->secondFactors->searchVerified($query)->getElements(); - - switch (count($verifiedSecondFactors)) { - case 0: - return null; - case 1: - return reset($verifiedSecondFactors)->registrationCode; - default: - throw new LogicException('Searching by second factor ID cannot result in multiple results.'); - } - } - /** * @param array $allSecondFactors * @param UnverifiedSecondFactorCollection $unverifiedCollection @@ -310,6 +294,7 @@ private function filterAvailableSecondFactors(array $allSecondFactors, Collectio /** * @param $identity + * @param string $institution * @param $allSecondFactors * @param $allowedSecondFactors * @param $maximumNumberOfRegistrations @@ -317,12 +302,13 @@ private function filterAvailableSecondFactors(array $allSecondFactors, Collectio */ public function getSecondFactorsForIdentity( $identity, + $institution, $allSecondFactors, $allowedSecondFactors, $maximumNumberOfRegistrations ) { $unverified = $this->findUnverifiedByIdentity($identity->id); - $verified = $this->findVerifiedByIdentity($identity->id); + $verified = $this->findVerifiedByIdentity($identity->id, $institution); $vetted = $this->findVettedByIdentity($identity->id); // Determine which Second Factors are still available for registration. $available = $this->determineAvailable($allSecondFactors, $unverified, $verified, $vetted); diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorTypeCollection.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorTypeCollection.php index 407447067..e82d2d555 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorTypeCollection.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorTypeCollection.php @@ -18,7 +18,6 @@ namespace Surfnet\StepupSelfService\SelfServiceBundle\Service; - use Surfnet\StepupMiddlewareClientBundle\Identity\Dto\UnverifiedSecondFactorCollection; use Surfnet\StepupMiddlewareClientBundle\Identity\Dto\VerifiedSecondFactorCollection; use Surfnet\StepupMiddlewareClientBundle\Identity\Dto\VettedSecondFactorCollection;