Skip to content

Commit

Permalink
Provide a checking stage which checks that each entity has an appropr…
Browse files Browse the repository at this point in the history
…iately located mdrpi:RegistrationInfo element, without looking any deeper.
  • Loading branch information
iay committed May 3, 2013
1 parent e9225d1 commit ad713ef
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
27 changes: 27 additions & 0 deletions mdx/_rules/check_hasreginfo.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_hasreginfo.xsl
Check that an entity has a RegistrationInfo element.
-->
<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:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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

<xsl:template match="md:EntityDescriptor[not(md:Extensions/mdrpi:RegistrationInfo)]">
<xsl:call-template name="error">
<xsl:with-param name="m">entity does not have an mdrpi:RegistrationInfo element</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
4 changes: 2 additions & 2 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
class="net.shibboleth.metadata.dom.XSLTransformationStage"/>

<!--
check_xslt_parent
XSLValidationStage / check_xslt_parent
Parent for XSLT-based checking stages.
-->
<bean id="check_xslt_parent" abstract="true" parent="stage_parent"
<bean id="XSLValidationStage" name="check_xslt_parent" abstract="true" parent="stage_parent"
class="net.shibboleth.metadata.dom.XSLValidationStage"/>

<!--
Expand Down
12 changes: 12 additions & 0 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@
</property>
</bean>

<!--
check_hasreginfo
Check that each entity has an mdrpi:RegistrationInfo element.
-->
<bean id="check_hasreginfo" parent="XSLValidationStage"
p:id="check_hasreginfo">
<property name="xslResource">
<bean parent="FilesystemResource" c:resourcePath="#{ systemProperties['rulesdir'] }/check_hasreginfo.xsl"/>
</property>
</bean>

<!--
***********************************************
*** ***
Expand Down

0 comments on commit ad713ef

Please sign in to comment.