Skip to content

Commit

Permalink
Bugzilla 1031,1032,1036,1052: strip imported MDUI metadata on attribu…
Browse files Browse the repository at this point in the history
…te descriptor roles.
  • Loading branch information
iay committed Dec 9, 2013
1 parent 773763c commit cf35cb3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,19 @@
p:elementName="DiscoHints"
p:elementNamespace-ref="mdui_namespace"/>

<!--
stripAAMDUI
Remove all MDUI metadata from attribute authority roles.
-->
<bean id="stripAAMDUI" parent="XSLTransformationStage"
p:id="stripAAMDUI">
<property name="XSLResource">
<bean parent="ClasspathResource">
<constructor-arg value="strip-aa-mdui.xsl"/>
</bean>
</property>
</bean>


<!--
Expand Down Expand Up @@ -951,6 +964,7 @@
<ref bean="stripMdattrNamespace"/>

<ref bean="cleanImport"/>
<ref bean="stripAAMDUI"/>
<ref bean="trimImportElementWhitespace"/>
<ref bean="removeEmptyExtensions"/>
<ref bean="checkSchemas"/>
Expand Down
32 changes: 32 additions & 0 deletions mdx/strip-aa-mdui.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
strip-aa-mdui.xsl
Remove all MDUI metadata from attribute authority roles.
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Remove all MDUI metadata from attribute authority roles.
-->
<xsl:template match="md:AttributeAuthorityDescriptor/md:Extensions/mdui:*"/>

<!--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>

0 comments on commit cf35cb3

Please sign in to comment.