[source,unlang]
---
-map client [<ipaddr>] { // <1>
- &Tmp-String-0 = 'nas_type' // <2>
- &Tmp-String-1 := 'shortname' // <3>
- &Tmp-String-3 += 'groups' // <4>
+map client [<ipaddr>] { // <1>
+ &Foo = 'nas_type' // <2>
+ &Bar := 'shortname' // <3>
+ &Baz += 'groups' // <4>
}
---
<1> By default `map client { ... }` will operate on the current client, but alternative
clients can by specified by `<ipaddr>`.
<2> Assigns the value of the `nas_type` field from the client definition to
- `&Tmp-String-0` if `&Tmp-String-0` doesn't exist.
+ `&Foo` if the `&Foo` attribute does not exist.
<3> Assigns the value of the `shortname` field from the client definition to
- `&Tmp-String-1`.
-<4> Creates multiple `&Tmp-String-3` attributes from a custom group field associated
+ `&Bar`.
+<4> Creates multiple `&Baz` attributes from a custom group field associated
with the client.
look like this:
map csv &User-Name {
- &reply.Reply-Message := 'color'
- &Tmp-Integer-0 := 'count'
+&reply.Reply-Message := 'color'
+&Tmp-Integer-0 := 'count'
}
This map does the same operations as the key / update
key = &User-Name
update reply {
&Reply-Message := 'color'
- &Tmp-Integer-0 := 'count'
+ &Foo := 'count'
}
}
```
[options="header,autowidth"]
|===
| Pairs | Description
-| request | attributes from the request
-| config | attributes from the configuration items list
-| reply | attributes from the reply
-| session-state | attributes that persist over multiple request/response rounds.
+| &request | attributes from the request
+| &config | attributes from the configuration items list
+| &reply | attributes from the reply
+| &session-state | attributes that persist over multiple request/response rounds.
|===
```
exec echo {
wait = yes
- program = "/bin/echo Tmp-String-0 := %{User-Name}"
- input_pairs = request
- output_pairs = reply
+ program = "/bin/echo Filter-Id := %{User-Name}"
+ input_pairs = &request
+ output_pairs = &reply
shell_escape = yes
# timeout = 10
}
[source, unlang]
----
map json "%rest(GET http://example.org/api/user/%{User-Name})" {
- &Tmp-Integer-0 := '$.account number'
+ &Foo := '$.account number'
&Group += '$.groups.*'
}
----
[source,unlang]
----
-&control.Tmp-String-0 := '$.my.json.payload[1]'
-&reply.Reply-Message := "Validation of %{control.Tmp-String-0} is %json_jpath_validate($.my.json.payload[1])"
+string payload
+payload := '$.my.json.payload[1]'
+&reply.Reply-Message := "Validation of %{payload} is %json_jpath_validate($.my.json.payload[1])"
----
.Output
[source,unlang]
----
-&control.Tmp-String-0 := "caipirinha/gelada"
-&reply.Reply-Message := "The string %{control.Tmp-String-0} should be %json_quote(%{control.Tmp-String-0}) to be a valid JSON string."
+string path
+&path := "caipirinha/gelada"
+&reply.Reply-Message := "The string %{path} should be %json_quote(%{path}) to be a valid JSON string."
----
.Output
# ntlm_auth_username = "username: %mschap(User-Name)"
# ntlm_auth_domain = "nt-domain: %mschap(NT-Domain)"
# local_cpw = %exec('/path/to/script', %mschap(User-Name), %{MS-CHAP-New-Password.Cleartext})
- local_cpw = %sql("UPDATE radcheck set value='%{MS-CHAP-New-NT-Password}' where username='%{User-Name}' and attribute='Password.NT'")
+# local_cpw = %sql("UPDATE radcheck set value='%{MS-CHAP-New-NT-Password}' where username='%{User-Name}' and attribute='Password.NT'")
}
# use_open_directory = yes
# allow_retry = yes
#
# [source,unlang]
# ---
-# map client [<ipaddr>] { // <1>
-# &Tmp-String-0 = 'nas_type' // <2>
-# &Tmp-String-1 := 'shortname' // <3>
-# &Tmp-String-3 += 'groups' // <4>
+# map client [<ipaddr>] { // <1>
+# &Foo = 'nas_type' // <2>
+# &Bar := 'shortname' // <3>
+# &Baz += 'groups' // <4>
# }
# ---
#
# <1> By default `map client { ... }` will operate on the current client, but alternative
# clients can by specified by `<ipaddr>`.
# <2> Assigns the value of the `nas_type` field from the client definition to
-# `&Tmp-String-0` if `&Tmp-String-0` doesn't exist.
+# `&Foo` if the `&Foo` attribute does not exist.
# <3> Assigns the value of the `shortname` field from the client definition to
-# `&Tmp-String-1`.
-# <4> Creates multiple `&Tmp-String-3` attributes from a custom group field associated
+# `&Bar`.
+# <4> Creates multiple `&Baz` attributes from a custom group field associated
# with the client.
#
#
update reply {
&Reply-Message := 'color'
- &Tmp-Integer-0 := 'count'
+ &Foo := 'count'
}
#
# Dynamic translation is done on this field, so things like
# the following example will work.
#
- program = "/bin/echo Tmp-String-0 := %{User-Name}"
+ program = "/bin/echo Filter-Id := %{User-Name}"
#
# input_pairs:: The attributes which are placed into the
# [source, unlang]
# ----
# map json "%rest(GET http://example.org/api/user/%{User-Name})" {
-# &Tmp-Integer-0 := '$.account number'
+# &Foo := '$.account number'
# &Group += '$.groups.*'
# }
# ----
#
# [source,unlang]
# ----
-# &control.Tmp-String-0 := '$.my.json.payload[1]'
-# &reply.Reply-Message := "Validation of %{control.Tmp-String-0} is %json_jpath_validate($.my.json.payload[1])"
+# string payload
+# payload := '$.my.json.payload[1]'
+# &reply.Reply-Message := "Validation of %{payload} is %json_jpath_validate($.my.json.payload[1])"
# ----
#
# .Output
#
# [source,unlang]
# ----
-# &control.Tmp-String-0 := "caipirinha/gelada"
-# &reply.Reply-Message := "The string %{control.Tmp-String-0} should be %json_quote(%{control.Tmp-String-0}) to be a valid JSON string."
+# string path
+# &path := "caipirinha/gelada"
+# &reply.Reply-Message := "The string %{path} should be %json_quote(%{path}) to be a valid JSON string."
# ----
#
# .Output