Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add ant target to generate HTML table of IdPs and scopes
See ukf/ukf-meta#258 for details
Alex Stuart
committed
Sep 23, 2020
1 parent
fef2b65
commit a0d5a1b
Showing
6 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ Thumbs.db | |
|
||
# /build/ | ||
/build/locations.txt | ||
/build/orgnamescope.html | ||
|
||
# /charting/ | ||
/charting/cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Generate HTML pages from XML products | ||
|
||
## Tests | ||
|
||
xsltproc ../../../utilities/orgnamescope.xsl scope-test.xml | diff - scope-test.out | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" style="margin-left:-20%;margin-right:+20%;"><table id="orgnameidp" class="tiger"> | ||
<tr class="ind1"> | ||
<th>DisplayName</th> | ||
<th>Organisation Name</th> | ||
<th>entityID</th> | ||
<th>Scopes</th> | ||
<th>Visibility</th> | ||
</tr> | ||
<small><tr class="ind1" valign="top"> | ||
<td>Bantshire University</td> | ||
<td>Bantshire University</td> | ||
<td><a class="external" href="https://met.refeds.org/met/entity/https://bantshire.ac.uk/idp/?federation=uk-access-management-federation">https://bantshire.ac.uk/idp</a></td> | ||
<td>bantshire.ac.uk<br> | ||
</td> | ||
<td>Yes</td> | ||
</tr> | ||
<tr class="ind1" valign="top"> | ||
<td>Rummidge University</td> | ||
<td>Rummidge University</td> | ||
<td><a class="external" href="https://met.refeds.org/met/entity/https://idp.rummidge.ac.uk/idp/?federation=uk-access-management-federation">https://idp.rummidge.ac.uk/idp</a></td> | ||
<td>rummidge.ac.uk<br> | ||
</td> | ||
<td>Yes</td> | ||
</tr> | ||
<tr class="ind1" valign="top"> | ||
<td>Unseen University</td> | ||
<td>Unseen University</td> | ||
<td><a class="external" href="https://met.refeds.org/met/entity/urn:mace:ac.uk:sdss.ac.uk:provider:identity:unseen.ac.uk/?federation=uk-access-management-federation">urn:mace:ac.uk:sdss.ac.uk:provider:identity:unseen.ac.uk</a></td> | ||
<td> | ||
<br><details><summary>6 Scopes</summary>ankh.unseen.ac.uk<br>morpock.unseen.ac.uk<br>naphill.unseen.ac.uk<br>library.unseen.ac.uk<br>high.energy.magic.unseen.ac.uk<br>unseen.ac.uk<br></details> | ||
</td> | ||
<td>No</td> | ||
</tr></small> | ||
</table></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" | ||
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" | ||
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" | ||
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" | ||
xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" | ||
xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"> | ||
<EntityDescriptor entityID='https://idp.rummidge.ac.uk/idp'> | ||
<Extensions> | ||
<uklabel:AccountableUsers /> | ||
<uklabel:UKFederationMember /> | ||
<mdrpi:RegistrationInfo registrationAuthority='http://ukfederation.org.uk' /> | ||
</Extensions> | ||
<IDPSSODescriptor> | ||
<Extensions> | ||
<shibmd:Scope>rummidge.ac.uk</shibmd:Scope> | ||
</Extensions> | ||
</IDPSSODescriptor> | ||
<Organization> | ||
<OrganizationName xml:lang='en'>Rummidge University</OrganizationName> | ||
<OrganizationDisplayName xml:lang='en'>Rummidge University</OrganizationDisplayName> | ||
</Organization> | ||
</EntityDescriptor> | ||
<EntityDescriptor entityID='urn:mace:ac.uk:sdss.ac.uk:provider:identity:unseen.ac.uk'> | ||
<Extensions> | ||
<uklabel:AccountableUsers /> | ||
<uklabel:UKFederationMember /> | ||
<mdrpi:RegistrationInfo registrationAuthority='http://ukfederation.org.uk' /> | ||
<mdattr:EntityAttributes> | ||
<saml:Attribute Name="http://macedir.org/entity-category" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"> | ||
<saml:AttributeValue>http://refeds.org/category/hide-from-discovery</saml:AttributeValue> | ||
</saml:Attribute> | ||
</mdattr:EntityAttributes> | ||
</Extensions> | ||
<IDPSSODescriptor> | ||
<Extensions> | ||
<shibmd:Scope>ankh.unseen.ac.uk</shibmd:Scope> | ||
<shibmd:Scope>morpock.unseen.ac.uk</shibmd:Scope> | ||
<shibmd:Scope>naphill.unseen.ac.uk</shibmd:Scope> | ||
<shibmd:Scope>library.unseen.ac.uk</shibmd:Scope> | ||
<shibmd:Scope>high.energy.magic.unseen.ac.uk</shibmd:Scope> | ||
<shibmd:Scope>unseen.ac.uk</shibmd:Scope> | ||
</Extensions> | ||
</IDPSSODescriptor> | ||
<Organization> | ||
<OrganizationName xml:lang='en'>Unseen University</OrganizationName> | ||
<OrganizationDisplayName xml:lang='en'>Unseen University</OrganizationDisplayName> | ||
</Organization> | ||
</EntityDescriptor> | ||
<EntityDescriptor entityID='https://bantshire.ac.uk/idp'> | ||
<Extensions> | ||
<uklabel:AccountableUsers /> | ||
<uklabel:UKFederationMember /> | ||
<mdrpi:RegistrationInfo registrationAuthority='http://ukfederation.org.uk' /> | ||
</Extensions> | ||
<IDPSSODescriptor> | ||
<Extensions> | ||
<shibmd:Scope>bantshire.ac.uk</shibmd:Scope> | ||
</Extensions> | ||
</IDPSSODescriptor> | ||
<Organization> | ||
<OrganizationName xml:lang='en'>Bantshire University</OrganizationName> | ||
<OrganizationDisplayName xml:lang='en'>Bantshire University</OrganizationDisplayName> | ||
</Organization> | ||
</EntityDescriptor> | ||
<EntityDescriptor entityID='https://idp.monsters.edu/idp'> | ||
<Extensions> | ||
<uklabel:AccountableUsers /> | ||
</Extensions> | ||
<IDPSSODescriptor /> | ||
<Organization> | ||
<OrganizationName xml:lang='en'>Monsters University</OrganizationName> | ||
<OrganizationDisplayName xml:lang='en'>Monsters University</OrganizationDisplayName> | ||
</Organization> | ||
</EntityDescriptor> | ||
<EntityDescriptor entityID='urn:mace:ac.uk:sdss.ac.uk:provider:service:unseen.ac.uk'> | ||
<Extensions> | ||
<uklabel:AccountableUsers /> | ||
<uklabel:UKFederationMember /> | ||
<mdrpi:RegistrationInfo registrationAuthority='http://ukfederation.org.uk' /> | ||
</Extensions> | ||
<SPSSODescriptor /> | ||
<Organization> | ||
<OrganizationName xml:lang='en'>Unseen University</OrganizationName> | ||
<OrganizationDisplayName xml:lang='en'>Unseen University SP</OrganizationDisplayName> | ||
</Organization> | ||
</EntityDescriptor> | ||
</EntitiesDescriptor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
orgnamescope.xsl | ||
XSL stylesheet taking a UK federation metadata file and resulting in a table listing entityID, member (Organisation) name, Organisation Display Name and Scopes. | ||
--> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" | ||
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" | ||
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" | ||
exclude-result-prefixes="xsi xsl md mdrpi shibmd" > | ||
|
||
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes"/> | ||
|
||
<xsl:template match="/"> | ||
<div style="margin-left:-20%;margin-right:+20%;"> | ||
<table id="orgnameidp" class="tiger"> | ||
<tr class="ind1"> | ||
<th>DisplayName</th> | ||
<th>Organisation Name</th> | ||
<th>entityID</th> | ||
<th>Scopes</th> | ||
<th>Visibility</th> | ||
</tr> | ||
<small> | ||
<xsl:apply-templates/> | ||
</small> | ||
</table> | ||
</div> | ||
</xsl:template> | ||
|
||
<xsl:template name="metadata-aggregate" match="md:EntitiesDescriptor"> | ||
<xsl:variable name="entities" select="//md:EntityDescriptor"/> | ||
<xsl:variable name="idps" select="$entities[md:IDPSSODescriptor]"/> | ||
<xsl:for-each select="$idps[(md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority='http://ukfederation.org.uk')]"> | ||
<xsl:sort select="md:Organization/md:OrganizationDisplayName[@xml:lang='en']"/><tr class="ind1" valign="top"><td> | ||
<xsl:value-of select="md:Organization/md:OrganizationDisplayName[@xml:lang='en']"/></td><td> | ||
<xsl:value-of select="md:Organization/md:OrganizationName[@xml:lang='en']"/></td><td> | ||
<xsl:variable name="entityID" select="@entityID"/> | ||
<a class='external' href="https://met.refeds.org/met/entity/{$entityID}/?federation=uk-access-management-federation"> | ||
<xsl:value-of select="@entityID"/></a></td><td> | ||
<xsl:for-each select="md:IDPSSODescriptor/md:Extensions"> | ||
<xsl:variable name="numberofscopes"> | ||
<xsl:value-of select="count(shibmd:Scope)"/> | ||
</xsl:variable> | ||
<xsl:choose> | ||
<xsl:when test="$numberofscopes > 5"><br/><details><summary> | ||
<xsl:value-of select="$numberofscopes"/> Scopes</summary> | ||
<xsl:for-each select="shibmd:Scope"> | ||
<xsl:value-of select="."/><br/> | ||
<xsl:if test="position != last()"><br/></xsl:if> | ||
</xsl:for-each></details> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:for-each select="shibmd:Scope"> | ||
<xsl:value-of select="."/><br/> | ||
<xsl:if test="position != last()"><br/></xsl:if> | ||
</xsl:for-each> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:for-each></td><td> | ||
<xsl:choose> | ||
<xsl:when test="md:Extensions/mdattr:EntityAttributes/saml:Attribute | ||
[@Name='http://macedir.org/entity-category'] | ||
[@NameFormat='urn:oasis:names:tc:SAML:2.0:attrname-format:uri'] | ||
[saml:AttributeValue[.='http://refeds.org/category/hide-from-discovery']]" | ||
>No</xsl:when> | ||
<xsl:otherwise>Yes</xsl:otherwise> | ||
</xsl:choose> | ||
</td></tr> | ||
</xsl:for-each> | ||
</xsl:template> | ||
</xsl:stylesheet> | ||
|