-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #827 from OpenConext/bugfix/metadata-emailaddress-…
…needs-mailto According to the spec, EmailAddress needs to have a mailto: prefix
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
use OpenConext\EngineBlock\Metadata\Factory\Adapter\ServiceProviderEntity; | ||
use OpenConext\EngineBlock\Metadata\Factory\Collection\IdentityProviderEntityCollection; | ||
use OpenConext\EngineBlock\Metadata\Factory\Decorator\EngineBlockIdentityProvider; | ||
use OpenConext\EngineBlock\Metadata\ContactPerson; | ||
use OpenConext\EngineBlock\Metadata\IndexedService; | ||
use OpenConext\EngineBlock\Metadata\Logo; | ||
use OpenConext\EngineBlock\Metadata\Organization; | ||
|
@@ -141,6 +142,12 @@ public function the_metadata_factory_should_return_valid_signed_xml_for_sp() | |
Constants::BINDING_HTTP_POST, | ||
0 | ||
); | ||
$contactPersons[] = ContactPerson::from( | ||
'administrative', | ||
'John', | ||
'Doe', | ||
'[email protected]' | ||
); | ||
|
||
$sp = Utils::instantiate( | ||
ServiceProvider::class, | ||
|
@@ -149,6 +156,7 @@ public function the_metadata_factory_should_return_valid_signed_xml_for_sp() | |
'assertionConsumerServices' => $assertionConsumerServices, | ||
'logo' => new Logo('/images/logo.gif'), | ||
'organizationEn' => new Organization('Org', 'Organization', 'https://example.org'), | ||
'contactPersons' => $contactPersons, | ||
] | ||
); | ||
|
||
|
@@ -169,6 +177,9 @@ public function the_metadata_factory_should_return_valid_signed_xml_for_sp() | |
$entityDescriptor = new EntityDescriptor($dom->childNodes->item(1)); | ||
$this->assertInstanceOf(EntityDescriptor::class, $entityDescriptor); | ||
|
||
// Verify that the requried "mailto:" prefix is present for the EmailAdress tag | ||
$this->assertContains('<md:EmailAddress>mailto:[email protected]</md:EmailAddress>', $xml); | ||
|
||
// Assert schema | ||
$this->validateSchema($xml); | ||
} | ||
|
2 changes: 1 addition & 1 deletion
2
...e/material/templates/modules/Authentication/View/Metadata/partial/contact_person.xml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<md:ContactPerson contactType="{{ contactPerson.contactType }}"> | ||
<md:GivenName>{{ contactPerson.givenName }}</md:GivenName> | ||
<md:SurName>{{ contactPerson.surName }}</md:SurName> | ||
<md:EmailAddress>{{ contactPerson.emailAddress }}</md:EmailAddress> | ||
<md:EmailAddress>mailto:{{ contactPerson.emailAddress }}</md:EmailAddress> | ||
</md:ContactPerson> |