Skip to content

Commit

Permalink
Change the way verb definitions work. Instead of always being in a na…
Browse files Browse the repository at this point in the history
…med file, a fallback option is a verbs.xml file containing multiple pipeline beans, each of which implements a verb.

Document the conventions used in the /mdx/ tree.
Bring all channels into line with those new conventions.
  • Loading branch information
iay committed Jun 24, 2011
1 parent 9f11105 commit 0e2a6bd
Show file tree
Hide file tree
Showing 24 changed files with 412 additions and 289 deletions.
30 changes: 15 additions & 15 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1051,20 +1051,11 @@

<!--
Aggregator based work is divided into channels, each of
which lives in a directory under /mdx/. Channels are
mostly named country_source, but there are exceptions
to this rule. Some of the exceptions may be rationalised
in the future.
which lives in a directory under /mdx/. Each channel
can have a number of verbs which can be executed.
Each channel can have a number of verbs which can be
executed. The convention is that the verb names a
configuration file, and that the pipeline to execute
is named as channel_pipeline.
Note that these conventions, which derive from identifier
names in the Spring Expression Language, in combination
mean that pipelines may be named in the form
country_source_pipeline.
Conventions for this system are documented in
/mdx/conventions.txt.
-->

<!--
Expand All @@ -1077,8 +1068,17 @@
<attribute name="verb"/><!-- verb to perform -->
<sequential>
<echo>Running @{channel} @{verb} flow.</echo>
<MDA config="${mdx.dir}/@{channel}/@{verb}.xml"
pipeline="@{channel}_@{verb}"/>
<if>
<available file="${mdx.dir}/@{channel}/@{verb}.xml"/>
<then>
<MDA config="${mdx.dir}/@{channel}/@{verb}.xml"
pipeline="@{verb}"/>
</then>
<else>
<MDA config="${mdx.dir}/@{channel}/verbs.xml"
pipeline="@{verb}"/>
</else>
</if>
<echo>Completed @{channel} @{verb} flow.</echo>
</sequential>
</macrodef>
Expand Down
40 changes: 32 additions & 8 deletions mdx/au_aaf/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!--
Fetch the AAF export metadata aggregate. For the moment, use the production aggregate in lieu
of a designated export aggregate.
Fetch the AAF production aggregate.
-->
<bean id="fetchAafExportAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage">
<property name="id" value="fetchAafExportAggregate"/>
<bean id="au_aaf_productionAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage"
init-method="initialize" lazy-init="true">
<property name="id" value="au_aaf_productionAggregate"/>
<property name="parserPool" ref="parserPool"/>
<property name="sourceUrl" value="http://manager.aaf.edu.au/metadata/metadata.aaf.signed.xml"/>
</bean>

<!--
AAF signing certificate.
-->
<bean id="aafSigningCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean">
<bean id="au_aaf_signingCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
lazy-init="true">
<property name="certificateFile">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/au_aaf/aaf-metadata-cert.pem"/>
Expand All @@ -29,9 +30,32 @@
<!--
Check AAF signing signature.
-->
<bean id="checkAafSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage">
<property name="id" value="checkAafSignature"/>
<property name="verificationCertificate" ref="aafSigningCertificate"/>
<bean id="au_aaf_checkSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="au_aaf_checkSignature"/>
<property name="verificationCertificate" ref="au_aaf_signingCertificate"/>
</bean>

<!--
Fetch and process the exported entities as a collection.
-->
<bean id="au_aaf_exportedEntities" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="au_aaf_exportedEntities"/>
<property name="composedStages">
<list>
<!-- no export aggregate; use the production one instead -->
<ref bean="au_aaf_productionAggregate"/>
<ref bean="au_aaf_checkSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>
</list>
</property>
</bean>

</beans>
24 changes: 7 additions & 17 deletions mdx/au_aaf/import.xml → mdx/au_aaf/verbs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Import pipeline for this channel.
Verb definitions for this channel.
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
Expand All @@ -15,9 +15,9 @@
-->
<import resource="beans.xml"/>

<bean id="au_aaf_serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
<bean id="serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="au_aaf_serializeImported"/>
<property name="id" value="serializeImported"/>
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
Expand All @@ -26,24 +26,14 @@
</property>
</bean>

<bean id="au_aaf_import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
<bean id="import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
init-method="initialize" lazy-init="true">
<property name="id" value="au_aaf_import"/>
<property name="id" value="import"/>
<property name="stages">
<list>
<ref bean="fetchAafExportAggregate"/>
<ref bean="checkAafSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>

<ref bean="au_aaf_exportedEntities"/>
<ref bean="standardImportTail"/>

<ref bean="au_aaf_serializeImported"/>
<ref bean="serializeImported"/>
</list>
</property>
</bean>
Expand Down
40 changes: 32 additions & 8 deletions mdx/ca_caf/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!--
Fetch the CAF export metadata aggregate. For the moment, use the production aggregate in lieu
of a designated export aggregate.
Fetch the CAF production aggregate.
-->
<bean id="fetchCafExportAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage">
<property name="id" value="fetchCafExportAggregate"/>
<bean id="ca_caf_productionAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ca_caf_productionAggregate"/>
<property name="parserPool" ref="parserPool"/>
<property name="sourceUrl" value="https://caf-shibops.ca/CoreServices/cafshib_metadata_signed.xml"/>
</bean>

