]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
notes for the future for string casting
authorAlan T. DeKok <aland@freeradius.org>
Tue, 12 Dec 2023 13:34:35 +0000 (08:34 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 14 Dec 2023 00:42:55 +0000 (19:42 -0500)
src/tests/keywords/pairs

index 4ded3a1876af4267f054e551b6591b70b706c8cb..bba8f332fcec4a608bc0e627a69f91f6dd870992 100644 (file)
@@ -1,6 +1,7 @@
 #
 # PRE: update if
 #
+
 &request -= &Packet-Type[*]
 
 &Tmp-Group-0 += {
        &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)"