Skip to content

Commit 0ad0dca

Browse files
authored
- motp_enable optional now (#767)
- framed_ip_address/framed_ip_netmask added to support Framed-IP-Address / Framed-IP-Netmask attributes
1 parent cd716e5 commit 0ad0dca

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FreeRADIUSUser.inc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use RESTAPI\Fields\IntegerField;
1010
use RESTAPI\Fields\StringField;
1111
use RESTAPI\Responses\ValidationError;
1212
use RESTAPI\Validators\RegexValidator;
13+
use RESTAPI\Validators\IPAddressValidator;
1314

1415
/**
1516
* Defines a Model that represents FreeRADIUS Users
@@ -58,7 +59,8 @@ class FreeRADIUSUser extends Model {
5859
help_text: 'The encryption method for the password.',
5960
);
6061
$this->motp_enable = new BooleanField(
61-
required: true,
62+
required: false,
63+
default: false,
6264
indicates_true: 'on',
6365
indicates_false: '',
6466
internal_name: 'varusersmotpenable',
@@ -110,6 +112,24 @@ class FreeRADIUSUser extends Model {
110112
],
111113
help_text: 'A description for this user.',
112114
);
115+
$this->framed_ip_address = new StringField(
116+
required: false,
117+
default: '',
118+
internal_name: 'varusersframedipaddress',
119+
allow_empty: true,
120+
validators: [new IPAddressValidator(allow_ipv4: true, allow_ipv6: false)],
121+
help_text: 'Framed-IP-Address MUST be supported by NAS. ' .
122+
'If the OpenVPN server uses a subnet style Topology the RADIUS server MUST ' .
123+
'also send back an appropriate Framed-IP-Netmask value matching the VPN Tunnel Network.'
124+
);
125+
$this->framed_ip_netmask = new StringField(
126+
required: false,
127+
default: '',
128+
internal_name: 'varusersframedipnetmask',
129+
allow_empty: true,
130+
validators: [new IPAddressValidator(allow_ipv4: true, allow_ipv6: false)],
131+
help_text: 'Framed-IP-Netmask MUST be supported by NAS'
132+
);
113133

114134
parent::__construct($id, $parent_id, $data, ...$options);
115135
}

0 commit comments

Comments
 (0)