<!--
CAF signing certificate.
-->
<bean id="cafSigningCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean">
<bean id="ca_caf_signingCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
lazy-init="true">
<property name="certificateFile">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/ca_caf/cafshib_metadata_verify.pem"/>
Expand All @@ -29,9 +30,32 @@
<!--
Check CAF signing signature.
-->
<bean id="checkCafSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage">
<property name="id" value="checkCafSignature"/>
<property name="verificationCertificate" ref="cafSigningCertificate"/>
<bean id="ca_caf_checkSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ca_caf_checkSignature"/>
<property name="verificationCertificate" ref="ca_caf_signingCertificate"/>
</bean>

<!--
Fetch and process the exported entities as a collection.
-->
<bean id="ca_caf_exportedEntities" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ca_caf_exportedEntities"/>
<property name="composedStages">
<list>
<!-- no export aggregate; use the production one instead -->
<ref bean="ca_caf_productionAggregate"/>
<ref bean="ca_caf_checkSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>
</list>
</property>
</bean>

</beans>
24 changes: 7 additions & 17 deletions mdx/ca_caf/import.xml → mdx/ca_caf/verbs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Import pipeline for this channel.
Verb definitions for this channel.
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
Expand All @@ -15,9 +15,9 @@
-->
<import resource="beans.xml"/>

<bean id="ca_caf_serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
<bean id="serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="caf_serializeImported"/>
<property name="id" value="serializeImported"/>
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
Expand All @@ -26,24 +26,14 @@
</property>
</bean>

<bean id="ca_caf_import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
<bean id="import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
init-method="initialize" lazy-init="true">
<property name="id" value="ca_caf_import"/>
<property name="id" value="import"/>
<property name="stages">
<list>
<ref bean="fetchCafExportAggregate"/>
<ref bean="checkCafSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>

<ref bean="ca_caf_exportedEntities"/>
<ref bean="standardImportTail"/>

<ref bean="ca_caf_serializeImported"/>
<ref bean="serializeImported"/>
</list>
</property>
</bean>
Expand Down
43 changes: 35 additions & 8 deletions mdx/ch_switchaai/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,56 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!--
Fetch the SWITCH metadata aggregate. For the moment, use the production aggregate in lieu
of a designated export aggregate.
Fetch the SWITCH production aggregate.
-->
<bean id="fetchSwitchExportAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage">
<property name="id" value="fetchSwitchExportAggregate"/>
<bean id="ch_switchaai_productionAggregate" class="net.shibboleth.metadata.dom.DomHttpSourceStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ch_switchaai_productionAggregate"/>
<property name="parserPool" ref="parserPool"/>
<property name="sourceUrl" value="http://switch.ch/aai/federation/SWITCHaai/metadata.switchaai_signed.xml"/>
</bean>

<!--
SWITCH federation signing certificate.
-->
<bean id="switchSigningCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean">
<bean id="ch_switchaai_signingCertificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
lazy-init="true">
<property name="certificateFile">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/ch_switchaai/metadata.crt"/>
</bean>
</property>
</bean>

<bean id="checkSwitchSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage">
<property name="id" value="checkSwitchSignature"/>
<property name="verificationCertificate" ref="switchSigningCertificate"/>
<!--
Check against SWITCH signing signature.
-->
<bean id="ch_switchaai_checkSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ch_switchaai_checkSignature"/>
<property name="verificationCertificate" ref="ch_switchaai_signingCertificate"/>
</bean>

<!--
Fetch and process the exported entities as a collection.
-->
<bean id="ch_switchaai_exportedEntities" class="net.shibboleth.metadata.pipeline.CompositeStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ch_switchaai_exportedEntities"/>
<property name="composedStages">
<list>
<!-- no export aggregate; use the production one instead -->
<ref bean="ch_switchaai_productionAggregate"/>
<ref bean="ch_switchaai_checkSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>
</list>
</property>
</bean>

</beans>
24 changes: 7 additions & 17 deletions mdx/ch_switchaai/import.xml → mdx/ch_switchaai/verbs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Import pipeline for this channel.
Verb definitions for this channel.
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
Expand All @@ -15,9 +15,9 @@
-->
<import resource="beans.xml"/>

<bean id="ch_switchaai_serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
<bean id="serializeImported" class="net.shibboleth.metadata.pipeline.SerializationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="ch_switchaai_serializeImported"/>
<property name="id" value="serializeImported"/>
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
Expand All @@ -26,24 +26,14 @@
</property>
</bean>

<bean id="ch_switchaai_import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
<bean id="import" class="net.shibboleth.metadata.pipeline.SimplePipeline"
init-method="initialize" lazy-init="true">
<property name="id" value="ch_switchaai_import"/>
<property name="id" value="import"/>
<property name="stages">
<list>
<ref bean="fetchSwitchExportAggregate"/>
<ref bean="checkSwitchSignature"/>

<!-- failure to validate signature is fatal -->
<ref bean="errorTerminatingFilter"/>

<ref bean="disassemble"/>

<ref bean="standardImportActions"/>

<ref bean="ch_switchaai_exportedEntities"/>
<ref bean="standardImportTail"/>

<ref bean="ch_switchaai_serializeImported"/>
<ref bean="serializeImported"/>
</list>
</property>
</bean>
Expand Down
Loading

0 comments on commit 0e2a6bd

Please sign in to comment.