<?xml version="1.0" encoding="UTF-8"?>
<!--
  _=_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_=
  Repose
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  Copyright (C) 2010 - 2015 Rackspace US, Inc.
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  =_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_=_
  -->


<xs:schema xmlns:html="http://www.w3.org/1999/xhtml"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           xmlns:xerces="http://xerces.apache.org"
           xmlns:saxon="http://saxon.sf.net/"
           xmlns="http://docs.openrepose.org/repose/uri-redaction-service/v1.0"
           elementFormDefault="qualified"
           targetNamespace="http://docs.openrepose.org/repose/uri-redaction-service/v1.0">

    <xs:element name="uri-redaction" type="UriRedactionConfig"/>

    <xs:complexType name="UriRedactionConfig">
        <xs:annotation>
            <xs:documentation>
                <html:p>
                    Defines a list of regular expressions (RegEx's) that will be used to match against the provided URI.
                    Each of the RegEx's will be processed in order with each being passed the result from the previous.
                    All capture groups in each matching RegEx will be replaced with <html:code>XXXXX</html:code>.
                    Please refer to the
                    <html:a href="http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java
                        Regular Expression Api
                    </html:a>
                    for more information on regular expression syntax.
                </html:p>
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="redact" type="xs:string" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>
