File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ class WireGuardTunnel extends Model {
5151 indicates_false: 'no ' ,
5252 help_text: 'Enables or disables this tunnels and any associated peers. ' ,
5353 );
54+ $ this ->descr = new StringField (
55+ required: false ,
56+ default: '' ,
57+ help_text: 'A description for this WireGuard tunnel. ' ,
58+ );
5459 $ this ->listenport = new PortField (
5560 unique: true ,
5661 default: '51820 ' ,
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ class APIModelsWireGuardTunnelTestCase extends TestCase {
124124 $ tunnel = new WireGuardTunnel (
125125 privatekey: 'KG0BA4UyPilHH5qnXCfr6Lw8ynecOPor88tljLy3AHk= ' ,
126126 listenport: '55000 ' ,
127+ descr: 'test ' ,
127128 async: false ,
128129 );
129130 $ tunnel ->create (apply: true );
@@ -134,6 +135,7 @@ class APIModelsWireGuardTunnelTestCase extends TestCase {
134135 $ this ->assert_str_contains ($ wg_showconf ->output , 'ListenPort = ' . $ tunnel ->listenport ->value );
135136 $ this ->assert_str_contains ($ wg_showconf ->output , 'PrivateKey = ' . $ tunnel ->privatekey ->value );
136137 $ this ->assert_str_contains ($ wg_show ->output , 'public key: ' . $ tunnel ->publickey ->value );
138+ $ this ->assert_equals ($ tunnel ->descr ->value , 'test ' );
137139
138140 # Update the tunnel with new values
139141 $ tunnel ->from_representation (privatekey: 'GNdQw+ujEIVgys4B2dDCXcBpiiQsNd2bAq5hnTp+smg= ' , listenport: '51820 ' );
You can’t perform that action at this time.
0 commit comments