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

Commit

Permalink
Check spelling and positioning of wayf:HideFromWAYF element.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Apr 16, 2015
1 parent 7bda88d commit 6579450
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
46 changes: 46 additions & 0 deletions mdx/_rules/check_uk_wayf.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_uk_wayf.xsl
Checking ruleset for the SDSS/UK federation WAYF namespace.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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

<!--
Check for misspelled elements.
This covers the case where elements from this namespace are used in a context
where lax validation applies.
-->
<xsl:template match="wayf:*[local-name()!='HideFromWAYF']">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>unknown element name wayf:</xsl:text>
<xsl:value-of select="local-name()"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

<!--
Check for misplaced HideFromWAYF elements.
-->
<xsl:template match="wayf:HideFromWAYF[not(parent::md:Extensions) or not(parent::*/parent::md:EntityDescriptor)]">
<xsl:call-template name="error">
<xsl:with-param name="m">misplaced wayf:HideFromWAYF element</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
13 changes: 13 additions & 0 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,18 @@
</property>
</bean>

<!--
check_uk_wayf
-->
<bean id="check_uk_wayf" parent="XSLValidationStage"
p:id="check_uk_wayf">
<property name="XSLResource">
<bean parent="FileSystemResource">
<constructor-arg value="${rulesdir}/check_uk_wayf.xsl"/>
</bean>
</property>
</bean>

<!--
*******************************************************
*** ***
Expand Down Expand Up @@ -845,6 +857,7 @@
<ref bean="check_shibboleth"/>
<ref bean="check_uk_algorithms"/>
<ref bean="check_uk_trust"/>
<ref bean="check_uk_wayf"/>
</list>
</property>
</bean>
Expand Down

0 comments on commit 6579450

Please sign in to comment.