I am trying to only apply a set of rules in a preflow rule conditionally. Basically i only want these steps to be taken if the request.header.authorization is set to a Bearer variety. We have several different authotization contexts for historical reasons and want to handle Basic auth differently than Bearer auth. What is the most effective way of handling this?
<Request>
<Condition>request.header.authorization Matches "Bearer*" </Condition>
<Step>
<Name>Auth-Proxy</Name>
</Step>
<Step>
<Name>Auth-Target</Name>
</Step>
</Request>
There is no direct way to apply a condition to a set of steps. You have a couple options.
-
repeat the condition in each of several distinct steps
<Request>
<Step>
<Condition>request.header.authorization Matches "Bearer*" </Condition>
<Name>Auth-Proxy</Name>
</Step>
<Step>
<Condition>request.header.authorization Matches "Bearer*" </Condition>
<Name>Auth-Target</Name>
</Step>
</Request>
-
extract the series of steps into a flowcallout and wrap the condition around THAT single step
<Request>
<Step>
<Condition>request.header.authorization Matches "Bearer*" </Condition>
<Name>FC-Auth</Name>
</Step>
</Request>
Not what i was hoping, but it works as expected. Thank you!