Is there a XLAT IF(..) like expansion?

Alan DeKok aland at deployingradius.com
Tue Mar 28 22:21:06 UTC 2023


On Mar 29, 2023, at 2:41 AM, g4-lisz at 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.



More information about the Freeradius-Users mailing list