Skip to content

Commit

Permalink
Add a breakdown by software (numeric only except for the unknown sect…
Browse files Browse the repository at this point in the history
…ions) to the IdP and SP sections.
  • Loading branch information
iay committed Mar 20, 2009
1 parent 54952ae commit 30a70b3
Showing 1 changed file with 326 additions and 1 deletion.
327 changes: 326 additions & 1 deletion build/statistics.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,14 @@
</li>

</ul>


<xsl:call-template name="entity.breakdown.by.software">
<xsl:with-param name="entities" select="$idps"/>
</xsl:call-template>




<h3>Service Providers</h3>
<p>There are <xsl:value-of select="$spCount"/> service providers,
including <xsl:value-of select="$dualEntityCount"/>
Expand Down Expand Up @@ -817,6 +824,9 @@

</ul>

<xsl:call-template name="entity.breakdown.by.software">
<xsl:with-param name="entities" select="$sps"/>
</xsl:call-template>



Expand Down Expand Up @@ -1453,4 +1463,319 @@
<xsl:text>]</xsl:text>
</xsl:template>



<!--
Break down a set of entities by the software used.
-->
<xsl:template name="entity.breakdown.by.software">
<xsl:param name="entities"/>
<xsl:variable name="entityCount" select="count($entities)"/>
<p>
Breakdown by software used:
</p>
<ul>
<!--
*********************************************************************
*** ***
*** C L A S S I F Y E N T I T I E S B Y S O F T W A R E ***
*** ***
*********************************************************************
The classification algorithms used here are chained together so that
each classification step works only on those entities not already
classified. This means that entities won't be counted twice, but
means that the order of classification blocks is important and
shouldn't be changed without careful thought. In general, more
specific algorithms should appear before more general ones.
-->

<!--
Classify miscellaneous entities.
Here we pull off a list of entities labelled with explicit
Software labels that aren't for the software we address
in more detail below. The result is, as it were, a list of
"known unknowns" that we can re-integrate later with those
entities we fail to classify altogether.
-->
<xsl:variable name="entities.misc.in" select="$entities"/>
<xsl:variable name="entities.misc"
select="$entities.misc.in[
md:Extensions/uklabel:Software
[@name != 'Shibboleth']
[@name != 'EZproxy']
[@name != 'OpenAthens SP']
[@name != 'Guanxi']
[@name != 'simpleSAMLphp']
[@name != 'Atypon SAML SP']
[@name != 'AthensIM']
]"/>
<xsl:variable name="entities.misc.out"
select="set:difference($entities.misc.in, $entities.misc)"/>

<!--
Classify EZproxy SPs
-->
<xsl:variable name="entities.ezproxy.in" select="$entities.misc.out"/>
<xsl:variable name="entities.ezproxy"
select="$entities.ezproxy.in[md:Extensions/uklabel:Software/@name='EZproxy']"/>
<xsl:variable name="entities.ezproxy.out"
select="set:difference($entities.ezproxy.in, $entities.ezproxy)"/>

<!--
Classify simpleSAMLphp entities.
-->
<xsl:variable name="entities.simplesamlphp.in" select="$entities.ezproxy.out"/>
<xsl:variable name="entities.simplesamlphp"
select="$entities.simplesamlphp.in[md:Extensions/uklabel:Software/@name='simpleSAMLphp']"/>
<xsl:variable name="entities.simplesamlphp.out"
select="set:difference($entities.simplesamlphp.in, $entities.simplesamlphp)"/>

<!--
Classify Atypon SAML SP entities.
-->
<xsl:variable name="entities.atyponsamlsp.in" select="$entities.simplesamlphp.out"/>
<xsl:variable name="entities.atyponsamlsp"
select="$entities.atyponsamlsp.in[md:Extensions/uklabel:Software/@name='Atypon SAML SP']"/>
<xsl:variable name="entities.atyponsamlsp.out"
select="set:difference($entities.atyponsamlsp.in, $entities.atyponsamlsp)"/>

<!--
Classify OpenAthens SP entities.
-->
<xsl:variable name="entities.openathenssp.in" select="$entities.atyponsamlsp.out"/>
<xsl:variable name="entities.openathenssp"
select="$entities.openathenssp.in[md:Extensions/uklabel:Software/@name='OpenAthens SP']"/>
<xsl:variable name="entities.openathenssp.out"
select="set:difference($entities.openathenssp.in, $entities.openathenssp)"/>

