Is there a XLAT IF(..) like expansion?
Hello again I'm trying to accomplish the following (pseudo code): In rlm_rest module config: authenticate { body = "json" data = '{ "token" : "xxxxxxx", "states": [ "x", "y" ], "resourceIds: PSEUDO_CODE>> IF(%{control:Cust-Resource-Uuid}, [ "%{control:Cust-Resource-Uuid}" ], null) <<PSEUDO_CODE , }' } I.e. when the custom attribute is set, the JSON's "resourcesIds" property should be an array containing the attribute's string content, otherwise "null". Your help is much appreciated! Cheers, Till
On Mar 29, 2023, at 2:41 AM, g4-lisz@tonarchiv.ch wrote:
I'm trying to accomplish the following (pseudo code):
In rlm_rest module config:
authenticate { body = "json" data = '{ "token" : "xxxxxxx", "states": [ "x", "y" ], "resourceIds: PSEUDO_CODE>> IF(%{control:Cust-Resource-Uuid}, [ "%{control:Cust-Resource-Uuid}" ], null) <<PSEUDO_CODE , }' }
I.e. when the custom attribute is set, the JSON's "resourcesIds" property should be an array containing the attribute's string content, otherwise "null".
Just do the "if" before running the REST module. Put the results into an attribute, and then use that attribute in the rest module configuration. Alan DeKok.
March 29, 2023 12:21 AM, "Alan DeKok" <aland@deployingradius.com> wrote:
On Mar 29, 2023, at 2:41 AM, g4-lisz@tonarchiv.ch wrote:
I'm trying to accomplish the following (pseudo code):
In rlm_rest module config:
authenticate { body = "json" data = '{ "token" : "xxxxxxx", "states": [ "x", "y" ], "resourceIds: PSEUDO_CODE>> IF(%{control:Cust-Resource-Uuid}, [ "%{control:Cust-Resource-Uuid}" ], null) <<PSEUDO_CODE , }' }
I.e. when the custom attribute is set, the JSON's "resourcesIds" property should be an array containing the attribute's string content, otherwise "null".
Just do the "if" before running the REST module. Put the results into an attribute, and then use that attribute in the rest module configuration.
Alan DeKok.
I see. Thanks a lot for your quick reply Alan! Till
participants (2)
-
Alan DeKok -
g4-lisz@tonarchiv.ch