Skip to content

Commit

Permalink
Remove entity-level Scope elements from the export aggregate, leaving…
Browse files Browse the repository at this point in the history
… only the ones associated with role descriptors.
  • Loading branch information
iay committed Apr 17, 2013
1 parent 982e640 commit a1a1e7d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
38 changes: 38 additions & 0 deletions mdx/uk/entity_scopes.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
entity_scopes.xsl
Remove entity-level Scope elements, leaving only the ones associated
with role descriptors.
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="md">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="md:EntityDescriptor/md:Extensions/shibmd:Scope">
<!-- remove entirely -->
</xsl:template>

<!--By default, copy text blocks, comments and attributes unchanged.-->
<xsl:template match="text()|comment()|@*">
<xsl:copy/>
</xsl:template>

<!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
25 changes: 25 additions & 0 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@
<import resource="../us_incommon/beans.xml"/>


<!--
*****************************
*** ***
*** U T I L I T I E S ***
*** ***
*****************************
-->

<!--
stripEntityScopes
Remove entity-level Scope elements, leaving only the ones associated
with role descriptors.
-->
<bean id="stripEntityScopes" parent="xslt_parent"
p:id="stripEntityScopes">
<property name="xslResource">
<bean parent="file_parent">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/uk/entity_scopes.xsl"/>
</bean>
</property>
</bean>


<!--
***********************
*** ***
Expand Down Expand Up @@ -504,6 +528,7 @@
<ref bean="stripWayfNamespace"/>
<ref bean="stripKeyNames"/>
<ref bean="uk_assemble"/>
<ref bean="stripEntityScopes"/>
<ref bean="removeEmptyExtensions"/>
<ref bean="uk_finaliseExport"/>
<ref bean="uk_normaliseExport"/>
Expand Down

0 comments on commit a1a1e7d

Please sign in to comment.