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

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Wed Mar 29 12:22:37 UTC 2023


March 29, 2023 12:21 AM, "Alan DeKok" <aland at deployingradius.com> wrote:

> 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.
> 
I see.

Thanks a lot for your quick reply Alan!
Till


More information about the Freeradius-Users mailing list