<?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>
        <IDProviderReference RefType="com.l7tech.console.policy.exporter.IdProviderReference">
            <GOID>0000000000000000fffffffffffffffe</GOID>
            <Name>Internal Identity Provider</Name>
            <Props>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGphdmEgdmVyc2lvbj0iMS44&#xd;
LjBfMjQyIiBjbGFzcz0iamF2YS5iZWFucy5YTUxEZWNvZGVyIj4KIDxvYmplY3QgY2xhc3M9Imph&#xd;
dmEudXRpbC5IYXNoTWFwIj4KICA8dm9pZCBtZXRob2Q9InB1dCI+CiAgIDxzdHJpbmc+YWRtaW5F&#xd;
bmFibGVkPC9zdHJpbmc+CiAgIDxib29sZWFuPnRydWU8L2Jvb2xlYW4+CiAgPC92b2lkPgogPC9v&#xd;
YmplY3Q+CjwvamF2YT4K</Props>
            <TypeVal>1</TypeVal>
        </IDProviderReference>
    </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:CommentAssertion>
                <L7p:Comment stringValue="***************************************************************************************************"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Gateway REST Management Service"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* "/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Policy to manage access to the REST Manage Gateway assertion at /restman/*"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* "/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Note: To authenticate against other identity providers, add additional authentication assertions in the"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="*          AUTHENTICATION block and ensure users are added to the proper roles"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* "/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Note: Accepts SSL client certificate or Basic Auth over SSL. To use other credential sources modify"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="*         the CREDENTIALS block"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* "/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Note: If the maximum message size needs to be increased change the"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="*         'restman.request.message.maxSize' cluster property"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* "/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="* Revision date: 2022-01-11"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="***************************************************************************************************"/>
            </L7p:CommentAssertion>
            <wsp:All wsp:Usage="Required">
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="NTAw"/>
                    <L7p:VariableToSet stringValue="error.status"/>
                </L7p:SetVariable>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="VW5rbm93bkVycm9y"/>
                    <L7p:VariableToSet stringValue="error.type"/>
                </L7p:SetVariable>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="QW4gdW5rbm93biBlcnJvciBoYXMgb2NjdXJyZWQ="/>
                    <L7p:VariableToSet stringValue="error.detail"/>
                </L7p:SetVariable>
                <L7p:CustomizeErrorResponse>
                    <L7p:Content stringValueReference="inline"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Error xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Type>${error.type}</l7:Type>
    <l7:Detail>${error.detail}</l7:Detail>
</l7:Error>]]></L7p:Content>
                    <L7p:ContentType stringValue="application/xml; charset=UTF-8"/>
                    <L7p:ExtraHeaders nameValuePairArray="included"/>
                    <L7p:HttpStatus stringValue="${error.status}"/>
                </L7p:CustomizeErrorResponse>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// Configure error response"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:All>
            <wsp:OneOrMore wsp:Usage="Required">
                <L7p:SslAssertion>
                    <L7p:RequireClientAuthentication booleanValue="true"/>
                </L7p:SslAssertion>
                <wsp:All wsp:Usage="Required">
                    <L7p:SslAssertion/>
                    <L7p:HttpBasic/>
                    <L7p:assertionComment>
                        <L7p:Properties mapValue="included">
                            <L7p:entry>
                                <L7p:key stringValue="RIGHT.COMMENT"/>
                                <L7p:value stringValue="// Basic Auth over SSL"/>
                            </L7p:entry>
                        </L7p:Properties>
                    </L7p:assertionComment>
                </wsp:All>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="LEFT.COMMENT"/>
                            <L7p:value stringValue="CREDENTIALS"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// Gather credentials, either SSL Client Cert or Basic Auth"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:OneOrMore>
            <wsp:OneOrMore wsp:Usage="Required">
                <L7p:Authentication>
                    <L7p:IdentityProviderOid goidValue="0000000000000000fffffffffffffffe"/>
                </L7p:Authentication>
                <wsp:All wsp:Usage="Required">
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="NDAx"/>
                        <L7p:VariableToSet stringValue="error.status"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="VW5hdXRob3JpemVk"/>
                        <L7p:VariableToSet stringValue="error.type"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="VXNlciBub3QgYXV0aG9yaXplZA=="/>
                        <L7p:VariableToSet stringValue="error.detail"/>
                    </L7p:SetVariable>
                    <L7p:FalseAssertion/>
                    <L7p:assertionComment>
                        <L7p:Properties mapValue="included">
                            <L7p:entry>
                                <L7p:key stringValue="RIGHT.COMMENT"/>
                                <L7p:value stringValue="// Fail 401"/>
                            </L7p:entry>
                        </L7p:Properties>
                    </L7p:assertionComment>
                </wsp:All>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="LEFT.COMMENT"/>
                            <L7p:value stringValue="AUTHENTICATION"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// Authenticate credentials against IIP else fail 401"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:OneOrMore>
            <wsp:OneOrMore wsp:Usage="Required">
                <L7p:RequestSizeLimit>
                    <L7p:AssertionComment assertionComment="included">
                        <L7p:Properties mapValue="included">
                            <L7p:entry>
                                <L7p:key stringValue="RIGHT.COMMENT"/>
                                <L7p:value stringValue="// Compare against ${gateway.restman.request.message.maxSize}"/>
                            </L7p:entry>
                        </L7p:Properties>
                    </L7p:AssertionComment>
                    <L7p:Limit stringValue="${gateway.restman.request.message.maxSize}"/>
                </L7p:RequestSizeLimit>
                <wsp:All wsp:Usage="Required">
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="NDAw"/>
                        <L7p:VariableToSet stringValue="error.status"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="SW52YWxpZFJlcXVlc3Q="/>
                        <L7p:VariableToSet stringValue="error.type"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="RXhjZWVkZWQgdGhlIG1heGltdW0gZGF0YSBzaXplIGxpbWl0"/>
                        <L7p:VariableToSet stringValue="error.detail"/>
                    </L7p:SetVariable>
                    <L7p:FalseAssertion/>
                    <L7p:assertionComment>
                        <L7p:Properties mapValue="included">
                            <L7p:entry>
                                <L7p:key stringValue="RIGHT.COMMENT"/>
                                <L7p:value stringValue="// Fail 400"/>
                            </L7p:entry>
                        </L7p:Properties>
                    </L7p:assertionComment>
                </wsp:All>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// Check the request message size else fail 400"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:OneOrMore>
            <L7p:RESTGatewayManagement>
                <L7p:AssertionComment assertionComment="included">
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// Call the RESTMan assertion"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:AssertionComment>
            </L7p:RESTGatewayManagement>
        </wsp:All>
    </wsp:Policy>
</exp:Export>
