Hi,
I am using node.js to fetch keys from a vault and I need to use those keys in the subsequent policies.
Earlier I was fetching only one key/value pair from vault like below and it was giving me its value directly in the javascript code.
orgVault.get(‘key’,function(err, securevalue) {
apigee.setVariable(req,“var_secretvalue”,securevalue);
});
Now I am trying to fetch more number of key/value pairs and calling same get function number of times and setting those values to different variables like above.
I can see that the callback function returns the values properly and those are printed in node.js logs(and also observed that they will not be shown in the trace logs immediatedly like it happens for other variables created by different policies)
But when I am trying to use these variables in a service callout policy I am getting ‘unresolved variable error’.
I also tried fetching these variables in a javascript(immediately after the node call execution) and setting these to different variables from the script but that is also not working.
I read on the page http://docs.apigee.com/api-services/content/access-flow-variables-nodejs the we need to set the variable in the request object only and by using the setVariable method like I used above.
Can somebody please help and let me know what am I missing here?
Thanks,
Santosh