Skip to content

Commit

Permalink
Introduce a non-XSLT test for mdui:IPHint elements, requiring an upda…
Browse files Browse the repository at this point in the history
…ted opensaml-util for a more heavyweight implementation of IPRange.

Moved post-import validation of metadata into an aggregator verb so that non-XSLT rules can be checked.
  • Loading branch information
iay committed Sep 20, 2011
1 parent 6f042c7 commit c9ad441
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 32 deletions.
30 changes: 1 addition & 29 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,7 @@
i="${temp.xml}" o="${entities.dir}/imported.xml"/>

<echo>Imported metadata to ${entities.dir}/imported.xml</echo>
<CHECK.std i="${entities.dir}/imported.xml">
<arg value="${build.dir}/check_future.xsl"/>
<arg value="${build.dir}/check_imported.xsl"/>
<arg value="${build.dir}/check_vhosts.xsl"/>
</CHECK.std>
<CHANNEL.do channel="uk" verb="validateImportedMetadata"/>
<echo>Checked.</echo>
</target>

Expand Down Expand Up @@ -836,30 +832,6 @@
</sequential>
</macrodef>

<macrodef name="CHECK.std">
<attribute name="i"/>
<element name="std.args" implicit="yes"/>
<sequential>
<CHECK.base i="@{i}">
<!-- set of checking stylesheets applied in every case -->
<arg value="${build.dir}/check_adfs.xsl"/>
<arg value="${build.dir}/check_idpdisc.xsl"/>
<arg value="${build.dir}/check_init.xsl"/>
<arg value="${build.dir}/check_mdiop.xsl"/>
<arg value="${build.dir}/check_mdui.xsl"/>
<arg value="${build.dir}/check_misc.xsl"/>
<arg value="${build.dir}/check_namespaces.xsl"/>
<arg value="${build.dir}/check_reqattr.xsl"/>
<arg value="${build.dir}/check_saml2.xsl"/>
<arg value="${build.dir}/check_saml2meta.xsl"/>
<arg value="${build.dir}/check_shibboleth.xsl"/>

<!-- additional arguments -->
<std.args/>
</CHECK.base>
</sequential>
</macrodef>

<!--
*********************************************
*** ***
Expand Down
46 changes: 46 additions & 0 deletions mdx/uk/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,50 @@
</property>
</bean>

<!--
*****************************************
*** ***
*** M E T A D A T A I M P O R T ***
*** ***
*****************************************
-->

<!--
importedMetadata
Fetches the contents of the file used to hold metadata just imported
by the federation's import transform.
-->
<bean id="importedMetadata" class="net.shibboleth.metadata.dom.DomFilesystemSourceStage"
init-method="initialize" lazy-init="true">
<property name="id" value="importedMetadata"/>
<property name="parserPool" ref="parserPool"/>
<property name="source">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/entities/imported.xml"/>
</bean>
</property>
</bean>

<!--
validateImportedMetadata
Perform custom validation on metadata just imported by the
federation's import transform.
-->
<bean id="validateImportedMetadata" class="net.shibboleth.metadata.pipeline.SimplePipeline"
init-method="initialize" lazy-init="true">
<property name="id" value="validateImportedMetadat"/>
<property name="stages">
<list>
<ref bean="importedMetadata"/>
<ref bean="CHECK_std"/>
<ref bean="check_future"/>
<ref bean="check_imported"/>
<ref bean="check_vhosts"/>
<ref bean="errorTerminatingFilter"/>
</list>
</property>
</bean>

</beans>
42 changes: 39 additions & 3 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,54 @@
</bean>

<!--
check_mdui
***********************************************
*** ***
*** M D U I S P E C I F I C A T I O N ***
*** ***
***********************************************
-->

<!--
check_mdui_iphint
Checks for the mdui:IPHint element.
-->
<bean id="check_mdui" class="net.shibboleth.metadata.dom.XSLValidationStage"
<bean id="check_mdui_iphint" class="uk.org.ukfederation.mda.validate.mdui.IPHintValidationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="check_mdui"/>
<property name="id" value="check_mdui_iphint"/>
</bean>

<!--
check_mdui_xslt
Miscellaneous MDUI tests, in XSLT.
-->
<bean id="check_mdui_xslt" class="net.shibboleth.metadata.dom.XSLValidationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="check_mdui_xslt"/>
<property name="xslResource">
<bean class="org.opensaml.util.resource.FilesystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/build/check_mdui.xsl"/>
</bean>
</property>
</bean>

<!--
check_mdui
Composite check for the MDUI specification.
-->
<bean id="check_mdui" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="check_mdui"/>
<property name="composedStages">
<list>
<ref bean="check_mdui_iphint"/>
<ref bean="check_mdui_xslt"/>
</list>
</property>
</bean>

<!--
check_misc
-->
Expand Down

0 comments on commit c9ad441

Please sign in to comment.