<?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:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:html="http://www.w3.org/1999/xhtml"
           xmlns="http://docs.openrepose.org/repose/rackspace-auth-user/v1.0"
           targetNamespace="http://docs.openrepose.org/repose/rackspace-auth-user/v1.0"
           elementFormDefault="qualified">

    <!-- Auth 2.0 message body content Identity Configuration -->
    <xs:element name="rackspace-auth-user" type="RackspaceAuthUserConfig"/>

    <xs:complexType name="RackspaceAuthUserConfig">
        <xs:annotation>
            <xs:documentation>
                <html:p>Configure optionally an extraction for auth 1.1 or auth 2.0</html:p>
            </xs:documentation>
        </xs:annotation>

        <xs:all>
            <xs:element name="v1_1" type="IdentityV1.1" minOccurs="0" maxOccurs="1"/>
            <xs:element name="v2_0" type="IdentityV2" minOccurs="0" maxOccurs="1"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="IdentityGroupConfig">
        <xs:annotation>
            <xs:documentation>
                <html:p>If this element is specified, the filter will attempt to parse out a payload for the identity
                    v2.0 contract (either json or xml) and extract the username. Group will be as configured, or the
                    default of PreAuth. The default quality applied to the header will be 0.6

                    If you want to have different groups for 1.1 and for 2.0 you need to specify them, else they will
                    use the same default.
                </html:p>
            </xs:documentation>
        </xs:annotation>

        <xs:all>
            <xs:element name="group" type="xs:string" minOccurs="0" maxOccurs="1" default="Pre_Auth"/>
            <xs:element name="quality" type="xs:string" minOccurs="0" maxOccurs="1" default="0.6"/>
        </xs:all>

        <xs:attribute name="content-body-read-limit" type="xs:positiveInteger" use="optional" default="4096">
            <xs:annotation>
                <xs:documentation>
                    <html:p></html:p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>

    </xs:complexType>

    <xs:complexType name="IdentityV2">
        <xs:complexContent>
            <xs:extension base="IdentityGroupConfig">

            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="IdentityV1.1">
        <xs:complexContent>
            <xs:extension base="IdentityGroupConfig">

            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>