Skip to content

Commit

Permalink
Handle importing scopes from members.xml in the case where the IDPSSO…
Browse files Browse the repository at this point in the history
…Descriptor's Extensions element already exists.
  • Loading branch information
iay committed Sep 16, 2010
1 parent b533561 commit 5f6bc81
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion build/master_ukfederation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@
If an IdP's SSO or AA roles already includes an Extensions element, this may
already contain extensions other than scopes. We need to make sure that
if it does not also contain scopes, then any scopes declared at the entity
level are copied down.
level are copied down, and any outsourced scopes provided by the member
list are imported.
-->
<xsl:template match="md:IDPSSODescriptor/md:Extensions |
md:AttributeAuthorityDescriptor/md:Extensions">
<xsl:copy>
<xsl:variable name="entityID" select="ancestor::md:EntityDescriptor/@entityID"/>
<xsl:apply-templates select="node()"/>
<xsl:if test="not(shibmeta:Scope)">
<!-- copy scopes from EntityDescriptor extensions -->
Expand All @@ -116,6 +118,15 @@
<xsl:copy-of select="."/>
<xsl:text>&#10; </xsl:text>
</xsl:for-each>
<!-- copy scopes from member outsource records -->
<xsl:for-each select="$outsourcedScopes[members:Entity = $entityID]/members:Scope">
<xsl:text> </xsl:text>
<xsl:element name="shibmeta:Scope">
<xsl:attribute name="regexp">false</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<xsl:text>&#10; </xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:copy>
</xsl:template>
Expand Down

0 comments on commit 5f6bc81

Please sign in to comment.