diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf615527..0125f7307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## Next release +## 2.0.4 + +**Bugfix** + - Correctly publish OIDC redirect URIs to Manage #233 + +**Improvement** + - Provide a custom service overview for admin #234 ## 2.0.3 diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php b/src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php index ca22b787f..f11f25f01 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php @@ -267,6 +267,7 @@ private function generateOidcClient(Entity $entity) { $metadata['clientId'] = str_replace('://', '@//', $entity->getEntityId()); $metadata['clientSecret'] = $entity->getClientSecret(); + // Reset the redirect URI list in order to get a correct JSON formatting (See #163646662) $metadata['redirectUris'] = $entity->getRedirectUris(); $metadata['grantType'] = $entity->getGrantType()->getGrantType(); $metadata['scope'] = ['openid']; diff --git a/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity.php b/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity.php index d053b29d7..bdef75dc6 100644 --- a/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity.php +++ b/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity.php @@ -975,7 +975,7 @@ public function getRedirectUris() */ public function setRedirectUris($redirectUris) { - $this->redirectUris = $redirectUris; + $this->redirectUris = array_values($redirectUris); } /** diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Controller/ServiceController.php b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Controller/ServiceController.php index d54581fec..ef4cd7529 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Controller/ServiceController.php +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Controller/ServiceController.php @@ -115,6 +115,10 @@ public function overviewAction() return $this->redirectToRoute('service_add'); } + if ($this->isGranted('ROLE_ADMINISTRATOR')) { + return $this->render("@Dashboard/Service/admin_overview.html.twig"); + } + $serviceObjects = []; foreach ($services as $service) { $entityList = $this->entityService->getEntityListForService($service); diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml index 2918a32fb..f52040b69 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml @@ -310,6 +310,11 @@ privacy.information.snDpaWhyNot: What items of the SURF model Data Processing Ag privacy.information.surfmarketDpaAgreement: Did you agree a Data Processing Agreement with SURFmarket? privacy.information.surfnetDpaAgreement: Are you willing to sign the model SURF Data Processing Agreement? privacy.information.whatData: Describe what (kind of) data is processed in the service, and pay specific attention to possible processing of personal data. +service: + admin_overview: + title: Service overview + introduction: + html: "Please use the service switcher to manage the entities of one of the services." service.create.title: Add new service service.edit.title: Edit service service.delete.title: "Delete service" diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/views/Service/admin_overview.html.twig b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/views/Service/admin_overview.html.twig new file mode 100644 index 000000000..3cb7d5192 --- /dev/null +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/views/Service/admin_overview.html.twig @@ -0,0 +1,10 @@ +{% extends '::base.html.twig' %} + +{% block body_container %} +

{% block page_heading %}{{ 'service.admin_overview.title'|trans }}{%endblock%}

+ +
+
{{ 'service.admin_overview.introduction.html'|trans|raw }}
+
+ +{% endblock %} \ No newline at end of file diff --git a/tests/unit/Application/Metadata/JsonGeneratorTest.php b/tests/unit/Application/Metadata/JsonGeneratorTest.php index 312a87331..1084d7dbe 100644 --- a/tests/unit/Application/Metadata/JsonGeneratorTest.php +++ b/tests/unit/Application/Metadata/JsonGeneratorTest.php @@ -467,10 +467,10 @@ public function test_it_can_build_oidc_entity_data_for_new_entities() 'clientSecret' => 'test', 'redirectUris' => array ( - 0 => 'uri1', - 1 => 'uri2', - 2 => 'uri3', - 3 => 'http://playground-test', + 'uri1', + 'uri2', + 'uri3', + 'http://playground-test', ), 'grantType' => 'implicit', 'scope' => @@ -628,7 +628,7 @@ private function createOidcEntity() $entity->setOrganizationUrlNl('http://orgnl'); $entity->setClientSecret('test'); - $entity->setRedirectUris(['uri1','uri2', 'uri3']); + $entity->setRedirectUris([0 => 'uri1', 2 => 'uri2', 8 => 'uri3']); $entity->setGrantType(new OidcGrantType('implicit')); $entity->setEnablePlayground(true); diff --git a/tests/webtests/ServiceOverviewTest.php b/tests/webtests/ServiceOverviewTest.php index 4b10ea0f2..9a0e02019 100644 --- a/tests/webtests/ServiceOverviewTest.php +++ b/tests/webtests/ServiceOverviewTest.php @@ -161,16 +161,14 @@ public function test_service_overview_redirects_to_service_add_when_no_service_e public function test_service_overview_shows_message_when_no_service_selected() { - $this->markTestSkipped('TODO: Determine what the Administrator should see when authenticated'); - $this->loadFixtures(); $this->logIn('ROLE_ADMINISTRATOR'); $this->client->request('GET', '/'); $response = $this->client->getResponse(); - $this->assertContains('No service selected', $response->getContent()); - $this->assertContains('Please select a service', $response->getContent()); + $this->assertContains('Service overview', $response->getContent()); + $this->assertContains('Please use the service switcher to manage the entities of one of the services.', $response->getContent()); }