Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Migrate schemas to validate against into the classpath.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed May 30, 2014
1 parent 9709c3e commit 50514ac
Show file tree
Hide file tree
Showing 26 changed files with 4,382 additions and 49 deletions.
96 changes: 48 additions & 48 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,104 +785,104 @@
so that the parser is not required to explicitly resolve any imports.
-->
<util:list id="schemaResources">
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/incommon-metadata.xsd"/>
<constructor-arg value="schema/incommon-metadata.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/xml.xsd"/>
<constructor-arg value="schema/xml.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/xmldsig-core-schema.xsd"/>
<constructor-arg value="schema/xmldsig-core-schema.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/xenc-schema.xsd"/>
<constructor-arg value="schema/xenc-schema.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd, xenc-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/saml-schema-assertion-2.0.xsd"/>
<constructor-arg value="schema/saml-schema-assertion-2.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd, xenc-schema.xsd, saml-schema-assertion-2.0.xsd, xml.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/saml-schema-metadata-2.0.xsd"/>
<constructor-arg value="schema/saml-schema-metadata-2.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/ws-addr.xsd"/>
<constructor-arg value="schema/ws-addr.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports ws-addr.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/ws-securitypolicy-1.2.xsd"/>
<constructor-arg value="schema/ws-securitypolicy-1.2.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/MetadataExchange.xsd"/>
<constructor-arg value="schema/MetadataExchange.xsd"/>
</bean>
<bean parent="FileSystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/xml/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
<bean parent="ClassPathResource">
<constructor-arg value="schema/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports oasis-200401-wss-wssecurity-utility-1.0.xsd, xml.xsd, xmldsig-core-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
<constructor-arg value="schema/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports saml-schema-metadata-2.0.xsd, xml.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/saml-metadata-rpi-v1.0.xsd"/>
<constructor-arg value="schema/saml-metadata-rpi-v1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/shibboleth-metadata-1.0.xsd"/>
<constructor-arg value="schema/shibboleth-metadata-1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports saml-schema-assertion-2.0.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-metadata-attr.xsd"/>
<constructor-arg value="schema/sstc-metadata-attr.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports saml-schema-metadata-2.0.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-request-initiation.xsd"/>
<constructor-arg value="schema/sstc-request-initiation.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-saml-holder-of-key-browser-sso.xsd"/>
<constructor-arg value="schema/sstc-saml-holder-of-key-browser-sso.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports saml-schema-metadata-2.0.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-saml-idp-discovery.xsd"/>
<constructor-arg value="schema/sstc-saml-idp-discovery.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-saml-metadata-algsupport-v1.0.xsd"/>
<constructor-arg value="schema/sstc-saml-metadata-algsupport-v1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports saml-schema-metadata-2.0.xsd, xml.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/sstc-saml-metadata-ui-v1.0.xsd"/>
<constructor-arg value="schema/sstc-saml-metadata-ui-v1.0.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- no imports -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/uk-fed-label.xsd"/>
<constructor-arg value="schema/uk-fed-label.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xenc-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/ws-authorization.xsd"/>
<constructor-arg value="schema/ws-authorization.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!--
Imports oasis-200401-wss-wssecurity-secext-1.0.xsd, oasis-200401-wss-wssecurity-utility-1.0.xsd,
ws-addr.xsd, MetadataExchange.xsd, saml-schema-metadata-2.0.xsd, ws-securitypolicy-1.2.xsd,
ws-authorization.xsd.
-->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/ws-federation.xsd"/>
<constructor-arg value="schema/ws-federation.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd, xenc-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/xenc-schema-11.xsd"/>
<constructor-arg value="schema/xenc-schema-11.xsd"/>
</bean>
<bean parent="FileSystemResource">
<bean parent="ClassPathResource">
<!-- imports xmldsig-core-schema.xsd -->
<constructor-arg value="#{ systemProperties['basedir'] }/xml/xmldsig11-schema.xsd"/>
<constructor-arg value="schema/xmldsig11-schema.xsd"/>
</bean>
</util:list>

Expand Down
8 changes: 7 additions & 1 deletion mdx/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Because these conventions have been developed over time, and are still being dev

An underscore ('`_`') at the start of a directory name indicates that the directory is functional rather than containing a channel.

Note that the `schema` directory is functional but does not follow this convention, instead following the convention established for classpath schema resources used by the Shibboleth project.

### OpenSSL Blacklists Directory

The `_openssl_blacklists` directory holds a copy of the Debian weak key blacklists, extracted from Debian 7.2 "Wheezy". These blacklists are in OpenSSL format.
Expand All @@ -16,10 +18,14 @@ The `_openssl_blacklists` directory holds a copy of the Debian weak key blacklis

