Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Construct an eduGAIN import aggregate for InCommon.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed May 21, 2014
1 parent 2e4f2ec commit aa7175c
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 0 deletions.
1 change: 1 addition & 0 deletions mdx/incommon/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
exported.xml
imported.xml
30 changes: 30 additions & 0 deletions mdx/incommon/import-whitelist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
default-lazy-init="true"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
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
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<!--
***********************************************************
*** ***
*** E D U G A I N I M P O R T W H I T E L I S T ***
*** ***
***********************************************************
-->

<!--
The entities named in this set will be imported from eduGAIN to InCommon.
-->
<util:set id="incommon_edugain_import_whitelist">

<!-- Example entities for initial development. -->
<value>https://idp.cardiff.ac.uk/shibboleth</value>

</util:set>

</beans>
141 changes: 141 additions & 0 deletions mdx/incommon/import.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Construct InCommon eduGAIN export aggregate.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
default-lazy-init="true"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
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
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<!--
Import commonly used beans.
-->
<import resource="classpath:common-beans.xml"/>

<!--
Import channel-specific beans.
-->
<import resource="classpath:incommon/beans.xml"/>
<import resource="classpath:incommon/import-whitelist.xml"/>

<!--
Import eduGAIN channel beans.
-->
<import resource="classpath:int_edugain/beans.xml"/>

<bean id="serializeImported" parent="SerializationStage"
p:id="serializeImported">
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/incommon/imported.xml"/>
</bean>
</property>
</bean>

<!--
removeInCommonEntities
Filter out entities which declare themselves as registered
by our federation. We don't want those coming back in
from another registrar or metadata exchange as they may be
old versions of entities we have deregistered, or spoofed.
-->
<bean id="removeInCommonEntities" parent="EntityRegistrationAuthorityFilterStage"
p:id="removeInCommonEntities">
<property name="designatedRegistrationAuthorities">
<list>
<ref bean="us_incommon_registrar"/>
</list>
</property>
<property name="requiringRegistrationInformation" value="true"/>
<property name="whitelistingRegistrationAuthorities" value="false"/>
</bean>

<bean id="incommon_edugain_importPipeline" parent="SimplePipeline"
p:id="incommon_edugain_importPipeline">
<property name="stages">
<list>
<ref bean="int_edugain_productionEntities"/>
<ref bean="removeInCommonEntities"/>

<!-- Remove all but the entities we want to import. -->
<bean id="applyEntityWhitelist" parent="EntityFilterStage"
p:id="applyEntityWhitelist"
p:whitelistingEntities="true"
p:designatedEntities-ref="incommon_edugain_import_whitelist"/>

<ref bean="standardImportActions"/>

<!--
Silently remove entities which are marked as
having errors.
-->
<ref bean="errorRemover"/>
</list>
</property>
</bean>

<!--
Construct InCommon eduGAIN import aggregate.
-->
<bean id="import" parent="SimplePipeline"
p:id="import">
<property name="stages">
<list>
<!-- Start with the InCommon production aggregate. -->
<ref bean="us_incommon_productionAggregate"/>

<!--
Check for fatal errors at the aggregate level:
missing or expired validUntil attribute
invalid signature
-->
<ref bean="check_validUntil"/>
<ref bean="us_incommon_checkSignature"/>
<ref bean="errorTerminatingFilter"/>

<!-- Break down into individual entities. -->
<ref bean="disassemble"/>

<!-- Include a default registrationAuthority for each entity. -->
<ref bean="us_incommon_default_regauth"/>

<!-- Merge in selected entities from eduGAIN. -->
<bean id="mergeProductionMDXEntities" parent="PipelineMergeStage.deduplicate"
p:id="mergeProductionMDXortedEntities">
<property name="mergedPipelines">
<list>
<ref bean="incommon_edugain_importPipeline"/>
</list>
</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"
p:id="finalise">
<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. -->
<ref bean="normaliseNamespaces"/>

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

</beans>

0 comments on commit aa7175c

Please sign in to comment.