Skip to content

Commit

Permalink
Make "publishable" test specific to the UK channel.
Browse files Browse the repository at this point in the history
Include schema validity in the publishability test.
Move cleaning up empty Extensions element out of strip_extensions to use new ukf-mda stage.
  • Loading branch information
iay committed Sep 16, 2011
1 parent 2cc9969 commit f9dd927
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 47 deletions.
22 changes: 22 additions & 0 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,28 @@
</bean>


<!--
uk_checkPublishable
Check an aggregate metadata document for publishability. This is applied during
all UK publication flows prior to any signature step. It is not applied to
export flows, for which we desire the closest possible correspondence to
the registered metadata.
-->
<bean id="uk_checkPublishable" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="uk_checkPublishable"/>
<property name="composedStages">
<list>
<ref bean="checkSchemas"/>
<ref bean="check_aggregate"/>
<ref bean="check_filtered"/>
<ref bean="check_fixups"/>
</list>
</property>
</bean>


<!--
uk_trustRootsDocument
Expand Down
2 changes: 1 addition & 1 deletion mdx/uk/collect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<ref bean="uk_assemble"/>
<ref bean="uk_addTrustRoots"/>
<ref bean="normaliseNamespaces"/>
<ref bean="CHECK_publishable"/>
<ref bean="uk_checkPublishable"/>
<ref bean="errorTerminatingFilter"/>
<ref bean="serializeCollected"/>
</list>
Expand Down
15 changes: 11 additions & 4 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<ref bean="uk_normaliseNamespaces"/>

<!-- production aggregate MUST pass publishability test -->
<ref bean="CHECK_publishable"/>
<ref bean="uk_checkPublishable"/>
<ref bean="errorTerminatingFilter"/>

<ref bean="serializeUnsignedProductionAggregate"/>
Expand Down Expand Up @@ -178,7 +178,7 @@
<ref bean="uk_normaliseNamespaces"/>

<!-- WAYF aggregate MUST pass publishability test -->
<ref bean="CHECK_publishable"/>
<ref bean="uk_checkPublishable"/>
<ref bean="errorTerminatingFilter"/>

<ref bean="serializeUnsignedWayfAggregate"/>
Expand Down Expand Up @@ -231,7 +231,7 @@
<ref bean="uk_normaliseNamespaces"/>

<!-- fallback aggregate MUST pass publishability test -->
<ref bean="CHECK_publishable"/>
<ref bean="uk_checkPublishable"/>
<ref bean="errorTerminatingFilter"/>

<ref bean="serializeUnsignedFallbackAggregate"/>
Expand Down Expand Up @@ -320,8 +320,14 @@
<list>
<ref bean="uk_stripExtensions"/>
<ref bean="uk_assemble"/>
<ref bean="removeEmptyExtensions"/>
<ref bean="uk_finaliseExport"/>
<ref bean="uk_normaliseNamespaces"/>

<!-- schema validity check MUST pass -->
<ref bean="checkSchemas"/>
<ref bean="errorTerminatingFilter"/>

<ref bean="serializeUnsignedExportAggregate"/>
</list>
</property>
Expand Down Expand Up @@ -386,6 +392,7 @@
selection for that pipeline is based on these same extensions.
-->
<ref bean="uk_stripExtensions"/>
<ref bean="removeEmptyExtensions"/>

<!--
Perform fixups on UK federation entities. We need to make sure
Expand Down Expand Up @@ -443,7 +450,7 @@
<ref bean="uk_normaliseNamespaces"/>

<!-- test aggregate MUST pass publishability test -->
<ref bean="CHECK_publishable"/>
<ref bean="uk_checkPublishable"/>
<ref bean="errorTerminatingFilter"/>

<ref bean="serializeUnsignedTestAggregate"/>
Expand Down
22 changes: 0 additions & 22 deletions mdx/uk/strip_extensions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,6 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="md">

<!--
Handle <md:Extensions> elements.
In general, at this stage in the flow we pass through any Extensions unaltered.
However, certain changes (such as the filtering we perform on extensions in the
ukfedlabel namespace) may cause the Extensions element to become empty, which is not
permitted by the schema. We therefore precompute the resulting Extensions element
and suppress it entirely if it would have no child elements.
-->
<xsl:template match="md:Extensions">
<!-- compute result -->
<xsl:variable name="ext">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:variable>
<!-- copy through only if schema-valid -->
<xsl:if test="count(exsl:node-set($ext)/md:Extensions/*) != 0">
<xsl:copy-of select="$ext"/>
</xsl:if>
</xsl:template>

<!--
Pass through certain ukfedlabel namespace elements.
-->
Expand Down
20 changes: 0 additions & 20 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,24 +314,4 @@
</property>
</bean>

<!--
CHECK_publishable
Check an aggregate metadata document for publishability. This is applied during
all UK publication flows prior to any signature step. It is not applied to
export flows, for which we desire the closest possible correspondence to
the registered metadata.
-->
<bean id="CHECK_publishable" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="CHECK_publishable"/>
<property name="composedStages">
<list>
<ref bean="check_aggregate"/>
<ref bean="check_filtered"/>
<ref bean="check_fixups"/>
</list>
</property>
</bean>

</beans>

0 comments on commit f9dd927

Please sign in to comment.