| 1 |
= Built-in Modules |
| 2 |
|
| 3 |
In some cases, it is useful to reject a request immediately or perform another |
| 4 |
action on it. The built-in modules can be used to perform these actions. These |
| 5 |
modules are named for the return codes given in the xref:module.adoc[module] |
| 6 |
section. |
| 7 |
|
| 8 |
In practice, these modules are implemented by the `always` module and |
| 9 |
exist so that a success or failure can be forced during the processing |
| 10 |
of a policy. |
| 11 |
|
| 12 |
The names and behaviours of these modules are given below: |
| 13 |
|
| 14 |
`fail`:: |
| 15 |
Causes the request to be treated as if a database failure had |
| 16 |
occurred. |
| 17 |
|
| 18 |
`noop`:: |
| 19 |
Do nothing. This also serves as an instruction to the |
| 20 |
configurable failover tracking that nothing was done in the current |
| 21 |
section. |
| 22 |
|
| 23 |
`ok`:: |
| 24 |
Instructs the server that the request was processed properly. This keyword can be used to over-ride earlier failures if the local |
| 25 |
administrator determines that the failures are not catastrophic. |
| 26 |
|
| 27 |
`reject`:: |
| 28 |
Causes the request to be immediately rejected. |
| 29 |
|
| 30 |
.Example |
| 31 |
[source,unlang] |
| 32 |
---- |
| 33 |
if (!&User-Name) { |
| 34 |
update reply { |
| 35 |
Reply-Message := "We don't know who you are" |
| 36 |
} |
| 37 |
reject |
| 38 |
} |
| 39 |
---- |
| 40 |
|
| 41 |
// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. |
| 42 |
// Development of this documentation was sponsored by Network RADIUS SAS. |