From: Alan T. DeKok Date: Tue, 12 Dec 2023 13:34:35 +0000 (-0500) Subject: notes for the future for string casting X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cded8fe333ab5394b1f2a8390f9636c684d9792;p=thirdparty%2Ffreeradius-server.git notes for the future for string casting --- diff --git a/src/tests/keywords/pairs b/src/tests/keywords/pairs index 4ded3a1876a..bba8f332fce 100644 --- a/src/tests/keywords/pairs +++ b/src/tests/keywords/pairs @@ -1,6 +1,7 @@ # # PRE: update if # + &request -= &Packet-Type[*] &Tmp-Group-0 += { @@ -10,6 +11,21 @@ &Tmp-Integer-0 = 7331 } +# +# string pairs +# +# @todo - this doesn't work. tmpl_afrom_attr_substr() doesn't check +# the tail da, or the parent of the tail. +# +#&pairs := %{(string) %{Tmp-Group-0.[*]}} + +# +# However, this does "work". It returns a concatenated string +# of the _values_ of the attributes, which doesn't include th +# attribute names. +# +#&pairs := %cast('string', %{Tmp-Group-0.[*]}) + &request += { &Tmp-String-1 = "%concat(%pairs(Tmp-Group-0.[*]), ', ')" &Tmp-String-2 = "%pairs(Tmp-Group-0.Tmp-String-0)"