<?xml version="1.0" encoding="UTF-8"?>
<exp:Export Version="3.0"
    xmlns:L7p="http://www.layer7tech.com/ws/policy"
    xmlns:exp="http://www.layer7tech.com/ws/policy/export" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
    <exp:References/>
    <wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
        <wsp:All wsp:Usage="Required">
            <L7p:CustomizeErrorResponse>
                <L7p:Content stringValueReference="inline"><![CDATA[{
"error":"Could not load configuration"
}]]></L7p:Content>
                <L7p:ContentType stringValue="application/json; charset=UTF-8"/>
                <L7p:ExtraHeaders nameValuePairArray="included"/>
            </L7p:CustomizeErrorResponse>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="JHtnYXRld2F5LmRlbW9jb25maWd9"/>
                <L7p:ContentType stringValue="application/json; charset=utf-8"/>
                <L7p:DataType variableDataType="message"/>
                <L7p:VariableToSet stringValue="config"/>
            </L7p:SetVariable>
            <wsp:All wsp:Usage="Required">
                <L7p:EvaluateJsonPathExpressionV2>
                    <L7p:Expression stringValue="$.environment"/>
                    <L7p:OtherTargetMessageVariable stringValue="config"/>
                    <L7p:Target target="OTHER"/>
                    <L7p:VariablePrefix stringValue="env"/>
                </L7p:EvaluateJsonPathExpressionV2>
                <L7p:EvaluateJsonPathExpressionV2>
                    <L7p:Expression stringValue="$.debug"/>
                    <L7p:OtherTargetMessageVariable stringValue="config"/>
                    <L7p:Target target="OTHER"/>
                    <L7p:VariablePrefix stringValue="debug"/>
                </L7p:EvaluateJsonPathExpressionV2>
                <L7p:EvaluateJsonPathExpressionV2>
                    <L7p:Expression stringValue="$.audits"/>
                    <L7p:OtherTargetMessageVariable stringValue="config"/>
                    <L7p:Target target="OTHER"/>
                    <L7p:VariablePrefix stringValue="audits"/>
                </L7p:EvaluateJsonPathExpressionV2>
                <L7p:EvaluateJsonPathExpressionV2>
                    <L7p:Expression stringValue="$.host"/>
                    <L7p:OtherTargetMessageVariable stringValue="config"/>
                    <L7p:Target target="OTHER"/>
                    <L7p:VariablePrefix stringValue="host"/>
                </L7p:EvaluateJsonPathExpressionV2>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="Extract config details"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:All>
            <wsp:OneOrMore wsp:Usage="Required">
                <L7p:ComparisonAssertion>
                    <L7p:CaseSensitive booleanValue="false"/>
                    <L7p:Expression1 stringValue="${audits.result}"/>
                    <L7p:Operator operatorNull="null"/>
                    <L7p:Predicates predicates="included">
                        <L7p:item dataType="included">
                            <L7p:Type variableDataType="boolean"/>
                        </L7p:item>
                        <L7p:item binary="included">
                            <L7p:CaseSensitive booleanValue="false"/>
                            <L7p:RightValue stringValue="false"/>
                        </L7p:item>
                    </L7p:Predicates>
                </L7p:ComparisonAssertion>
                <L7p:AuditAssertion>
                    <L7p:SaveRequest booleanValue="true"/>
                    <L7p:SaveResponse booleanValue="true"/>
                </L7p:AuditAssertion>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="Set the audit object to Warning and records request and response"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:OneOrMore>
            <L7p:AuditDetailAssertion>
                <L7p:Detail stringValue="DemoVarsService has been called."/>
            </L7p:AuditDetailAssertion>
            <wsp:OneOrMore wsp:Usage="Required">
                <L7p:HttpRoutingAssertion>
                    <L7p:ProtectedServiceUrl stringValue="https://${host.result}/sample/service"/>
                    <L7p:RequestHeaderRules httpPassthroughRuleSet="included">
                        <L7p:ForwardAll booleanValue="true"/>
                        <L7p:Rules httpPassthroughRules="included">
                            <L7p:item httpPassthroughRule="included">
                                <L7p:Name stringValue="Cookie"/>
                            </L7p:item>
                            <L7p:item httpPassthroughRule="included">
                                <L7p:Name stringValue="SOAPAction"/>
                            </L7p:item>
                        </L7p:Rules>
                    </L7p:RequestHeaderRules>
                    <L7p:RequestParamRules httpPassthroughRuleSet="included">
                        <L7p:ForwardAll booleanValue="true"/>
                        <L7p:Rules httpPassthroughRules="included"/>
                    </L7p:RequestParamRules>
                    <L7p:ResponseHeaderRules httpPassthroughRuleSet="included">
                        <L7p:ForwardAll booleanValue="true"/>
                        <L7p:Rules httpPassthroughRules="included">
                            <L7p:item httpPassthroughRule="included">
                                <L7p:Name stringValue="Set-Cookie"/>
                            </L7p:item>
                        </L7p:Rules>
                    </L7p:ResponseHeaderRules>
                    <L7p:SamlAssertionVersion intValue="2"/>
                </L7p:HttpRoutingAssertion>
                <wsp:All wsp:Usage="Required">
                    <wsp:OneOrMore wsp:Usage="Required">
                        <L7p:ComparisonAssertion>
                            <L7p:CaseSensitive booleanValue="false"/>
                            <L7p:Expression1 stringValue="${debug.result}"/>
                            <L7p:Operator operatorNull="null"/>
                            <L7p:Predicates predicates="included">
                                <L7p:item dataType="included">
                                    <L7p:Type variableDataType="boolean"/>
                                </L7p:item>
                                <L7p:item binary="included">
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:RightValue stringValue="false"/>
                                </L7p:item>
                            </L7p:Predicates>
                        </L7p:ComparisonAssertion>
                        <wsp:All wsp:Usage="Required">
                            <L7p:SetVariable>
                                <L7p:Base64Expression stringValue="JHtodHRwUm91dGluZy5yZWFzb25Db2RlfQ=="/>
                                <L7p:ContentType stringValue="application/json; charset=utf-8"/>
                                <L7p:DataType variableDataType="message"/>
                                <L7p:VariableToSet stringValue="debug.details"/>
                            </L7p:SetVariable>
                            <L7p:CustomizeErrorResponse>
                                <L7p:Content stringValueReference="inline"><![CDATA[{
      "error":"Could not load configuration"
      "debug":"${debug.details}"
}]]></L7p:Content>
                                <L7p:ContentType stringValue="application/json; charset=UTF-8"/>
                                <L7p:ExtraHeaders nameValuePairArray="included"/>
                            </L7p:CustomizeErrorResponse>
                            <L7p:assertionComment>
                                <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="Adds the reason code to the error message"/>
                                    </L7p:entry>
                                </L7p:Properties>
                            </L7p:assertionComment>
                        </wsp:All>
                    </wsp:OneOrMore>
                    <L7p:FalseAssertion/>
                </wsp:All>
            </wsp:OneOrMore>
            <L7p:AuditDetailAssertion>
                <L7p:Detail stringValue="!Warning! DemoVarsService has been successfully executed."/>
                <L7p:Level stringValue="WARNING"/>
            </L7p:AuditDetailAssertion>
        </wsp:All>
    </wsp:Policy>
</exp:Export>
