-
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.
Bring back in synch with the latest aggregator snapshot.
Initial shot at a full UK federation "generate" flow.
- Loading branch information
Showing
8 changed files
with
726 additions
and
39 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
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,122 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| final_tweak.xsl | ||
| Final tweaks required for UK federation aggregates. | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" | ||
| xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label" | ||
| xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF" | ||
|
|
||
| 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" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| exclude-result-prefixes="md"> | ||
|
|
||
| <!--Force UTF-8 encoding for the output.--> | ||
| <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/> | ||
|
|
||
| <!-- | ||
| extraText | ||
| This parameter, if present, provides additional text to be put in the | ||
| document comment. | ||
| --> | ||
| <xsl:param name="extraText"/> | ||
|
|
||
| <!-- | ||
| validityDays | ||
| This parameter determines the number of days between the aggregation instant and the | ||
| end of validity of the signed metadata. | ||
| --> | ||
| <xsl:param name="validityDays" select="14"/> | ||
|
|
||
| <xsl:variable name="now" select="date:date-time()"/> | ||
| <xsl:variable name="validUntil" select="mdxDates:dateAdd($now, $validityDays)"/> | ||
|
|
||
| <!-- | ||
| documentID | ||
| This value is generated from a normalised version of the aggregation instant, | ||
| transformed so that it can be used as an XML ID value. | ||
| Strict conformance to the SAML 2.0 metadata specification (section 3.1.2) requires | ||
| that the signature explicitly references an identifier attribute in the element | ||
| being signed, in this case the document element. | ||
| --> | ||
| <xsl:variable name="normalisedNow" select="mdxDates:dateAdd($now, 0)"/> | ||
| <xsl:variable name="documentID" | ||
| select="concat('uk', translate($normalisedNow, ':-', ''))"/> | ||
|
|
||
| <!-- | ||
| Document root. | ||
| --> | ||
| <xsl:template match="/"> | ||
| <xsl:call-template name="document.comment"/> | ||
| <xsl:apply-templates/> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Document element. | ||
| --> | ||
| <xsl:template match="/md:EntitiesDescriptor"> | ||
| <EntitiesDescriptor> | ||
| <xsl:attribute name="validUntil"> | ||
| <xsl:value-of select="$validUntil"/> | ||
| </xsl:attribute> | ||
| <xsl:attribute name="ID"> | ||
| <xsl:value-of select="$documentID"/> | ||
| </xsl:attribute> | ||
| <xsl:apply-templates select="@*"/> | ||
| <xsl:call-template name="document.comment"/> | ||
| <xsl:apply-templates select="node()"/> | ||
| </EntitiesDescriptor> | ||
| </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> 	U K 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:if test="$extraText"> | ||
| <xsl:text>	*** </xsl:text> | ||
| <xsl:value-of select="$extraText"/> | ||
| <xsl:text> *** </xsl:text> | ||
| <xsl:text> </xsl:text> | ||
| </xsl:if> | ||
| <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> | ||
|
|
||
| <!--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> |
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,67 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| fixups.xsl | ||
| XSL stylesheet to perform any fixups required to an EntityDescriptor prior to | ||
| publication to the UK federation membership. | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label" | ||
|
|
||
| xmlns="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| exclude-result-prefixes="xsi xsl"> | ||
|
|
||
| <!--Force UTF-8 encoding for the output.--> | ||
| <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/> | ||
|
|
||
|
|
||
| <!-- | ||
| Patch any @use-less KeyName descriptors in IdP roles | ||
| for the benefit of Shib SPs pre-1.3.1. | ||
| --> | ||
| <xsl:template match="md:IDPSSODescriptor/md:KeyDescriptor[not(@use)] | | ||
| md:AttributeAuthorityDescriptor/md:KeyDescriptor[not(@use)]"> | ||
| <xsl:copy> | ||
| <xsl:attribute name="use">signing</xsl:attribute> | ||
| <xsl:apply-templates/> | ||
| </xsl:copy> | ||
| </xsl:template> | ||
|
|
||
|
|
||
| <!-- | ||
| Remove any EncryptionMethod elements within KeyDescriptor elements | ||
| to avoid triggering a problem in OpenSAML-C 2.0. | ||
| See https://wiki.shibboleth.net/confluence/display/SHIB2/MetadataCorrectness#MetadataCorrectness-Version2.0 | ||
| --> | ||
| <xsl:template match="md:KeyDescriptor/md:EncryptionMethod"/> | ||
|
|
||
|
|
||
| <!-- | ||
| ********************************************* | ||
| *** *** | ||
| *** D E F A U L T T E M P L A T E S *** | ||
| *** *** | ||
| ********************************************* | ||
| --> | ||
|
|
||
|
|
||
| <!--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> |
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
Oops, something went wrong.