config.json for flow condition

Is there a way I can provide value for the flow condition in config.json? In the below XML, condition "client.cn != "xyz.abc.com")" string will change per environment. I am looking for a way to specify the same in config.json


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ProxyEndpoint name="default">

<Description/>

<FaultRules/>

<PreFlow name="PreFlow">

<Request>

<Step>

<Name>RF_Cert_CN_Match</Name>

<Condition>(client.cn != null) and (client.cn != "xyz.abc.com")</Condition>

</Step>

<Step>

<Name>VerifyAPIKey_QueryParam</Name>

</Step>

<Step>

<Name>AM_RemoveAPIKey_QueryParam</Name>

</Step>

</Request>

<Response/>

</PreFlow>

Solved Solved
0 3 654
1 ACCEPTED SOLUTION

HI @MNarayan

I will need to check if there is a way to do that.

But instead of having the actual value in the proxy condition, why not have them in KVM ? Tomorrow, if you want to change the value for a given environment, you don't have to change the proxy code and re-deploy. By just changing the value in the KVM, it automatically starts working without deployment

Also with this you can have the same revision deployed to different environments instead of maintaining different revisions for each environment

What I meant is - store the value "xyz.abc.com" as an Environment KVM

In your proxy code

<PreFlow name="PreFlow">
  <Request>
    <!-- Get cn info from kvm and store in a flow variable like kvm.cn.info -->
    <Step>
      <Name>KVM-Get-CN-Info</Name>
    </Step>
    <Step>
      <Name>RF_Cert_CN_Match</Name>
      <Condition>(client.cn != null) and ( client.cn != kvm.cn.info)</Condition>
    </Step>
    <Step>
      <Name>VerifyAPIKey_QueryParam</Name>
    </Step>
    <Step>
      <Name>AM_RemoveAPIKey_QueryParam</Name>
    </Step>
 </Request>
 <Response/>
</PreFlow>

Hope this helps

View solution in original post

3 REPLIES 3

HI @MNarayan

I will need to check if there is a way to do that.

But instead of having the actual value in the proxy condition, why not have them in KVM ? Tomorrow, if you want to change the value for a given environment, you don't have to change the proxy code and re-deploy. By just changing the value in the KVM, it automatically starts working without deployment

Also with this you can have the same revision deployed to different environments instead of maintaining different revisions for each environment

What I meant is - store the value "xyz.abc.com" as an Environment KVM

In your proxy code

<PreFlow name="PreFlow">
  <Request>
    <!-- Get cn info from kvm and store in a flow variable like kvm.cn.info -->
    <Step>
      <Name>KVM-Get-CN-Info</Name>
    </Step>
    <Step>
      <Name>RF_Cert_CN_Match</Name>
      <Condition>(client.cn != null) and ( client.cn != kvm.cn.info)</Condition>
    </Step>
    <Step>
      <Name>VerifyAPIKey_QueryParam</Name>
    </Step>
    <Step>
      <Name>AM_RemoveAPIKey_QueryParam</Name>
    </Step>
 </Request>
 <Response/>
</PreFlow>

Hope this helps

Thanks @Sai Saran Vaidyanathan. I thought of KVM option but just posted to know whether there is a way with config.json


sure.. might get tricky.. I would highly recommend the KVM option as its much better design wise and reduces operational overhead

Please accept this answer if it helps