This repository has been archived by the owner. It is now read-only.
forked from InCommon/inc-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support incmd (InCommon Federation metadata) extensions.
- Loading branch information
Showing
4 changed files
with
147 additions
and
2 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,97 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| check_incmd.xsl | ||
| Checking ruleset for the InCommon Federation metadata extensions, | ||
| the schema for which can be found here: | ||
| https://spaces.internet2.edu/x/iIuVAQ | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:incmd="http://id.incommon.org/metadata" | ||
| xmlns:md="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" | ||
|
|
||
| xmlns="urn:oasis:names:tc:SAML:2.0:metadata"> | ||
|
|
||
| <!-- | ||
| Common support functions. | ||
| --> | ||
| <xsl:import href="check_framework.xsl"/> | ||
|
|
||
| <!-- | ||
| Checks for the contactType attribute. | ||
| --> | ||
|
|
||
| <xsl:template match="@incmd:contactType[not(parent::md:ContactPerson)]"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m">incmd:contactType should only appear on md:ContactPerson</xsl:with-param> | ||
| </xsl:call-template> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="md:ContactPerson[@incmd:contactType][@contactType != 'other']"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m"> | ||
| <xsl:text>incmd:contactType requires contactType='other', found '</xsl:text> | ||
| <xsl:value-of select="@contactType"/> | ||
| <xsl:text>'</xsl:text> | ||
| </xsl:with-param> | ||
| </xsl:call-template> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="@incmd:contactType[not(starts-with(.,'http://'))][not(starts-with(.,'https://'))]"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m">incmd:contactType must be an absolute URI</xsl:with-param> | ||
| </xsl:call-template> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Check for specific values. This test is probably over-specific in the long term. | ||
| --> | ||
| <xsl:template match="@incmd:contactType | ||
| [not(. = 'http://id.incommon.org/metadata/contactType/security')]"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m"> | ||
| <xsl:text>unknown value '</xsl:text> | ||
| <xsl:value-of select="."/> | ||
| <xsl:text>' for incmd:contactType</xsl:text> | ||
| </xsl:with-param> | ||
| </xsl:call-template> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="@incmd:contactType"> | ||
| <!-- otherwise, fine --> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Additional schema checks. | ||
| The schema itself doesn't help very much as most contexts in which the incmd | ||
| namespace is used are subject to "lax" checking. These checks duplicate some | ||
| aspects of XML Schema checking as we'd like it to behave. | ||
| --> | ||
|
|
||
| <xsl:template match="incmd:*"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m"> | ||
| <xsl:text>unknown element incmd:</xsl:text> | ||
| <xsl:value-of select="local-name()"/> | ||
| </xsl:with-param> | ||
| </xsl:call-template> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="@incmd:*"> | ||
| <xsl:call-template name="error"> | ||
| <xsl:with-param name="m"> | ||
| <xsl:text>unknown attribute incmd:</xsl:text> | ||
| <xsl:value-of select="local-name()"/> | ||
| </xsl:with-param> | ||
| </xsl:call-template> | ||
| </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
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,28 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <xs:schema | ||
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
| targetNamespace="http://id.incommon.org/metadata" | ||
| elementFormDefault="qualified" | ||
| attributeFormDefault="unqualified" | ||
| blockDefault="substitution" | ||
| version="2.0"> | ||
|
|
||
| <xs:annotation> | ||
| <xs:documentation> | ||
| Document title: Schema for InCommon Federation metadata extensions | ||
| Document identifier: Metadata Extension Schema | ||
| Location: https://spaces.internet2.edu/x/iIuVAQ | ||
| Revision history: | ||
| V1.2 (3 May 2013): | ||
| Make schema itself schema-valid. | ||
| V1.1 (2 May 2013): | ||
| Initial version. Added documentation. | ||
| V1.0 (2 December 2011): | ||
| Initial version. Added contactType attribute. | ||
| </xs:documentation> | ||
| </xs:annotation> | ||
|
|
||
| <xs:attribute name="contactType" type="xs:anyURI"/> | ||
|
|
||
| </xs:schema> |