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! Go to Solution.
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