Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to apply Api key in a flow?

Not applicable

Hi I've created a simple Verify Api Key policy, and when I apply to a Pre-flow it works fine. But I would like to apply for a Flow. How can I do it?

<PreFlow name="PreFlow">
        <Request>
            <Step>
                <Name>Verify-Api-Key</Name>
            </Step>
        </Request>
        <Response>
        </Response>
    </PreFlow>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VerifyAPIKey async="false" continueOnError="false" enabled="true" name="Verify-Api-Key">
    <DisplayName>Verify-Api-Key</DisplayName>
    <Properties/>
    <APIKey ref="request.header.x-api-key"/>
</VerifyAPIKey>

I'd like to apply here:

<Flow name="put /v1/myresource/{Id}">
            <Description>get resource by id</Description>
            <Request>
                <Step>
                    <Name>Verify-Api-Key</Name>
                </Step>
            </Request>
            <Response/>
<Condition>(proxy.pathsuffix MatchesPath "/v1/myresource/*") and (request.verb = "PUT")</Condition>
</Flow>

Thanks for your help

Solved Solved
0 5 419
1 ACCEPTED SOLUTION

@Lucio Moraes

Please refer the documentation , this has detailed explanation of using resource path.

This might help you in setting the proper condition for the flow to be started. W.r.t adding verify API key step you have coded absolutely correct.

Thanks

View solution in original post

5 REPLIES 5