Updates to "unlang"

Phil Mayers p.mayers at imperial.ac.uk
Fri Dec 11 15:41:49 CET 2015


On 11/12/15 14:08, Alan DeKok wrote:
> On Dec 11, 2015, at 8:57 AM, Phil Mayers <p.mayers at imperial.ac.uk>
> wrote:
>>
>> On 11/12/15 13:55, Alan DeKok wrote:
>>
>>> Ideas?  Comments?
>>
>> The module/argument thing is a nice idea, particularly if it is
>> possible to soft-define them in policy.d
>
> Examples?  Use-cases?

It's a bit vague, but a lot of the datastore modules - SQL, redis, etc. 
- have way more functionality than a simple lookup/map construct can 
easily express. Being able to "call" methods with parameters may provide 
a cleaner, more expressive syntax, which lowers cognitive load and 
contributes to ease of maintenance.

As an example, the built-in cache module involves a (IMO) fairly ugly 
set of constructs relying on control attributes to distinguish between 
check, lookup, set and delete.

if (cache.exists %{Key}) {
   othercache.delete %{Other-Key}
}

...as opposed to:

update {
   control:Cache-Status-Only = yes
}
cache
if (ok) {
   update {
     control:Cache-Status-Only = no
     control:Cache-TTL = 0
   }
   othercache
}
update {
   control:Cache-Status-Only !* ANY
   control:Cache-TTL !* ANY
}


More information about the Freeradius-Devel mailing list