Skip to content

Commit

Permalink
Add generation of an IdP-only aggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Sep 12, 2016
1 parent 375405c commit 865601a
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 14 deletions.
8 changes: 8 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,13 @@
-->
<property name="mda.inc.imported.xml" value="${mda.incdir}/imported.xml"/>

<!--
Default local file location to which to write the IdP-only aggregate.
This can be overridden in build.properties.
-->
<property name="mda.inc.imported-idp.xml" value="${mda.incdir}/imported-idp.xml"/>

<!--
Default local file location to which to write the eduGAIN aggregate.
Expand Down Expand Up @@ -2457,6 +2464,7 @@
-->
<target name="inc.generate.import">
<echo>Generating InCommon import aggregate in ${mda.inc.imported.xml}</echo>
<echo> (IdP-only aggregate in ${mda.inc.imported-idp.xml})</echo>
<echo> from production aggregate in ${mda.inc.production.xml}</echo>
<echo> and selected eduGAIN entities from ${mda.inc.edugain.xml}...</echo>
<CHANNEL.do channel="incommon" verb="import"/>
Expand Down
1 change: 1 addition & 0 deletions mdx/incommon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
edugain.xml
exported.xml
imported.xml
imported-idp.xml
production.xml
142 changes: 128 additions & 14 deletions mdx/incommon/import.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,101 @@
-->
<import resource="classpath:int_edugain/beans.xml"/>

<!--
***********************************************************
*** ***
*** C O M M O N O U T P U T P R O C E S S I N G ***
*** ***
***********************************************************
-->

<bean id="common.output" parent="CompositeStage">
<property name="composedStages">
<list>
<!-- Construct a new aggregate from the collection of entities. -->
<ref bean="assemble"/>

<!-- Apply final tweaks to the aggregate. -->
<bean id="finalise" parent="incommon_finalise_parent">
<property name="transformParameters">
<map>
<entry key="extraText" value="Contains InCommon and eduGAIN metadata"/>
<entry key="publisher" value-ref="us_incommon_registrar"/>
</map>
</property>
</bean>

<!-- Normalise the use of namespace prefixes in the resulting XML document. -->
<bean id="normalise" parent="XSLTransformationStage"
p:XSLResource="classpath:incommon/ns_norm_import.xsl"/>
</list>
</property>
</bean>


<!--
*****************************************
*** ***
*** I D P - O N L Y O U T P U T ***
*** ***
*****************************************
-->

<!--
idp.serialize
Writes the IdP-only aggregate out to a file.
-->
<bean id="idp.serialize" parent="SerializationStage">
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${inc.imported-idp.xml}"/>
</bean>
</property>
</bean>

<!--
idp.selector
Entities in the IdP-only aggregate are restricted to identity providers.
-->
<bean id="idp.selector" parent="XPathItemSelectionStrategy">
<constructor-arg value="/md:EntityDescriptor[md:IDPSSODescriptor]"/>
<constructor-arg ref="commonNamespaces"/>
</bean>

<!--
idp.pipeline
Generates the IdP-only aggregate. The selector has already taken care
of removing non-IdP entities.
-->
<bean id="idp.pipeline" parent="SimplePipeline">
<property name="stages">
<list>
<!-- Perform common steps in constructing an output aggregate. -->
<ref bean="common.output"/>

<!-- Write the resulting aggregate out to a file. -->
<ref bean="idp.serialize"/>
</list>
</property>
</bean>


<!--
*************************************************
*** ***
*** A L L E N T I T I E S O U T P U T ***
*** ***
*************************************************
-->

<!--
serializeImported
Writes the import aggregate out to a file.
-->
<bean id="serializeImported" parent="SerializationStage">
<property name="outputFile">
<bean class="java.io.File">
Expand All @@ -36,6 +131,15 @@
</property>
</bean>


<!--
*************************************
*** ***
*** E D U G A I N I N P U T ***
*** ***
*************************************
-->

<bean id="incommon_edugain_importPipeline" parent="SimplePipeline">
<property name="stages">
<list>
Expand Down Expand Up @@ -83,8 +187,18 @@
</property>
</bean>


<!--
*************************************
*** ***
*** M A I N P I P E L I N E ***
*** ***
*************************************
-->

<!--
Construct InCommon eduGAIN import aggregate.
The main "import" pipeline is responsible for generating the
all-entities output aggregate.
-->
<bean id="import" parent="SimplePipeline">
<property name="stages">
Expand Down Expand Up @@ -136,22 +250,22 @@
</property>
</bean>

<!-- Construct a new aggregate from the resulting collection of entities. -->
<ref bean="assemble"/>

<!-- Apply final tweaks to the aggregate. -->
<bean id="finalise" parent="incommon_finalise_parent">
<property name="transformParameters">
<map>
<entry key="extraText" value="Contains InCommon and eduGAIN metadata"/>
<entry key="publisher" value-ref="us_incommon_registrar"/>
</map>
<!-- Fork new pipelines to generate special aggregates. -->
<bean id="demux" parent="PipelineDemultiplexerStage">
<property name="pipelineAndSelectionStrategies">
<list>
<!-- IdP-only aggregate. -->
<bean class="net.shibboleth.utilities.java.support.collection.Pair">
<constructor-arg ref="idp.pipeline"/>
<constructor-arg ref="idp.selector"/>
</bean>
</list>
</property>
<property name="waitingForPipelines" value="true"/>
</bean>

<!-- Normalise the use of namespace prefixes in the resulting XML document. -->
<bean id="normalise" parent="XSLTransformationStage"
p:XSLResource="classpath:incommon/ns_norm_import.xsl"/>
<!-- Perform common steps in constructing an output aggregate. -->
<ref bean="common.output"/>

<!-- Write the resulting aggregate out to a file. -->
<ref bean="serializeImported"/>
Expand Down

0 comments on commit 865601a

Please sign in to comment.