Skip to content

Commit

Permalink
Migrate checks on the DiscoveryResponse extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed May 11, 2009
1 parent 5cbec31 commit 370abc5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 60 deletions.
18 changes: 18 additions & 0 deletions build/check.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Expand Down Expand Up @@ -87,6 +88,23 @@
</xsl:template>


<!--
Checks on the DiscoveryResponse extension.
-->

<xsl:template match="idpdisc:DiscoveryResponse[not(@Binding)]">
<xsl:call-template name="fatal">
<xsl:with-param name="m">missing Binding attribute on DiscoveryResponse</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template match="idpdisc:DiscoveryResponse[@Binding]
[@Binding!='urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol']">
<xsl:call-template name="fatal">
<xsl:with-param name="m">incorrect Binding value on DiscoveryResponse</xsl:with-param>
</xsl:call-template>
</xsl:template>

<!--
Common template to call to report a fatal error on some element within an entity.
-->
Expand Down
60 changes: 0 additions & 60 deletions build/statistics.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,8 @@
select="dyn:closure($owners/md:OrganizationName, '$entities[md:Organization/md:OrganizationName = current()]')"/>
<xsl:variable name="prob.unowned.entities" select="set:difference($entities, $ownedEntities)"/>

<!-- missing Binding attribute on DiscoveryServiceResponse elements -->
<xsl:variable name="prob.discovery.binding.missing"
select="$entities[descendant::idpdisc:DiscoveryResponse[not(@Binding)]]"/>

<!-- wrong Binding attribute value on DiscoveryServiceResponse elements -->
<xsl:variable name="prob.discovery.binding.wrong"
select="$entities[descendant::idpdisc:DiscoveryResponse[@Binding]
[@Binding!='urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol']]"/>

<!-- all problems, used as a conditional -->
<xsl:variable name="prob.all" select="$prob.nohttps.location |
$prob.discovery.binding.missing |
$prob.discovery.binding.wrong |
$prob.dup.entityID |
$prob.dup.ODNs |
$prob.unowned.entities"/>
Expand Down Expand Up @@ -229,55 +218,6 @@
</ul>
</xsl:if>

<xsl:if test="count($prob.discovery.binding.missing) != 0">
<p>
The following
<xsl:choose>
<xsl:when test="count($prob.discovery.binding.missing) = 1">
entity has a discovery response element
</xsl:when>
<xsl:otherwise>
entities have discovery response elements
</xsl:otherwise>
</xsl:choose>
lacking a <code>Binding</code> attribute:
</p>
<ul>
<xsl:for-each select="$prob.discovery.binding.missing">
<xsl:sort select="@ID"/>
<li>
<xsl:value-of select="@ID"/>:
<code><xsl:value-of select="@entityID"/></code>
</li>
</xsl:for-each>
</ul>
</xsl:if>

<xsl:if test="count($prob.discovery.binding.wrong) != 0">
<p>
The following
<xsl:choose>
<xsl:when test="count($prob.discovery.binding.missing) = 1">
entity has a discovery response element
</xsl:when>
<xsl:otherwise>
entities have discovery response elements
</xsl:otherwise>
</xsl:choose>
with an unrecognised <code>Binding</code> value:
</p>
<ul>
<xsl:for-each select="$prob.discovery.binding.wrong">
<xsl:sort select="@ID"/>
<li>
<xsl:value-of select="@ID"/>:
<code><xsl:value-of select="@entityID"/></code>
(<code><xsl:value-of select="descendant::idpdisc:DiscoveryResponse/@Binding"/></code>)
</li>
</xsl:for-each>
</ul>
</xsl:if>

</xsl:if>


Expand Down

0 comments on commit 370abc5

Please sign in to comment.