-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a framework for experimenting with revised trust fabrics.
- Loading branch information
Showing
2 changed files
with
174 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
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,128 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| test_master_unsigned.xsl | ||
| XSL stylesheet that takes the test federation master file containing all information | ||
| about federation entities and removes information not destined to be published. | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | ||
| xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF" | ||
| xmlns:uklabel="http://ukfederation.org.uk/2006/11/label" | ||
|
|
||
| xmlns:date="http://exslt.org/dates-and-times" | ||
| xmlns:mdxDates="xalan://uk.ac.sdss.xalan.md.Dates" | ||
| extension-element-prefixes="date mdxDates" | ||
|
|
||
| xmlns="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| exclude-result-prefixes="wayf"> | ||
|
|
||
| <!--Force UTF-8 encoding for the output.--> | ||
| <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/> | ||
|
|
||
| <!-- | ||
| validityDays | ||
| This parameter determines the number of days between the aggregation instant and the | ||
| end of validity of the signed metadata. | ||
| --> | ||
| <xsl:variable name="validityDays" select="14"/> | ||
|
|
||
| <xsl:variable name="now" select="date:date-time()"/> | ||
| <xsl:variable name="validUntil" select="mdxDates:dateAdd($now, $validityDays)"/> | ||
|
|
||
| <!-- | ||
| Document root. | ||
| --> | ||
| <xsl:template match="/"> | ||
| <xsl:call-template name="document.comment"/> | ||
| <xsl:apply-templates/> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Document element. | ||
| --> | ||
| <xsl:template match="/md:EntitiesDescriptor"> | ||
| <xsl:copy> | ||
| <xsl:attribute name="validUntil"> | ||
| <xsl:value-of select="$validUntil"/> | ||
| </xsl:attribute> | ||
| <xsl:apply-templates select="@*"/> | ||
| <xsl:call-template name="document.comment"/> | ||
| <xsl:apply-templates select="node()"/> | ||
| </xsl:copy> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Replace the aggregate Name with one making it distinct from the | ||
| main UK federation metadata aggregates. | ||
| --> | ||
| <xsl:template match="/md:EntitiesDescriptor/@Name"> | ||
| <xsl:attribute name="Name">http://ukfederation.org.uk/test</xsl:attribute> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Comment to be added to the top of the document, and just inside the document element. | ||
| --> | ||
| <xsl:template name="document.comment"> | ||
| <xsl:comment> | ||
| <xsl:text> 	T E S T F E D E R A T I O N M E T A D A T A </xsl:text> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:text>	Aggregate built </xsl:text> | ||
| <xsl:value-of select="$now"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:text>	Aggregate valid for </xsl:text> | ||
| <xsl:value-of select="$validityDays"/> | ||
| <xsl:text> days, until </xsl:text> | ||
| <xsl:value-of select="$validUntil"/> | ||
| <xsl:text> </xsl:text> | ||
| </xsl:comment> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Pass through certain uklabel namespace elements. | ||
| --> | ||
| <xsl:template match="uklabel:UKFederationMember | | ||
| uklabel:SDSSPolicy | | ||
| uklabel:AccountableUsers"> | ||
| <xsl:copy> | ||
| <xsl:apply-templates select="node()|@*"/> | ||
| </xsl:copy> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Strip all other uklabel namespace elements entirely. | ||
| --> | ||
| <xsl:template match="uklabel:*"> | ||
| <!-- do nothing --> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Remove administrative contacts. | ||
| --> | ||
| <xsl:template match="md:ContactPerson[@contactType='administrative']"> | ||
| <!-- do nothing --> | ||
| </xsl:template> | ||
|
|
||
| <!--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> |