The `_rules` subdirectory of `/mdx/` holds checking rulesets.

### Schema Directory

The `schema` subdirectory of `/mdx/` contains the XML schema files used to validate metadata. This directory name does not use the `'_'` convention but instead matches up with the conventional location for schemas used by the Shibboleth project.

## Channels

Each directory under `/mdx/` whose name does not start with an underscore
represents a source of metadata, referred to as a
(and is not `schema`) represents a source of metadata, referred to as a
channel. In most cases, a channel corresponds to a access management federation.

Most channels are named in the form "*country*`_`*source*". For example,
Expand Down
112 changes: 112 additions & 0 deletions mdx/schema/MetadataExchange.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!--
(c) 2004-2006 BEA Systems Inc., Computer Associates International, Inc.,
International Business Machines Corporation, Microsoft Corporation,
Inc., SAP AG, Sun Microsystems, and webMethods. All rights reserved.
Permission to copy and display the WS-MetadataExchange Specification
(the "Specification"), in any medium without fee or royalty is hereby
granted, provided that you include the following on ALL copies of the
Specification that you make:
1. A link or URL to the Specification at this location.
2. The copyright notice as shown in the Specification.
BEA Systems, Computer Associates, IBM, Microsoft, SAP, Sun, and
webMethods (collectively, the "Authors") each agree to grant you a
license, under royalty-free and otherwise reasonable,
non-discriminatory terms and conditions, to their respective essential
patent claims that they deem necessary to implement the
WS-MetadataExchange Specification.
THE SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE
SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
USE OR DISTRIBUTION OF THE SPECIFICATIONS.
The name and trademarks of the Authors may NOT be used in any manner,
including advertising or publicity pertaining to the Specifications or
their contents without specific, written prior permission. Title to
copyright in the Specifications will at all times remain with the
Authors.
No other rights are granted by implication, estoppel or otherwise.
-->

<xs:schema
targetNamespace='http://schemas.xmlsoap.org/ws/2004/09/mex'
xmlns:tns='http://schemas.xmlsoap.org/ws/2004/09/mex'
xmlns:wsa10='http://www.w3.org/2005/08/addressing'
xmlns:wsa04='http://schemas.xmlsoap.org/ws/2004/08/addressing'
xmlns:xs='http://www.w3.org/2001/XMLSchema'
elementFormDefault='qualified'
blockDefault='#all' >

<!-- Get Metadata request -->
<xs:element name='GetMetadata' >
<xs:complexType>
<xs:sequence>
<xs:element ref='tns:Dialect' minOccurs='0' />
<xs:element ref='tns:Identifier' minOccurs='0' />
</xs:sequence>
<xs:anyAttribute namespace='##other' processContents='lax' />
</xs:complexType>
</xs:element>

<xs:element name='Dialect' type='xs:anyURI' />
<xs:element name='Identifier' type='xs:anyURI' />

<!-- Get Metadata response -->
<xs:element name='Metadata' >
<xs:complexType>
<xs:sequence>
<xs:element ref='tns:MetadataSection'
minOccurs='0'
maxOccurs='unbounded' />
<xs:any namespace='##other' processContents='lax'
minOccurs='0'
maxOccurs='unbounded' />
</xs:sequence>
<xs:anyAttribute namespace='##other' processContents='lax' />
</xs:complexType>
</xs:element>

<xs:element name='MetadataSection' >
<xs:complexType>
<xs:choice>
<xs:any namespace='##other' processContents='lax' />
<xs:element ref='tns:MetadataReference' />
<xs:element ref='tns:Location' />
</xs:choice>
<xs:attribute name='Dialect' type='xs:anyURI' use='required' />
<xs:attribute name='Identifier' type='xs:anyURI' />
<xs:anyAttribute namespace='##other' processContents='lax' />
</xs:complexType>
</xs:element>

<!--
Ideally, the type of the MetadataReference would have been
the union of wsa04:EndpointReferenceType and
wsa10:EndpointReferenceType but unfortunately xs:union only
works for simple types. As a result, we have to define
the mex:MetadataReference using xs:any.
-->

<xs:element name='MetadataReference'>
<xs:complexType>
<xs:sequence>
<xs:any minOccurs='1' maxOccurs='unbounded'
processContents='lax' namespace='##other' />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='Location'
type='xs:anyURI' />
</xs:schema>
28 changes: 28 additions & 0 deletions mdx/schema/incommon-metadata.xsd
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>
Loading

0 comments on commit 50514ac

Please sign in to comment.