-
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.
Initial check-in of 1.3 -> 1.2 (Trust) metadata conversion.
- Loading branch information
Showing
1 changed file
with
80 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 |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| v13_to_v12_trust.xsl | ||
| XSL stylesheet converting a SAML 2 metadata file describing a Shibboleth | ||
| 1.3 federation into the equivalent Shibboleth 1.2 trust file. | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| $Id: v13_to_v12_trust.xsl,v 1.1 2005/04/05 12:44:52 iay Exp $ | ||
| --> | ||
| <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="urn:mace:shibboleth:trust:1.0" | ||
| exclude-result-prefixes="shibmeta md"> | ||
|
|
||
| <!-- | ||
| Version information for this file. Remember to peel off the dollar signs | ||
| before dropping the text into another versioned file. | ||
| --> | ||
| <xsl:param name="cvsId">$Id: v13_to_v12_trust.xsl,v 1.1 2005/04/05 12:44:52 iay Exp $</xsl:param> | ||
|
|
||
| <!-- | ||
| Add a comment to the start of the output file. | ||
| --> | ||
| <xsl:template match="/"> | ||
| <xsl:comment> | ||
| <xsl:text> 	***DO NOT EDIT THIS FILE*** </xsl:text> | ||
| <xsl:text>	Converted by: 	</xsl:text> | ||
| <xsl:value-of select="substring-before(substring-after($cvsId, ': '), '$')"/> | ||
| <xsl:text> </xsl:text> | ||
| </xsl:comment> | ||
| <Trust> | ||
| <xsl:attribute name="xsi:schemaLocation"> | ||
| <xsl:text>urn:mace:shibboleth:trust:1.0 shibboleth-trust-1.0.xsd </xsl:text> | ||
| <xsl:text>http://www.w3.org/2000/09/xmldsig# xmldsig-core-schema.xsd</xsl:text> | ||
| </xsl:attribute> | ||
| <xsl:apply-templates/> | ||
| </Trust> | ||
| </xsl:template> | ||
|
|
||
| <!--Force UTF-8 encoding for the output.--> | ||
| <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/> | ||
|
|
||
| <!-- | ||
| Extract a KeyAuthority extension from an EntitiesDescriptor or EntityDescriptor. | ||
| --> | ||
| <xsl:template match="md:EntitiesDescriptor | md:EntityDescriptor"> | ||
| <xsl:if test="md:Extensions/shibmeta:KeyAuthority/ds:KeyInfo"> | ||
| <KeyAuthority> | ||
| <!-- copy across VerifyDepth attribute if present --> | ||
| <xsl:apply-templates select="md:Extensions/shibmeta:KeyAuthority/@VerifyDepth"/> | ||
|
|
||
| <!-- generate KeyName --> | ||
| <ds:KeyName> | ||
| <xsl:value-of select="@Name"/> | ||
| </ds:KeyName> | ||
|
|
||
| <!-- copy across KeyInfo elements --> | ||
| <xsl:copy-of select="md:Extensions/shibmeta:KeyAuthority/ds:KeyInfo"/> | ||
| </KeyAuthority> | ||
| </xsl:if> | ||
|
|
||
| <!-- proceed to nested EntitiesDescriptor and EntityDescriptor elements --> | ||
| <xsl:apply-templates select="md:EntitiesDescriptor | md:EntityDescriptor"/> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| By default, copy referenced attributes through unchanged. | ||
| --> | ||
| <xsl:template match="@*"> | ||
| <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute> | ||
| </xsl:template> | ||
|
|
||
| </xsl:stylesheet> |