summaryrefslogtreecommitdiffstats
path: root/doc/antora/modules/unlang/pages/module_builtin.adoc
blob: f21a128953fae289648abf55e380c8e6b0f1df68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
= Built-in Modules

In some cases, it is useful to reject a request immediately or perform another
action on it.  The built-in modules can be used to perform these actions.  These
modules are named for the return codes given in the xref:module.adoc[module]
section.

In practice, these modules are implemented by the `always` module and
exist so that a success or failure can be forced during the processing
of a policy.

The names and behaviours of these modules are given below:

`fail`::
Causes the request to be treated as if a database failure had
occurred.

`noop`::
Do nothing. This also serves as an instruction to the
configurable failover tracking that nothing was done in the current
section.

`ok`::
Instructs the server that the request was processed properly. This keyword can be used to over-ride earlier failures if the local
administrator determines that the failures are not catastrophic.

`reject`::
Causes the request to be immediately rejected.

.Example
[source,unlang]
----
if (!&User-Name) {
    update reply {
        Reply-Message := "We don't know who you are"
    }
    reject
}
----

// Copyright (C) 2020 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.