<!--
Classify Shibboleth 2.0 IdPs and SPs.
-->
<xsl:variable name="entities.shib.2.in" select="$entities.openathenssp.out"/>
<xsl:variable name="entities.shib.2"
select="$entities.shib.2.in[
md:IDPSSODescriptor/md:SingleSignOnService[contains(@Location, '/profile/Shibboleth/SSO')] |
md:SPSSODescriptor/md:AssertionConsumerService[contains(@Location, '/Shibboleth.sso/SAML2/POST')] |
md:Extensions/uklabel:Software[@name='Shibboleth'][@version = '2']
]"/>
<xsl:variable name="entities.shib.2.out"
select="set:difference($entities.shib.2.in, $entities.shib.2)"/>

<!--
Classify Shibboleth 1.3 entities.
-->
<xsl:variable name="entities.shib.13.in" select="$entities.shib.2.out"/>
<xsl:variable name="entities.shib.13.knownHere" select="
$entities.shib.13.in[@entityID='urn:mace:ac.uk:sdss.ac.uk:provider:identity:shib.ncl.ac.uk'] |
$entities.shib.13.in[@entityID='https://typekey.sdss.ac.uk/shibboleth'] |
$entities.shib.13.in[@entityID='https://typekey.iay.org.uk/shibboleth'] |
$entities.shib.13.in[@entityID='https://idp-1.bgfl.org/shibboleth'] |
$entities.shib.13.in[@entityID='urn:mace:ac.uk:sdss.ac.uk:provider:identity:shibboleth-i.sgul.ac.uk'] |
$entities.shib.13.in[@entityID='https://idp.protectnetwork.org/protectnetwork-idp'] |
$entities.shib.13.in[@entityID='urn:mace:ac.uk:sdss.ac.uk:provider:service:dangermouse.ncl.ac.uk'] |
$entities.shib.13.in[@entityID='https://spie.oucs.ox.ac.uk/shibboleth/wiki'] |
$entities.shib.13.in[@entityID='https://sdauth.sciencedirect.com/']
"/>
<xsl:variable name="entities.shib.13.unknownHere"
select="set:difference($entities.shib.13.in, $entities.shib.13.knownHere)"/>
<xsl:variable name="entities.shib.13.known" select="
$entities.shib.13.unknownHere[md:Extensions/uklabel:Software[@name='Shibboleth'][@version = '1.3']] |
$entities.shib.13.knownHere
"/>
<xsl:variable name="entities.shib.13.unknown"
select="set:difference($entities.shib.13.in, $entities.shib.13.known)"/>
<xsl:variable name="entities.shib.13"
select="$entities.shib.13.in[
md:IDPSSODescriptor/md:SingleSignOnService[contains(@Location, '-idp/SSO')] |
md:SPSSODescriptor/md:AssertionConsumerService[contains(@Location, 'Shibboleth.sso')]
] | $entities.shib.13.known"/>
<xsl:variable name="entities.shib.13.count" select="count($entities.shib.13)"/>
<xsl:variable name="entities.shib.13.out"
select="set:difference($entities.shib.13.in, $entities.shib.13)"/>

<!--
Classify Athens Gateway entities
-->
<xsl:variable name="entities.gateways.in" select="$entities.shib.13.out"/>
<xsl:variable name="knownGateways" select="
$entities.gateways.in[@entityID='urn:mace:eduserv.org.uk:athens:federation:beta'] |
$entities.gateways.in[@entityID='urn:mace:eduserv.org.uk:athens:federation:uk']
"/>
<xsl:variable name="entities.gateways.out"
select="set:difference($entities.gateways.in, $knownGateways)"/>

<!--
Classify OpenAthens virtual IdPs.
-->
<xsl:variable name="entities.openathens.virtual.in" select="$entities.gateways.out"/>
<xsl:variable name="entities.openathens.virtual"
select="$entities.openathens.virtual.in[md:Extensions/eduservlabel:AthensPUIDAuthority]"/>
<xsl:variable name="entities.openathens.virtual.out"
select="set:difference($entities.openathens.virtual.in, $entities.openathens.virtual)"/>

