Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Move UKf owner name check out of XSLT extensions into an MDA stage.
Browse files Browse the repository at this point in the history
Includes a new version of the ukf-mda project supplying the stage.
  • Loading branch information
iay committed Jul 7, 2016
1 parent 562011d commit e75e3d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 51 deletions.
17 changes: 10 additions & 7 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,16 @@
Checks specific to the UK registrar function.
-->
<bean id="check_ukreg" parent="XSLValidationStage"
p:XSLResource="classpath:uk/check_ukreg.xsl">
<property name="transformParameters">
<map>
<entry key="members" value-ref="uk_members"/>
</map>
</property>
</bean>
p:XSLResource="classpath:uk/check_ukreg.xsl"/>

<!--
check_owner
Checks that entities are owned by UK federation members.
-->
<bean id="check_owner" parent="stage_parent"
class="uk.org.ukfederation.mda.dom.saml.EntityOwnerCheckingStage"
p:members-ref="uk_members"/>

<!--
check_uk_keydesc_key
Expand Down Expand Up @@ -336,6 +338,7 @@
<ref bean="checkSchemas"/>
<ref bean="CHECK_std"/>
<ref bean="check_ukreg"/>
<ref bean="check_owner"/>
<ref bean="check_uk_keydesc_key"/>
<ref bean="check_uk_mdattr"/>
<ref bean="check_uk_mdrps"/>
Expand Down
45 changes: 1 addition & 44 deletions mdx/uk/check_ukreg.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:mdxMail="xalan://uk.ac.sdss.xalan.md.Mail"
xmlns:ukfxMembers="xalan://uk.org.ukfederation.members.Members"
extension-element-prefixes="mdxMail ukfxMembers"
extension-element-prefixes="mdxMail"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

Expand All @@ -26,48 +25,6 @@
<xsl:import href="../_rules/check_framework.xsl"/>


<!--
Parameters.
-->
<xsl:param name="members"/>


<!--
Check EntityDescriptor elements.
-->
<xsl:template match="md:EntityDescriptor">

<!-- tests on OrganizationName -->
<xsl:choose>

<!--
Check for entities which do not have an OrganizationName at all.
-->
<xsl:when test="not(md:Organization/md:OrganizationName)">
<xsl:call-template name="error">
<xsl:with-param name="m">entity lacks OrganizationName</xsl:with-param>
</xsl:call-template>
</xsl:when>

<xsl:otherwise>
<!--
Check for entities with OrganizationName elements which don't correspond to
a canonical owner name.
-->
<xsl:if test="not(ukfxMembers:isOwnerName($members, md:Organization/md:OrganizationName))">
<xsl:call-template name="error">
<xsl:with-param name="m">unknown owner name: <xsl:value-of select="md:Organization/md:OrganizationName"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>

</xsl:choose>

<!-- apply tests to child elements -->
<xsl:apply-templates/>
</xsl:template>


<!--
Check for badly formatted e-mail addresses.
-->
Expand Down
Binary file not shown.

0 comments on commit e75e3d5

Please sign in to comment.