diff --git a/app/Resources/translations/messages.en_GB.xliff b/app/Resources/translations/messages.en_GB.xliff index 2eb4425b..81a875dc 100644 --- a/app/Resources/translations/messages.en_GB.xliff +++ b/app/Resources/translations/messages.en_GB.xliff @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -33,72 +33,72 @@ Nederlands - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.accredited_as_ra Accredited as RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.accredited_as_raa Accredited as RAA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.appointed_as_ra Appointed as RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.appointed_as_raa Appointed as RAA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.bootstrapped Identity and Token bootstrapped - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.created Identity Created - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.email_changed E-mail changed - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.email_verified E-mail verified - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.possession_proven Token possession proven - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.renamed Name changed - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.retracted_as_ra Removed as RA(A) - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.revoked Token revoked - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.revoked_by_ra Token revoked by RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.vetted Token vetted @@ -158,8 +158,8 @@ RA location successfully created - views/Exception/error.html.twig views/Exception/error404.html.twig + views/Exception/error.html.twig ra.error.button.go_home Back to Home @@ -254,8 +254,8 @@ Please report this error + error code to the helpdesk via support@surfconext.nl - views/Exception/error.html.twig views/Exception/error404.html.twig + views/Exception/error.html.twig ra.error.text.your_art_code The error code is: @@ -285,12 +285,12 @@ Due to an unknown reason, switching locales failed. - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.form.extension.ra_role_choice.ra RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.form.extension.ra_role_choice.raa RAA @@ -330,8 +330,8 @@ E-mail - Form/Type/ChangeRaLocationType.php Form/Type/SearchRaCandidatesType.php + Form/Type/ChangeRaLocationType.php ra.form.ra_search_ra_candidates.label.name Name @@ -476,7 +476,7 @@ Verify identity - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.amend_ra_info.error.middleware_command_failed The amendment of the RA's information failed due to a server error. @@ -564,7 +564,7 @@ The Registration Authority has been granted the selected role - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.create_ra.error.middleware_command_failed The identity could not be granted the chosen role due to a server error. @@ -714,8 +714,8 @@ Change Role - views/RaManagement/manage.html.twig views/Vetting/verifyIdentity.html.twig + views/RaManagement/manage.html.twig ra.management.overview.common_name Name @@ -740,17 +740,17 @@ Role - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.ra RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.raa RAA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.sraa SRAA @@ -1127,7 +1127,7 @@ Identity verification failed - RaBundle/Controller/VettingController.php + RaBundle/Controller/VettingController.php Resources/views/translations.html.twig ra.verify_identity.registration_code_expired The activation code has expired. First, delete the current token registration of the user (by RA or user). The user then starts a new registration on %self_service_url% and will receive a new activation code that is valid for 14 days. @@ -1151,59 +1151,19 @@ Form/Type/VerifyIdentityType.php Form/Type/VerifyPhoneNumberType.php Vetting/partial/cancelVettingProcedure.html.twig + views/Vetting/verifyIdentity.html.twig Vetting/Sms/provePossession.html.twig Vetting/Sms/sendChallenge.html.twig - views/Vetting/verifyIdentity.html.twig ra.vetting.button.cancel_procedure Cancel + RaBundle/Controller/VettingController.php + RaBundle/Controller/VettingController.php Controller/Vetting/SmsController.php - RaBundle/Controller/VettingController.php - RaBundle/Controller/VettingController.php ra.vetting.flash.cancelled The vetting procedure was cancelled. - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.button.initiate - Verify biometrics - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.error.gssf_id_mismatch - The biometric device returned a different ID than was registered in the Self-Service application. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.text.explanation - Click the button below to verify the registrant biometrically. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.title.page - Verify biometrics - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.button.initiate - Verify with Tiqr - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.error.gssf_id_mismatch - The Tiqr server responded with an ID that doesn't match the requested ID the registrant registered with using the Self-Service application. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.text.explanation - Click the button below to verify the registrant owns the Tiqr account he or she registered with in the Self-Service application. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.title.page - Verify with Tiqr - Vetting/partial/progressBar.html.twig ra.vetting.progress_bar.enter_registration_code @@ -1250,7 +1210,7 @@ Token type disabled - RaBundle/Service/VettingService.php + RaBundle/Service/VettingService.php ra.vetting.sms.challenge_body Your code: %challenge% @@ -1300,12 +1260,12 @@ Home - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.vetting.u2f.alert.device_reported_an_error The U2F device reported an error. Try again or visit your IT helpdesk. - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.vetting.u2f.alert.error The authentication using the U2F device failed. Try again or visit your IT helpdesk. diff --git a/app/Resources/translations/messages.nl_NL.xliff b/app/Resources/translations/messages.nl_NL.xliff index 5987368a..0564dc2a 100644 --- a/app/Resources/translations/messages.nl_NL.xliff +++ b/app/Resources/translations/messages.nl_NL.xliff @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -33,72 +33,72 @@ Nederlands - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.accredited_as_ra Geaccrediteerd als RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.accredited_as_raa Geaccrediteerd als RAA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.appointed_as_ra RA rol toegewezen gekregen - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.appointed_as_raa RAA rol toegewezen gekregen - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.bootstrapped Identiteit en Token gebootstrapped - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.created Identiteit aangemaakt - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.email_changed E-mail gewijzigd - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.email_verified E-mail geverifieerd - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.possession_proven Bezit aangetoond - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.renamed Naam gewijzigd - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.retracted_as_ra Verwijderd als RA(A) - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.revoked Token verwijderd - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.revoked_by_ra Token verwijderd door RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.auditlog.action.vetted Token gevet @@ -158,8 +158,8 @@ RA-locatie succesvol aangemaakt - views/Exception/error.html.twig views/Exception/error404.html.twig + views/Exception/error.html.twig ra.error.button.go_home Terug naar Home @@ -254,8 +254,8 @@ Meld deze error code aan de helpdesk via support@surfconext.nl - views/Exception/error.html.twig views/Exception/error404.html.twig + views/Exception/error.html.twig ra.error.text.your_art_code De fout code is: @@ -285,12 +285,12 @@ Het wisselen van taal is mislukt wegens een onbekende reden. - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.form.extension.ra_role_choice.ra RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.form.extension.ra_role_choice.raa RAA @@ -330,8 +330,8 @@ E-mail - Form/Type/ChangeRaLocationType.php Form/Type/SearchRaCandidatesType.php + Form/Type/ChangeRaLocationType.php ra.form.ra_search_ra_candidates.label.name Naam @@ -476,7 +476,7 @@ Verifieer identiteit - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.amend_ra_info.error.middleware_command_failed Het wijzigen van de gegevens van de RA is mislukt vanwege een serverfout. @@ -564,7 +564,7 @@ De Registratie Authoriteit heeft de gekozen rol toegewezen gekregen - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.create_ra.error.middleware_command_failed De gekozen rol kon niet aan de identiteit toegekend worden vanwege een serverfout. @@ -714,8 +714,8 @@ Verander Rol - views/RaManagement/manage.html.twig views/Vetting/verifyIdentity.html.twig + views/RaManagement/manage.html.twig ra.management.overview.common_name Naam @@ -740,17 +740,17 @@ Rol - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.ra RA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.raa RAA - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.management.overview.role.value.sraa SRAA @@ -1127,7 +1127,7 @@ De verificatie van de identiteit is mislukt - RaBundle/Controller/VettingController.php + RaBundle/Controller/VettingController.php Resources/views/translations.html.twig ra.verify_identity.registration_code_expired De activatie code is verlopen. Verwijder eerst de huidige token registratie (door RA of gebruiker). De gebruiker start vervolgens een nieuwe registratie via %self_service_url% en ontvangt een nieuwe activatiecode die weer 14 dagen geldig blijft. @@ -1151,59 +1151,19 @@ Form/Type/VerifyIdentityType.php Form/Type/VerifyPhoneNumberType.php Vetting/partial/cancelVettingProcedure.html.twig + views/Vetting/verifyIdentity.html.twig Vetting/Sms/provePossession.html.twig Vetting/Sms/sendChallenge.html.twig - views/Vetting/verifyIdentity.html.twig ra.vetting.button.cancel_procedure Annuleren + RaBundle/Controller/VettingController.php + RaBundle/Controller/VettingController.php Controller/Vetting/SmsController.php - RaBundle/Controller/VettingController.php - RaBundle/Controller/VettingController.php ra.vetting.flash.cancelled De activatieprocedure is afgebroken. - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.button.initiate - Biometrie verifiëren - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.error.gssf_id_mismatch - Het biometrisch apparaat heeft een ID teruggegeven dat niet overeenkomt met het gevraagde ID, dat de registrant heeft geregistreerd in de Self-Service-applicatie. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.text.explanation - Klik de knop hieronder om de registrant biometrisch te verifiëren. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.biometric.title.page - Biometrie verifiëren - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.button.initiate - Verifiëren bij Tiqr - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.error.gssf_id_mismatch - De Tiqr-server heeft een ID teruggegeven dat niet overeenkomt met het gevraagde ID, dat de registrant heeft geregistreerd in de Self-Service-applicatie. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.text.explanation - Klik de knop hieronder om te verifiëren dat de registrant het Tiqr-account bezit dat hij of zij gebruikt heeft in de Self-Service-applicatie. - - - Resources/views/translations.html.twig - ra.vetting.gssf.initiate.tiqr.title.page - Tiqr verifiëren - Vetting/partial/progressBar.html.twig ra.vetting.progress_bar.enter_registration_code @@ -1250,7 +1210,7 @@ Tokentype uitgeschakeld - RaBundle/Service/VettingService.php + RaBundle/Service/VettingService.php ra.vetting.sms.challenge_body Uw SMS-code: %challenge% @@ -1300,12 +1260,12 @@ Home - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.vetting.u2f.alert.device_reported_an_error Het U2F-apparaat heeft een foutmelding gerapporteerd. Probeer het opnieuw of neem contact op met de IT-helpdesk. - Resources/views/translations.html.twig + Resources/views/translations.html.twig ra.vetting.u2f.alert.error De authenticate met het U2F-apparaat is mislukt. Probeer het opnieuw of neem contact op met de IT-helpdesk. diff --git a/app/Resources/translations/validators.en_GB.xliff b/app/Resources/translations/validators.en_GB.xliff index c34632c9..283c1a23 100644 --- a/app/Resources/translations/validators.en_GB.xliff +++ b/app/Resources/translations/validators.en_GB.xliff @@ -1,11 +1,15 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
+ + middleware_client.dto.configuration.allowed_second_factors.must_be_array + middleware_client.dto.configuration.allowed_second_factors.must_be_array + middleware_client.dto.configuration.show_raa_contact_information.must_be_boolean Show RAA Contact Information option must be boolean. diff --git a/app/Resources/translations/validators.nl_NL.xliff b/app/Resources/translations/validators.nl_NL.xliff index c079e317..3ed6db7d 100644 --- a/app/Resources/translations/validators.nl_NL.xliff +++ b/app/Resources/translations/validators.nl_NL.xliff @@ -1,11 +1,15 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
+ + middleware_client.dto.configuration.allowed_second_factors.must_be_array + middleware_client.dto.configuration.allowed_second_factors.must_be_array + middleware_client.dto.configuration.show_raa_contact_information.must_be_boolean Show RAA Contact Information option must be boolean. diff --git a/app/config/config.yml b/app/config/config.yml index 5a727b5d..722c5b87 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -76,6 +76,7 @@ services: surfnet_stepup_ra_ra: 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%" diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index c5e8ab42..d78d7e67 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -39,6 +39,11 @@ parameters: enabled_second_factors: - sms - yubikey + enabled_generic_second_factors: + biometric: + loa: 3 + tiqr: + loa: 3 graylog_hostname: 'g2-dev.stepup.coin.surf.net' asset_version: 1 diff --git a/app/config/samlstepupproviders.yml b/app/config/samlstepupproviders.yml index 9babdc07..615857dc 100644 --- a/app/config/samlstepupproviders.yml +++ b/app/config/samlstepupproviders.yml @@ -18,6 +18,11 @@ surfnet_stepup_ra_saml_stepup_provider: entity_id: %gssp_tiqr_remote_entity_id% sso_url: %gssp_tiqr_remote_sso_url% certificate: %gssp_tiqr_remote_certificate% + view_config: + 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: @@ -30,3 +35,8 @@ surfnet_stepup_ra_saml_stepup_provider: entity_id: %gssp_biometric_remote_entity_id% sso_url: %gssp_biometric_remote_sso_url% certificate: %gssp_biometric_remote_certificate% + view_config: + page_title: %gssp_biometric_page_title% + explanation: %gssp_biometric_explanation% + initiate: %gssp_biometric_initiate% + gssf_id_mismatch: %gssp_biometric_gssf_id_mismatch% \ No newline at end of file diff --git a/app/config/samlstepupproviders_parameters.yml.dist b/app/config/samlstepupproviders_parameters.yml.dist index d04af2ff..bcddceb2 100644 --- a/app/config/samlstepupproviders_parameters.yml.dist +++ b/app/config/samlstepupproviders_parameters.yml.dist @@ -6,6 +6,18 @@ parameters: gssp_tiqr_remote_entity_id: 'https://actual-gssp.entity-id.tld' gssp_tiqr_remote_sso_url: 'https://actual-gssp.entity-id.tld/single-sign-on/url' gssp_tiqr_remote_certificate: 'The contents of the certificate published by the gssp' + gssp_tiqr_page_title: + en_GB: 'EN ra.vetting.gssf.initiate.tiqr.title.page' + nl_NL: 'NL ra.vetting.gssf.initiate.tiqr.title.page' + gssp_tiqr_explanation: + en_GB: 'EN ra.vetting.gssf.initiate.tiqr.text.explanation' + nl_NL: 'NL ra.vetting.gssf.initiate.tiqr.text.explanation' + gssp_tiqr_initiate: + en_GB: 'EN ra.vetting.gssf.initiate.tiqr.button.initiate' + nl_NL: 'NL ra.vetting.gssf.initiate.tiqr.button.initiate' + gssp_tiqr_gssf_id_mismatch: + en_GB: 'EN ra.vetting.gssf.initiate.tiqr.error.gssf_id_mismatch' + nl_NL: 'NL ra.vetting.gssf.initiate.tiqr.error.gssf_id_mismatch' gssp_biometric_sp_publickey: '/full/path/to/the/gateway-as-sp/public-key-file.cer' gssp_biometric_sp_privatekey: '/full/path/to/the/gateway-as-sp/private-key-file.pem' gssp_biometric_metadata_publickey: '/full/path/to/the/gateway-metadata/public-key-file.cer' @@ -13,3 +25,15 @@ parameters: gssp_biometric_remote_entity_id: 'https://actual-gssp.entity-id.tld' gssp_biometric_remote_sso_url: 'https://actual-gssp.entity-id.tld/single-sign-on/url' gssp_biometric_remote_certificate: 'The contents of the certificate published by the gssp' + gssp_biometric_page_title: + en_GB: 'EN ra.vetting.gssf.initiate.biometric.title.page' + nl_NL: 'NL ra.vetting.gssf.initiate.biometric.title.page' + gssp_biometric_explanation: + en_GB: 'EN ra.vetting.gssf.initiate.biometric.text.explanation' + nl_NL: 'NL ra.vetting.gssf.initiate.biometric.text.explanation' + gssp_biometric_initiate: + en_GB: 'EN ra.vetting.gssf.initiate.biometric.button.initiate' + nl_NL: 'NL ra.vetting.gssf.initiate.biometric.button.initiate' + gssp_biometric_gssf_id_mismatch: + en_GB: 'EN ra.vetting.gssf.initiate.biometric.error.gssf_id_mismatch' + nl_NL: 'NL ra.vetting.gssf.initiate.biometric.error.gssf_id_mismatch' \ No newline at end of file diff --git a/composer.json b/composer.json index 730969b5..1d5af0fa 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "jms/di-extra-bundle": "~1.4.0", "surfnet/stepup-middleware-client-bundle": "^2.0", "surfnet/stepup-saml-bundle": "^2.5", - "surfnet/stepup-bundle": "^1.7", + "surfnet/stepup-bundle": "^2.0", "surfnet/stepup-u2f-bundle": "dev-develop", "guzzlehttp/guzzle": "^6", "knplabs/knp-paginator-bundle": "~2.4", diff --git a/composer.lock b/composer.lock index a78eb691..963c5264 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": "3aa6c3ba125a0d8d07cf999fecd8b157", + "content-hash": "a58e344cdaaa088e470fbaae634e9ed7", "packages": [ { "name": "beberlei/assert", @@ -2092,16 +2092,16 @@ }, { "name": "surfnet/stepup-bundle", - "version": "1.7.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/OpenConext/Stepup-bundle.git", - "reference": "084b1e11781ca3f526e32a486f75a7e6a953e5fc" + "reference": "0766c91a6b391739d9fe4693f684ef1332342df4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OpenConext/Stepup-bundle/zipball/084b1e11781ca3f526e32a486f75a7e6a953e5fc", - "reference": "084b1e11781ca3f526e32a486f75a7e6a953e5fc", + "url": "https://api.github.com/repos/OpenConext/Stepup-bundle/zipball/0766c91a6b391739d9fe4693f684ef1332342df4", + "reference": "0766c91a6b391739d9fe4693f684ef1332342df4", "shasum": "" }, "require": { @@ -2145,7 +2145,7 @@ "suaas", "surfnet" ], - "time": "2017-03-07T13:44:04+00:00" + "time": "2017-06-14T13:03:51+00:00" }, { "name": "surfnet/stepup-middleware-client-bundle", @@ -3121,12 +3121,12 @@ "version": "0.9.5", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", + "url": "https://github.com/mockery/mockery.git", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", + "url": "https://api.github.com/repos/mockery/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", "shasum": "" }, diff --git a/src/Surfnet/StepupRa/RaBundle/Controller/Vetting/GssfController.php b/src/Surfnet/StepupRa/RaBundle/Controller/Vetting/GssfController.php index 37b344e5..c3203f69 100644 --- a/src/Surfnet/StepupRa/RaBundle/Controller/Vetting/GssfController.php +++ b/src/Surfnet/StepupRa/RaBundle/Controller/Vetting/GssfController.php @@ -25,6 +25,7 @@ use Surfnet\SamlBundle\SAML2\Response\Assertion\InResponseTo; use Surfnet\StepupRa\RaBundle\Exception\RuntimeException; use Surfnet\StepupRa\RaBundle\Service\VettingService; +use Surfnet\StepupRa\SamlStepupProviderBundle\Provider\ViewConfig; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; @@ -253,11 +254,28 @@ private function getVettingService() */ private function renderInitiateForm($procedureId, $provider, array $parameters = []) { - $form = $this->createForm('ra_initiate_gssf', null, ['procedureId' => $procedureId, 'provider' => $provider]); + /** @var ViewConfig $secondFactorConfig */ + $secondFactorConfig = $this->get("gssp.view_config.{$provider}"); + + $form = $this->createForm( + 'ra_initiate_gssf', + null, + [ + 'procedureId' => $procedureId, + 'provider' => $provider, + /** @Ignore from translation message extraction */ + 'label' => $secondFactorConfig->getInitiate() + ] + ); $templateParameters = array_merge( $parameters, - ['form' => $form->createView(), 'procedureId' => $procedureId, 'provider' => $provider] + [ + 'form' => $form->createView(), + 'procedureId' => $procedureId, + 'provider' => $provider, + 'secondFactorConfig' => $secondFactorConfig + ] ); return $this->render('SurfnetStepupRaRaBundle:Vetting/Gssf:initiate.html.twig', $templateParameters); diff --git a/src/Surfnet/StepupRa/RaBundle/DependencyInjection/Configuration.php b/src/Surfnet/StepupRa/RaBundle/DependencyInjection/Configuration.php index c628e896..e4fdf999 100644 --- a/src/Surfnet/StepupRa/RaBundle/DependencyInjection/Configuration.php +++ b/src/Surfnet/StepupRa/RaBundle/DependencyInjection/Configuration.php @@ -18,9 +18,6 @@ namespace Surfnet\StepupRa\RaBundle\DependencyInjection; -use Surfnet\StepupBundle\Exception\DomainException; -use Surfnet\StepupBundle\Exception\InvalidArgumentException; -use Surfnet\StepupBundle\Value\SecondFactorType; use Symfony\Component\Config\Definition\Builder\NodeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -68,25 +65,17 @@ private function appendSecondFactorTypesConfiguration(NodeBuilder $childNodes) ->arrayNode('enabled_second_factors') ->isRequired() ->prototype('scalar') - ->validate() - ->ifTrue( - function ($type) { - try { - new SecondFactorType($type); - } catch (InvalidArgumentException $e) { - return true; - } catch (DomainException $e) { - return true; - } - } - ) - ->thenInvalid( - 'Enabled second factor type "%s" is not one of the valid types. See SecondFactorType' - ) - ->end() + ->end(); + $childNodes + ->arrayNode('enabled_generic_second_factors') + ->isRequired() + ->prototype('array') + ->children() + ->scalarNode('loa') + ->isRequired() + ->info('The lao level of the Gssf') ->end() - ->end() - ->end(); + ->end(); } /** diff --git a/src/Surfnet/StepupRa/RaBundle/DependencyInjection/SurfnetStepupRaRaExtension.php b/src/Surfnet/StepupRa/RaBundle/DependencyInjection/SurfnetStepupRaRaExtension.php index eea12e6a..5a8c8792 100644 --- a/src/Surfnet/StepupRa/RaBundle/DependencyInjection/SurfnetStepupRaRaExtension.php +++ b/src/Surfnet/StepupRa/RaBundle/DependencyInjection/SurfnetStepupRaRaExtension.php @@ -40,7 +40,11 @@ public function load(array $configs, ContainerBuilder $container) // inject the required loa as parameter into the service container $container->setParameter('surfnet_stepup_ra.security.required_loa', $config['required_loa']); - $container->setParameter('surfnet_stepup_ra.enabled_second_factors', $config['enabled_second_factors']); + $gssfSecondFactors = array_keys($config['enabled_generic_second_factors']); + $container->setParameter( + 'surfnet_stepup_ra.enabled_second_factors', + array_merge($config['enabled_second_factors'], $gssfSecondFactors) + ); $container->setParameter( 'ra.security.authentication.session.maximum_absolute_lifetime_in_seconds', diff --git a/src/Surfnet/StepupRa/RaBundle/Form/Type/InitiateGssfType.php b/src/Surfnet/StepupRa/RaBundle/Form/Type/InitiateGssfType.php index b4e915e4..41b552f3 100644 --- a/src/Surfnet/StepupRa/RaBundle/Form/Type/InitiateGssfType.php +++ b/src/Surfnet/StepupRa/RaBundle/Form/Type/InitiateGssfType.php @@ -45,7 +45,8 @@ public function buildForm(FormBuilderInterface $builder, array $options) $builder ->add('submit', 'submit', [ 'attr' => ['class' => 'btn btn-primary'], - 'label' => /** @Ignore */ 'ra.vetting.gssf.initiate.' . $options['provider'] . '.button.initiate' + /** @Ignore */ + 'label' => $options['label'] ]) ->setAction($action); } diff --git a/src/Surfnet/StepupRa/RaBundle/Resources/config/services.yml b/src/Surfnet/StepupRa/RaBundle/Resources/config/services.yml index 76f3da7c..fe48a51d 100644 --- a/src/Surfnet/StepupRa/RaBundle/Resources/config/services.yml +++ b/src/Surfnet/StepupRa/RaBundle/Resources/config/services.yml @@ -100,6 +100,7 @@ services: - "@ra.repository.vetting_procedure" - "@translator" - "@ra.service.identity" + - "@surfnet_stepup.service.second_factor_type" ra.service.yubikey: public: false @@ -185,6 +186,7 @@ services: - "@surfnet_stepup_middleware_client.identity.service.ra_candidate" - "@ra.service.command" - "@logger" + - "@surfnet_stepup.service.second_factor_type" ra.service.ra_location: class: Surfnet\StepupRa\RaBundle\Service\RaLocationService diff --git a/src/Surfnet/StepupRa/RaBundle/Resources/views/Vetting/Gssf/initiate.html.twig b/src/Surfnet/StepupRa/RaBundle/Resources/views/Vetting/Gssf/initiate.html.twig index df917c8e..c80b767b 100644 --- a/src/Surfnet/StepupRa/RaBundle/Resources/views/Vetting/Gssf/initiate.html.twig +++ b/src/Surfnet/StepupRa/RaBundle/Resources/views/Vetting/Gssf/initiate.html.twig @@ -1,6 +1,6 @@ {% extends "::base.html.twig" %} -{% block page_title %}{{ ('ra.vetting.gssf.initiate.' ~ provider ~ '.title.page')|trans }}{% endblock %} +{% block page_title %}{{ secondFactorConfig.getPageTitle() }}{% endblock %} {% block page_header %} {{ parent() }} @@ -11,12 +11,12 @@ {% block content %}

{{ block('page_title') }}

-

{{ ('ra.vetting.gssf.initiate.' ~ provider ~ '.text.explanation')|trans }}

+

{{ secondFactorConfig.getExplanation() }}


{% if gssfIdMismatch is defined %} -
{{ ('ra.vetting.gssf.initiate.' ~ provider ~ '.error.gssf_id_mismatch')|trans }}
+
{{ secondFactorConfig.getGssfIdMismatch() }}
{% endif %} {{ form(form) }} diff --git a/src/Surfnet/StepupRa/RaBundle/Resources/views/translations.html.twig b/src/Surfnet/StepupRa/RaBundle/Resources/views/translations.html.twig index 1d1b0a49..6191101c 100644 --- a/src/Surfnet/StepupRa/RaBundle/Resources/views/translations.html.twig +++ b/src/Surfnet/StepupRa/RaBundle/Resources/views/translations.html.twig @@ -36,16 +36,6 @@ {{ 'ra.second_factor.search.status.vetted'|trans }} {{ 'ra.second_factor.search.status.revoked'|trans }} -{# GssfController #} -{{ ('ra.vetting.gssf.initiate.tiqr.title.page')|trans }} -{{ ('ra.vetting.gssf.initiate.tiqr.text.explanation')|trans }} -{{ ('ra.vetting.gssf.initiate.tiqr.button.initiate')|trans }} -{{ ('ra.vetting.gssf.initiate.tiqr.error.gssf_id_mismatch')|trans }} -{{ ('ra.vetting.gssf.initiate.biometric.title.page')|trans }} -{{ ('ra.vetting.gssf.initiate.biometric.text.explanation')|trans }} -{{ ('ra.vetting.gssf.initiate.biometric.button.initiate')|trans }} -{{ ('ra.vetting.gssf.initiate.biometric.error.gssf_id_mismatch')|trans }} - {# RaRoleChoiceList labels #} {{ ('ra.form.extension.ra_role_choice.ra'|trans) }} {{ ('ra.form.extension.ra_role_choice.raa'|trans) }} diff --git a/src/Surfnet/StepupRa/RaBundle/Service/RaCandidateService.php b/src/Surfnet/StepupRa/RaBundle/Service/RaCandidateService.php index 70f90ac5..41a59369 100644 --- a/src/Surfnet/StepupRa/RaBundle/Service/RaCandidateService.php +++ b/src/Surfnet/StepupRa/RaBundle/Service/RaCandidateService.php @@ -19,6 +19,7 @@ namespace Surfnet\StepupRa\RaBundle\Service; use Psr\Log\LoggerInterface; +use Surfnet\StepupBundle\Service\SecondFactorTypeService; use Surfnet\StepupBundle\Value\Loa; use Surfnet\StepupBundle\Value\SecondFactorType; use Surfnet\StepupMiddlewareClient\Identity\Dto\RaCandidateSearchQuery; @@ -28,6 +29,9 @@ use Surfnet\StepupRa\RaBundle\Command\SearchRaCandidatesCommand; use Surfnet\StepupRa\RaBundle\Exception\InvalidArgumentException; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class RaCandidateService { /** @@ -45,14 +49,21 @@ class RaCandidateService */ private $logger; + /** + * @var SecondFactorTypeService + */ + private $secondFactorTypeService; + public function __construct( ApiRaCandidateService $raCandidateService, CommandService $commandService, - LoggerInterface $logger + LoggerInterface $logger, + SecondFactorTypeService $secondFactorTypeService ) { $this->apiRaCandidateService = $raCandidateService; $this->commandService = $commandService; $this->logger = $logger; + $this->secondFactorTypeService = $secondFactorTypeService; } /** @@ -129,13 +140,11 @@ public function accreditCandidate(AccreditCandidateCommand $command) private function getLoa3SecondFactorTypes() { $loa3 = new Loa(Loa::LOA_3, 'LOA3'); - return array_filter( - SecondFactorType::getAvailableSecondFactorTypes(), + $this->secondFactorTypeService->getAvailableSecondFactorTypes(), function ($secondFactorType) use ($loa3) { $secondFactorType = new SecondFactorType($secondFactorType); - - return $secondFactorType->canSatisfy($loa3); + return $this->secondFactorTypeService->canSatisfy($secondFactorType, $loa3); } ); } diff --git a/src/Surfnet/StepupRa/RaBundle/Service/VettingService.php b/src/Surfnet/StepupRa/RaBundle/Service/VettingService.php index e0848130..6c57f203 100644 --- a/src/Surfnet/StepupRa/RaBundle/Service/VettingService.php +++ b/src/Surfnet/StepupRa/RaBundle/Service/VettingService.php @@ -21,6 +21,7 @@ use RuntimeException; use Surfnet\StepupBundle\Command\SendSmsChallengeCommand; use Surfnet\StepupBundle\Command\VerifyPossessionOfPhoneCommand; +use Surfnet\StepupBundle\Service\SecondFactorTypeService; use Surfnet\StepupBundle\Service\SmsSecondFactor\OtpVerification; use Surfnet\StepupBundle\Service\SmsSecondFactorService; use Surfnet\StepupBundle\Value\PhoneNumber\InternationalPhoneNumber; @@ -93,6 +94,11 @@ class VettingService */ private $identityService; + /** + * @var \Surfnet\StepupBundle\Service\SecondFactorTypeService + */ + private $secondFactorTypeService; + public function __construct( SmsSecondFactorService $smsSecondFactorService, YubikeySecondFactorService $yubikeySecondFactorService, @@ -101,7 +107,8 @@ public function __construct( CommandService $commandService, VettingProcedureRepository $vettingProcedureRepository, TranslatorInterface $translator, - IdentityService $identityService + IdentityService $identityService, + SecondFactorTypeService $secondFactorTypeService ) { $this->smsSecondFactorService = $smsSecondFactorService; $this->yubikeySecondFactorService = $yubikeySecondFactorService; @@ -111,6 +118,7 @@ public function __construct( $this->vettingProcedureRepository = $vettingProcedureRepository; $this->translator = $translator; $this->identityService = $identityService; + $this->secondFactorTypeService = $secondFactorTypeService; } /** @@ -121,7 +129,7 @@ public function isLoaSufficientToStartProcedure(StartVettingProcedureCommand $co { $secondFactorType = new SecondFactorType($command->secondFactor->type); - return $secondFactorType->isSatisfiedBy($command->authorityLoa); + return $this->secondFactorTypeService->isSatisfiedBy($secondFactorType, $command->authorityLoa); } /** diff --git a/src/Surfnet/StepupRa/RaBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Surfnet/StepupRa/RaBundle/Tests/DependencyInjection/ConfigurationTest.php index 96533b6e..22df8cf2 100644 --- a/src/Surfnet/StepupRa/RaBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Surfnet/StepupRa/RaBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -99,19 +99,6 @@ public function it_allows_two_enabled_second_factors() $this->assertConfigurationIsValid([['enabled_second_factors' => ['sms', 'yubikey']]], 'enabled_second_factors'); } - /** - * @test - * @group configuration - */ - public function it_rejects_invalid_second_factor_types() - { - $this->assertPartialConfigurationIsInvalid( - [['enabled_second_factors' => ['passport']]], - 'enabled_second_factors', - 'not one of the valid types' - ); - } - protected function getConfiguration() { return new Configuration(); diff --git a/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/Configuration.php b/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/Configuration.php index 74a6dd82..f44dbe8a 100644 --- a/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/Configuration.php +++ b/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/Configuration.php @@ -22,6 +22,9 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +/** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() @@ -129,6 +132,58 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode) ->end() ->end() ->end() + ->arrayNode('view_config') + ->children() + ->arrayNode('page_title') + ->children() + ->scalarNode('en_GB') + ->isRequired() + ->info('English page title translation') + ->end() + ->scalarNode('nl_NL') + ->isRequired() + ->info('Dutch alt page title translation') + ->end() + ->end() + ->end() + ->arrayNode('explanation') + ->children() + ->scalarNode('en_GB') + ->isRequired() + ->info('English explanation translation') + ->end() + ->scalarNode('nl_NL') + ->isRequired() + ->info('Dutch explanation translation') + ->end() + ->end() + ->end() + ->arrayNode('initiate') + ->children() + ->scalarNode('en_GB') + ->isRequired() + ->info('English initiate text translation') + ->end() + ->scalarNode('nl_NL') + ->isRequired() + ->info('Dutch initiate text translation') + ->end() + ->end() + ->end() + ->arrayNode('gssf_id_mismatch') + ->children() + ->scalarNode('en_GB') + ->isRequired() + ->info('English id mismatch text translation') + ->end() + ->scalarNode('nl_NL') + ->isRequired() + ->info('Dutch id mismatch text translation') + ->end() + ->end() + ->end() + ->end() + ->end() ->end(); } } diff --git a/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/SurfnetStepupRaSamlStepupProviderExtension.php b/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/SurfnetStepupRaSamlStepupProviderExtension.php index 19fb7aab..d22b75e3 100644 --- a/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/SurfnetStepupRaSamlStepupProviderExtension.php +++ b/src/Surfnet/StepupRa/SamlStepupProviderBundle/DependencyInjection/SurfnetStepupRaSamlStepupProviderExtension.php @@ -80,6 +80,17 @@ private function loadProviderConfiguration( $providerDefinition->setPublic(false); $container->setDefinition('gssp.provider.' . $provider, $providerDefinition); + $viewConfigDefinition = new Definition('Surfnet\StepupRa\SamlStepupProviderBundle\Provider\ViewConfig', [ + new Reference('request'), + $configuration['view_config']['page_title'], + $configuration['view_config']['explanation'], + $configuration['view_config']['initiate'], + $configuration['view_config']['gssf_id_mismatch'], + ]); + $viewConfigDefinition->setScope('request'); + + $container->setDefinition('gssp.view_config.' . $provider, $viewConfigDefinition); + $container ->getDefinition('gssp.provider_repository') ->addMethodCall('addProvider', [new Reference('gssp.provider.' . $provider)]); diff --git a/src/Surfnet/StepupRa/SamlStepupProviderBundle/Provider/ViewConfig.php b/src/Surfnet/StepupRa/SamlStepupProviderBundle/Provider/ViewConfig.php new file mode 100644 index 00000000..d8b96f40 --- /dev/null +++ b/src/Surfnet/StepupRa/SamlStepupProviderBundle/Provider/ViewConfig.php @@ -0,0 +1,130 @@ +request = $request; + $this->pageTitle = $pageTitle; + $this->explanation = $explanation; + $this->initiate = $initiate; + $this->gssfIdMismatch = $gssfIdMismatch; + } + + /** + * @return array + */ + public function getExplanation() + { + return $this->getTranslation($this->explanation); + } + + /** + * @return array + */ + public function getGssfIdMismatch() + { + return $this->getTranslation($this->gssfIdMismatch); + } + + /** + * @return array + */ + public function getInitiate() + { + return $this->getTranslation($this->initiate); + } + + /** + * @return array + */ + public function getPageTitle() + { + return $this->getTranslation($this->pageTitle); + } + + /** + * @param array $translations + * @return mixed + * @throws LogicException + */ + private function getTranslation(array $translations) + { + $currentLocale = $this->request->getLocale(); + if (is_null($currentLocale)) { + throw new LogicException('The current language is not set'); + } + if (isset($translations[$currentLocale])) { + return $translations[$currentLocale]; + } + throw new LogicException( + sprintf( + 'The requested translation is not available in this language: %s. Available languages: %s', + $currentLocale, + implode(', ', array_keys($translations)) + ) + ); + } +} diff --git a/src/Surfnet/StepupRa/SamlStepupProviderBundle/Tests/Provider/ViewConfigTest.php b/src/Surfnet/StepupRa/SamlStepupProviderBundle/Tests/Provider/ViewConfigTest.php new file mode 100644 index 00000000..a19e4abd --- /dev/null +++ b/src/Surfnet/StepupRa/SamlStepupProviderBundle/Tests/Provider/ViewConfigTest.php @@ -0,0 +1,105 @@ +buildViewConfig('nl_NL'); + + $this->assertEquals('NL pageTitle', $viewConfig->getPageTitle()); + $this->assertEquals('NL explanation', $viewConfig->getExplanation()); + $this->assertEquals('NL initiate', $viewConfig->getInitiate()); + $this->assertEquals('NL gssfIdMismatch', $viewConfig->getGssfIdMismatch()); + + $viewConfig = $this->buildViewConfig('en_GB'); + $this->assertEquals('EN pageTitle', $viewConfig->getPageTitle()); + $this->assertEquals('EN explanation', $viewConfig->getExplanation()); + $this->assertEquals('EN initiate', $viewConfig->getInitiate()); + $this->assertEquals('EN gssfIdMismatch', $viewConfig->getGssfIdMismatch()); + } + + /** + * @test + * @group di + * @expectedException \Surfnet\StepupRa\RaBundle\Exception\LogicException + * @expectedExceptionMessage The current language is not set + */ + public function translation_fails_when_no_current_language_set() + { + $viewConfig = $this->buildViewConfig(null); + $viewConfig->getExplanation(); + } + + /** + * @test + * @group di + * @expectedException \Surfnet\StepupRa\RaBundle\Exception\LogicException + * @expectedExceptionMessage The requested translation is not available in this language: fr_FR. + * Available languages: en_GB, nl_NL + */ + public function view_config_cannot_serve_french_translations() + { + $viewConfig = $this->buildViewConfig('fr_FR'); + $viewConfig->getGssfIdMismatch(); + } + + /** + * @param string $locale + * @return ViewConfig + */ + private function buildViewConfig($locale = '') + { + $request = m::mock(Request::class); + $request->shouldReceive('getLocale')->andReturn($locale)->byDefault(); + return new ViewConfig( + $request, + $this->getTranslationsArray('pageTitle'), + $this->getTranslationsArray('explanation'), + $this->getTranslationsArray('initiate'), + $this->getTranslationsArray('gssfIdMismatch') + ); + } + + /** + * @param $string + * @return array + */ + private function getTranslationsArray($string) + { + return [ + 'en_GB' => 'EN ' . $string, + 'nl_NL' => 'NL ' . $string, + ]; + } +}