-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proof-of-concept discovery feed generation
See ukf/ukf-meta#230.
- Loading branch information
Showing
2 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Verb to generate EDS-format JSON discovery feeds corresponding to | ||
the (previously generated) unsigned production aggregate. | ||
Two such feeds are generated: | ||
* discofeed-all.json includes all IdPs in the production aggregate. | ||
* discofeed.json includes only those IdPs not marked as hidden. | ||
--> | ||
<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.xsd | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> | ||
|
||
<!-- | ||
Import commonly used beans. | ||
--> | ||
<import resource="classpath:common-beans.xml"/> | ||
|
||
<!-- | ||
Import channel-specific beans. | ||
--> | ||
<import resource="classpath:uk/beans.xml"/> | ||
|
||
<!-- | ||
***************************** | ||
*** *** | ||
*** U T I L I T I E S *** | ||
*** *** | ||
***************************** | ||
--> | ||
|
||
<!-- This bean MUST be called "conversionService" to work properly. --> | ||
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean"> | ||
<property name="converters"> | ||
<set> | ||
<bean class="net.shibboleth.ext.spring.config.DurationToLongConverter" /> | ||
<bean class="net.shibboleth.ext.spring.config.StringToIPRangeConverter" /> | ||
<bean class="net.shibboleth.ext.spring.config.BooleanToPredicateConverter" /> | ||
<bean class="net.shibboleth.ext.spring.config.StringBooleanToPredicateConverter" /> | ||
<bean class="net.shibboleth.ext.spring.config.StringToResourceConverter" /> | ||
</set> | ||
</property> | ||
</bean> | ||
|
||
|
||
<!-- | ||
*************************************************** | ||
*** *** | ||
*** P R O D U C T I O N A G G R E G A T E *** | ||
*** *** | ||
*************************************************** | ||
--> | ||
|
||
<bean id="serializeUnsignedProductionAggregate" parent="mda.SerializationStage"> | ||
<property name="serializer" ref="serializer"/> | ||
<property name="outputFile"> | ||
<bean parent="File"> | ||
<constructor-arg value="${output.dir}/ukfederation-metadata-unsigned.xml"/> | ||
</bean> | ||
</property> | ||
</bean> | ||
|
||
|
||
<!-- | ||
************************************* | ||
*** *** | ||
*** M A I N P I P E L I N E *** | ||
*** *** | ||
************************************* | ||
--> | ||
|
||
<bean id="discoFeedSerializer" parent="ukf.DiscoFeedCollectionSerializer" | ||
p:prettyPrinting="true"/> | ||
|
||
<bean id="discofeeds" parent="mda.SimplePipeline"> | ||
<property name="stages"> | ||
<list> | ||
<!-- | ||
Acquire the production aggregate and split it into | ||
individual entities. | ||
--> | ||
<bean id="productionAggregate" parent="mda.DOMResourceSourceStage" | ||
p:parserPool-ref="parserPool"> | ||
<property name="DOMResource"> | ||
<bean parent="FileSystemResource"> | ||
<constructor-arg value="${output.dir}/ukfederation-metadata-unsigned.xml"/> | ||
</bean> | ||
</property> | ||
</bean> | ||
<ref bean="disassemble"/> | ||
|
||
<!-- | ||
Serialize all IdPs in the collection into a feed. | ||
--> | ||
<bean id="discoFeedAll" parent="mda.SerializationStage" | ||
p:serializer-ref="discoFeedSerializer"> | ||
<property name="outputFile"> | ||
<bean parent="File"> | ||
<constructor-arg value="${output.dir}/discofeed-all.json"/> | ||
</bean> | ||
</property> | ||
</bean> | ||
|
||
<!-- | ||
Remove all "hidden from discovery" IdPs. | ||
--> | ||
<bean id="removeHidden" parent="mda.XPathFilteringStage" | ||
p:namespaceContext-ref="commonNamespaces" | ||
p:XPathExpression="//mdattr:EntityAttributes/saml:Attribute | ||
[@Name = 'http://macedir.org/entity-category'] | ||
[@NameFormat = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'] | ||
[saml:AttributeValue[.='http://refeds.org/category/hide-from-discovery']]"/> | ||
|
||
<!-- | ||
Serialize all IdPs that remain into a second feed. | ||
--> | ||
<bean id="discoFeed" parent="mda.SerializationStage" | ||
p:serializer-ref="discoFeedSerializer"> | ||
<property name="outputFile"> | ||
<bean parent="File"> | ||
<constructor-arg value="${output.dir}/discofeed.json"/> | ||
</bean> | ||
</property> | ||
</bean> | ||
|
||
</list> | ||
</property> | ||
</bean> | ||
|
||
</beans> |