Skip to content

Commit

Permalink
Promote two UK-specific tests for mdui:DisplayName to production, but…
Browse files Browse the repository at this point in the history
… only when checking UK-registered entities.
  • Loading branch information
iay committed Jul 5, 2013
1 parent f31d888 commit a8cc244
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 35 deletions.
22 changes: 0 additions & 22 deletions mdx/_rules/check_future_0.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,4 @@
-->
<xsl:import href="check_framework.xsl"/>

<!--
If an IdP has both an OrganizationDisplayName in English, and an
mdui:DisplayName in English, they must be identical.
UKFTS 1.4 section 3.3
-->
<xsl:template match="md:EntityDescriptor[md:IDPSSODescriptor]">
<xsl:variable name="mdui" select="md:IDPSSODescriptor/md:Extensions/mdui:UIInfo/mdui:DisplayName[@xml:lang='en']"/>
<xsl:variable name="odn" select="md:Organization/md:OrganizationDisplayName[@xml:lang='en']"/>
<xsl:if test="$mdui and $odn and $mdui != $odn">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mismatched xml:lang='en' DisplayNames: '</xsl:text>
<xsl:value-of select="$mdui"/>
<xsl:text>' in mdui vs. '</xsl:text>
<xsl:value-of select="$odn"/>
<xsl:text>' in ODN</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
13 changes: 0 additions & 13 deletions mdx/_rules/check_future_1.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,4 @@
-->
<xsl:import href="check_framework.xsl"/>

<!--
If an entity has mdui:UIInfo, then that must include at least an
mdui:DisplayName with an English name.
-->
<xsl:template match="mdui:UIInfo[not(mdui:DisplayName[@xml:lang='en'])]">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mdui:UIInfo with no xml:lang='en' DisplayName</xsl:text>
</xsl:with-param>
</xsl:call-template>

</xsl:template>

</xsl:stylesheet>
41 changes: 41 additions & 0 deletions mdx/_rules/mdui_dn_en_match.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
mdui_dn_en_match.xsl
If an IdP has both an OrganizationDisplayName in English, and an
mdui:DisplayName in English, they must be identical.
UKFTS 1.4 section 3.3
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>

<xsl:template match="md:EntityDescriptor[md:IDPSSODescriptor]">
<xsl:variable name="mdui" select="md:IDPSSODescriptor/md:Extensions/mdui:UIInfo/mdui:DisplayName[@xml:lang='en']"/>
<xsl:variable name="odn" select="md:Organization/md:OrganizationDisplayName[@xml:lang='en']"/>
<xsl:if test="$mdui and $odn and $mdui != $odn">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mismatched xml:lang='en' DisplayNames: '</xsl:text>
<xsl:value-of select="$mdui"/>
<xsl:text>' in mdui vs. '</xsl:text>
<xsl:value-of select="$odn"/>
<xsl:text>' in ODN</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
31 changes: 31 additions & 0 deletions mdx/_rules/mdui_dn_en_present.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
mdui_dn_en_present.xsl
If an entity has mdui:UIInfo, then that must include at least an
mdui:DisplayName with an English name.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>

<xsl:template match="mdui:UIInfo[not(mdui:DisplayName[@xml:lang='en'])]">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mdui:UIInfo with no xml:lang='en' DisplayName</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
2 changes: 2 additions & 0 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@
<ref bean="checkSchemas"/>
<ref bean="CHECK_std"/>
<ref bean="check_ukreg"/>
<ref bean="mdui_dn_en_present"/>
<ref bean="mdui_dn_en_match"/>

<!-- failure of any check on registered metadata is fatal -->
<ref bean="errorTerminatingFilter"/>
Expand Down
38 changes: 38 additions & 0 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,48 @@
</property>
</bean>

<!--
mdui_dn_en_match
If an IdP has both an OrganizationDisplayName in English, and an
mdui:DisplayName in English, they must be identical.
UKFTS 1.4 section 3.3
-->
<bean id="mdui_dn_en_match" parent="XSLValidationStage"
p:id="mdui_dn_en_match">
<property name="xslResource">
<bean parent="FilesystemResource">
<constructor-arg value="#{ systemProperties['rulesdir'] }/mdui_dn_en_match.xsl"/>
</bean>
</property>
</bean>

<!--
mdui_dn_en_present
If an entity has mdui:UIInfo, then that must include at least an
mdui:DisplayName with an English name.
-->
<bean id="mdui_dn_en_present" parent="XSLValidationStage"
p:id="mdui_dn_en_present">
<property name="xslResource">
<bean parent="FilesystemResource">
<constructor-arg value="#{ systemProperties['rulesdir'] }/mdui_dn_en_present.xsl"/>
</bean>
</property>
</bean>

<!--
check_mdui
Composite check for the MDUI specification.
Omitted the following, which are only applied to
UK-registered metadata:
mdui_dn_en_present
mdui_dn_en_match
-->
<bean id="check_mdui" parent="CompositeStage"
p:id="check_mdui">
Expand Down

0 comments on commit a8cc244

Please sign in to comment.