]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add test of rlm_radius as originator using subrequest
authorNick Porter <nick@portercomputing.co.uk>
Mon, 28 Apr 2025 11:40:13 +0000 (12:40 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 28 Apr 2025 12:24:52 +0000 (13:24 +0100)
src/tests/radclient/config/radiusd.conf

index bc71e664dcf106436fdf42f4db3a631e0bca2ec0..1b276820cf21aa2136781303d21a3fcfa7b6c72e 100644 (file)
@@ -94,6 +94,17 @@ modules {
                        secret = testing123
                }
        }
+
+       radius originate {
+               mode = client
+               type = Access-Request
+               transport = udp
+               udp {
+                       ipaddr = 127.0.0.1
+                       port = $ENV{TEST_PORT}
+                       secret = testing123
+               }
+       }
 }
 
 #
@@ -173,6 +184,21 @@ server test {
                        return
                }
 
+               if (NAS-Identifier == 'originate') {
+                       subrequest ::Access-Request {
+                               request += parent.request
+                               request.NAS-Identifier := 'originate-client'
+                               originate
+                       }
+                       reply.Reply-Message := 'Successfully originated'
+                       accept
+                       return
+               }
+
+               if ((NAS-Identifier == 'originate-client') && (Proxy-State)) {
+                       reject
+               }
+
                if (User-Name == "bob") {
                        accept
                } else {