<!--
Classify Guanxi entities.
-->
<xsl:variable name="entities.guanxi.in" select="$entities.openathens.virtual.out"/>
<xsl:variable name="entities.guanxi"
select="$entities.guanxi.in[md:Extensions/uklabel:Software/@name='Guanxi']"/>
<xsl:variable name="entities.guanxi.out"
select="set:difference($entities.guanxi.in, $entities.guanxi)"/>

<!--
Classify AthensIM entities.
-->
<xsl:variable name="entities.athensim.in" select="$entities.guanxi.out"/>
<xsl:variable name="entities.athensim"
select="$entities.athensim.in[md:Extensions/uklabel:Software/@name='AthensIM']"/>
<xsl:variable name="entities.athensim.out"
select="set:difference($entities.athensim.in, $entities.athensim)"/>

<!--
Variables containing all classified and unclassified entities, respectively.
-->
<xsl:variable name="entities.unclassified" select="$entities.athensim.out"/>
<xsl:variable name="entities.classified"
select="set:difference($entities, $entities.unclassified)"/>

<!--
Remaining entities are unknown.
-->
<xsl:variable name="knownSoftwareEntities"
select="$entities.classified"/>
<xsl:variable name="unknownSoftwareEntities"
select="set:difference($entities, $knownSoftwareEntities) | $entities.misc"/>
<xsl:variable name="unknownSoftwareEntityCount" select="count($unknownSoftwareEntities)"/>

<!--
***************************************************************
*** ***
*** R E P O R T C L A S S I F I E D E N T I T I E S ***
*** ***
***************************************************************
-->

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.shib.13"/>
<xsl:with-param name="name">Shibboleth 1.3</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.shib.2"/>
<xsl:with-param name="name">Shibboleth 2.x</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:variable name="entities.shib" select="$entities.shib.13 | $entities.shib.2"/>
<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.shib"/>
<xsl:with-param name="name">Shibboleth combined</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:variable name="entities.not.shib" select="set:difference($entities, $entities.shib)"/>
<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.not.shib"/>
<xsl:with-param name="name">Other than Shibboleth</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.ezproxy"/>
<xsl:with-param name="name">EZproxy</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.simplesamlphp"/>
<xsl:with-param name="name">simpleSAMLphp</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.atyponsamlsp"/>
<xsl:with-param name="name">Atypon SAML SP</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.athensim"/>
<xsl:with-param name="name">AthensIM</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.guanxi"/>
<xsl:with-param name="name">Guanxi</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$knownGateways"/>
<xsl:with-param name="name">Athens/Shibboleth gateway</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.openathens.virtual"/>
<xsl:with-param name="name">OpenAthens Virtual IdP</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$entities.openathenssp"/>
<xsl:with-param name="name">OpenAthens SP</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
</xsl:call-template>

<xsl:call-template name="entity.breakdown.by.software.line">
<xsl:with-param name="entities" select="$unknownSoftwareEntities"/>
<xsl:with-param name="name">Unknown or other</xsl:with-param>
<xsl:with-param name="total" select="$entityCount"/>
<xsl:with-param name="show" select="1"/>
</xsl:call-template>

</ul>
</xsl:template>

<xsl:template name="entity.breakdown.by.software.line">
<xsl:param name="entities"/>
<xsl:param name="name"/>
<xsl:param name="total"/>
<xsl:param name="show">0</xsl:param>
<xsl:variable name="n" select="count($entities)"/>
<xsl:if test="$n != 0">
<li>
<p>
<xsl:value-of select="$name"/>: <xsl:value-of select="$n"/>
(<xsl:value-of select="format-number($n div $total, '0.0%')"/>)
</p>
<xsl:if test="$show != 0">
<ul>
<xsl:for-each select="$entities">
<li>
<xsl:value-of select="@ID"/>:
<code><xsl:value-of select="@entityID"/></code>
<xsl:choose>
<xsl:when test="@entityID = 'https://adfs.devnet3.plymouth.ac.uk'">
(Microsoft ADFS)
</xsl:when>
<xsl:when test="@entityID = 'https://www.educationcity.com/sso/shib'">
(proprietary implementation)
</xsl:when>
<xsl:when test="md:Extensions/uklabel:Software">
(<xsl:value-of select="md:Extensions/uklabel:Software/@name"/>)
</xsl:when>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 30a70b3

Please sign in to comment.