Control sub-TLV attributes order in rest module

Alan DeKok aland at deployingradius.com
Mon Sep 11 13:47:26 CEST 2017


> On Sep 11, 2017, at 7:02 AM, Avner Elizarov <avnerelizarov at gmail.com> wrote:
> 
> The documentation is quite lacking for the rest module, and contains
> features not yet published in version 3 (such as sub attributes).

  Well, no.  V3 supports sub attributes.  You just list them sequentially.  As I suggested.

  If you run the server in debug mode and send it multiple sub-attributes, you'll see them in the debug output... sequentially. 

> I did try
> many different options but none of them seemed to do the trick.

  See the FAQ for "it doesn't work".

> When
> sending several instances of the same sub attribute in the json message
> only the last one was parsed by the rest module.

 The code parses all of them. If you use the correct operator, it uses the operator to determine whether to add them, over-write earlier ones, etc.

  This is documented...

> Sending each sub attribute
> as a list of values works for parsing them all, but puts them one after the
> other in the radius packet and this is not what I need.

  Which is why I didn't suggest doing that.

> I just want a way
> to send the same attribute several times and be able to control their order
> in the resulting radius packet.

  You do what I suggested.

> To summarize, I have a tlv with 2 sub attributes (sub1 and sub2). I want to
> send several instances of sub_1 and several instances of sub_2 in a json
> message to the rest module such that the resulting radius packet generated
> from the rest module will contain each instance of sub_attr_2 after its
> matching instance of sub_attr_1.

  Which is what you've been saying... over and over.  That much is clear.  There's no need to repeat it again.

> I would appreciate a concrete json example :-)

  The documentation describes what format to use.

  You've clearly got far enough to actually create json which mostly works, but...

- you don't actually say what you did
- you don't post debug outputs

  This is an open source project, where people answer questions here for free.  I'm happy to fix bugs in the server, because that's my responsibility.  It's your responsibility to follow the documentation.  Both for how to create json, and also for what to do when things go wrong.

  Alan DeKok.




More information about the Freeradius-Users mailing list