Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Feb 4, 2019
2 parents 251af90 + c11798b commit b1e7d70
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ public function getRedirectUris()
*/
public function setRedirectUris($redirectUris)
{
$this->redirectUris = $redirectUris;
$this->redirectUris = array_values($redirectUris);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends '::base.html.twig' %}

{% block body_container %}
<h1>{% block page_heading %}{{ 'service.admin_overview.title'|trans }}{%endblock%}</h1>

<div class="fieldset card">
<div class="wysiwyg">{{ 'service.admin_overview.introduction.html'|trans|raw }}</div>
</div>

{% endblock %}
10 changes: 5 additions & 5 deletions tests/unit/Application/Metadata/JsonGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' =>
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 2 additions & 4 deletions tests/webtests/ServiceOverviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}


Expand Down

0 comments on commit b1e7d70

Please sign in to comment.